macOS xterm-256color zsh 947 views

Virseccon CTF Loopback pcap solution using Chepy.

https://github.com/securisec/chepy

from chepy import Chepy

c = Chepy("loopback.pcap")

flag = (
    # read pcap
    c.read_pcap()
    # extract all ICMP payloads
    .pcap_payload("ICMP")
    # Because payloads repeat, extract only one
    .select_every_n(2)
    # pull the 16th byte of each payload which also repeats
    .loop_list("slice", {"start": 16, "end": 17})
    # join payload to form PNG file
    .join_list(b"")
    # extract binary strings
    .extract_strings()
    # extract flag
    .search_ctf_flags(prefix="LLS")
)
print(flag)