[Patriot CTF 2024]
Date : held on September 21 to 23, 2024 (48h)
CTF 때 못풀고 아쉬워서 묵혀놨다가, 드디어 정신차리고 CTF 복기
reference
https://youtu.be/pnBY3SjX15k?feature=shared
https://github.com/ramenhost/ctf-writeups/tree/main/patriot-ctf-2024/forensics/simple-exfiltration

We've got some reports about information being sent out of our network. Can you figure out what message was sent out.
192.168.237.132
192.168.237.1 사이에서 http 요청이 반복중이다

Solution
Wireshark에서 pcap 파일을 분석한 뒤, 주어진 ICMP ping 패킷 ttl 필드가 요청 당 1바이트를 전송하는 은밀한 채널로 사용되었음을 알 수 있다.
분석방법
1. source - destination 사이에 특정 ip 사이에서만 상호작용이 발생 (192.168.237.132 + 192.168.237.1)
2. 프로토콜 종류 확인 (ARP, ICMP, TCP, HTTP 등의 프로토콜이 사용됨)
3. ICMP 프로토콜을 분석해보니, Echo (ping)을 요청하고 있음.
4. 요청(request)에서 ttl=112(p), ttl=99(c), ttl=116(t), ttl=102(f), ttl=123({)
pctf{~~~} 플래그가 보인다.
이러한 의미에서 ttl 필드가 ping request를 하면서, 1바이트(ASCII)를 전송하는데 몰래 쓰였다는 의미로 보인다.

Wireshark에서 icmp.type과 icmp.type == 8을 사용하는 것에는 다음과 같은 차이가 있습니다.1. icmp.type
2. icmp.type == 8
추가적으로 알아두면 좋은 ICMP 필터정리
|

이제 하나씩 일일이 받아 적거나, python, tshark와 같은 툴을 사용해서 플래그를 추출해내면 된다.
| tshark -r exfiltration_activity_pctf_challenge.pcapng -Y "icmp.type == 8" -Tfields -e ip.ttl | awk '{printf "%c", $1} END{printf "\n"}' |
알게된 점
ICMP 프로토콜에서 echo ping은 cmd에서 ping google.com할 때 그 ping을 의미하는 거였다.