Search

[MISC] WS2

Year
2020
CTF Name
Angstrom CTF
Category
MISC
Type
PCAP

1. Description

No ascii, not problem :)
Author: JoshDaBosh

2. Write up

# file recording.pcapng recording.pcapng: pcap-ng capture file - version 1.0
Bash
복사
문제 파일은 pcap 파일이다.
2# strings recording.pcapng | grep flag Content-Disposition: form-data; name="file"; filename="flag.jpg" <strong>Success:</strong>File '/Users/toaster/Desktop/personal/projects/angstromctf/2020/misc/ws2/flag.jpg' upload success!<br><a href="http://localhost/">back</a><hr><small>Powerd By: bones7456, check new version at <a href="http://li2z.cn/?s=SimpleHTTPServerWithUpload">here</a>.</small></body>
Bash
복사
문제 설명을 보면 flag는 ascii또는 문자열 형태로 존재하지 않는 것을 유추할 수 있다.
strings 명령어를 이용하여 flag 키워드로 검색해봤고 flag.jpg를 업로드한 흔적을 찾을 수 있다.
따라서 Wireshark를 이용해서 파일을 추출 할 것이다.
File - Export Objects - HTTP에서 파일 추출이 가능하다.
flag.jpg를 업로드한 패킷인 54번째 패킷을 저장한다.
저장한 파일을 HxD로 열어보면 저장한 54번째 패킷을 확인할 수 있고 이 중에서 실제 jpg 파일을 추출한다. jpg파일은 위의 그림과 같이 FF D8 FF E0 라는 파일 시그니처를 갖고있고 빨간 부분을 제외한 윗 부분을 제거하고 다시 저장하면 플래그가 나온다.

3. FLAG

actf{ok_to_b0r0s-4809813}