# Jeff Wichman ################# ### Lab Setup ### ################# For the analysis of the pcap the main system I will be working with is standard SIFT workstation available from the Sans Institute. However, most of the commands and tools will work on a Linux or Windows based installation. ######################## ### Initial Analysis ### ######################## Immediately after extracting the pcap from the zip file we want to validate both the MD5 and SHA256 hash signatures. We do this for two main reasons. One is to make sure the evidence file we are working with has not been tampered. Second we do this so that in the event we pass our results to another analyst they can be sure we worked with a clean evidence file. Running both md5deep and sha256deep verify we are working with a file that has not been tampered with (to the best of our knowledge). md5deep evidence06.pcap efac05c50c0ae92bf0818e98763920bd evidence06.pcap sha256deep.exe evidence06.pcap fa5fc1ffad525688626c301372b37e101efcbbbd124f9781f5701648e6a02be3 evidence06.pcap So we know that both files we are working with match the signatures provided. I always like to run pcaps (or any file for that matter) and run it past Clam-AV. While this is not always a 100% guarantee that the file is free of malicious code, it just means it has past one test. The results of the virus scan are shown below. Scan Started Mon Jun 07 13:52:51 2010 ------------------------------------------------------------------------------- evidence06.pcap: Exploit.CVE_2010_0249 FOUND ----------- SCAN SUMMARY ----------- Known viruses: 787882 Engine version: 0.96 Scanned directories: 0 Scanned files: 1 Infected files: 1 Data scanned: 2.00 MB Data read: 2.26 MB (ratio 0.88:1) Time: 12.078 sec (0 m 12 s) -------------------------------------- Completed -------------------------------------- Clam-AV detected an exploit for CVE_2010_0249. A quick Google search brings two results which should jump out at the analyst. Both links appear at the top of the results page (http://www.google.com/search?hl=en&rls=com.microsoft:*&&sa=X&ei=A0YNTPiPEJD2MKvehbYE&ved=0CB0QBSgA&q=CVE+2010+0249) The two links are: MITRE -- http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2010-0249 Microsoft Security Advisory -- http://www.microsoft.com/technet/security/advisory/979352.mspx) Looking up the CVE number at the Mitre website we can see that this CVE is currenlty under review and is relates to a vulnerability in Microsoft Internet Explorer 6, 6 SP1, 7, and 8. According to Mitre, the vulnerability allows remote attackers to execute arbitrary code by accessing a pointer associated with a deleted object, related to incorrectly initialized memory and improper handling of objects in memory, as exploited in the wild in December 2009 and January 2010 during Operation Aurora, aka "HTML Object Memory Corruption Vulnerability." Examining the second link (Microsoft Security Advisory) we see that a brief statement that "Microsoft has completed the investigation the public reports of this vulnerability. We have issued MS10-002 to address this issue." There is a link to the Microsoft Security Bulletin (MS10-002, http://www.microsoft.com/technet/security/bulletin/ms10-002.mspx). Most of the detail regarding the vulnerability can be found at this page, including the executive summary, affected software, and workarounds. [analyst comments: not a great way to start off the new year]. We can now be certain that the pcap file likely contains at least one piece of known piece of malware. Now we get to start examining the pcap file. ############################# ### Examining the PCAP ### ############################# Normally I use WireShark but I am also attempting to learn more about the automation aspect of tools such as tshark, editcap, capinfos, mergecap. So through most of this case I will be using the CLI tools, however in some areas I have yet to figure out how to pull obtain the necessary data in tshark. So I will attempt to document both methods (if I was able to perform the analysis using both tools). I always like to start with a summary of the packet capture. Using Wireshark: After loading the packet capture, click Statistics - Summary. The CLI tool for displaying the summary of a packet capture is capinfos(the output is shown below). capinfos evidence06.pcap File name: evidence06.pcap File type: Wireshark/tcpdump/... - libpcap File encapsulation: Ethernet Number of packets: 2554 File size: 2371708 bytes Data size: 2330820 bytes Capture duration: 198 seconds Start time: Wed Apr 28 18:39:59 2010 End time: Wed Apr 28 18:43:17 2010 Data byte rate: 11745.61 bytes/sec Data bit rate: 93964.91 bits/sec Average packet size: 912.62 bytes Average packet rate: 12.87 packets/sec Although there is really is no actionable information in these results, the information is important. We now know the start time, end time, duration of the packet capture as well as some other information. Knowning the start and end time (even of the packet capture itself is always important, for our timeline. However, let's get a little more accurate on the date/time for the initial packet. The WireShark method: After loading the packet capture finding frame number 1 should be easy enough. Looking at the three "windows" that are open in Wireshark (Packet List, Packet Details, and Packet Bytes) make sure the Packet List Window has the No. 1 frame selected. Now in the Packet Details windows expand the Frame 1 information. Here we see the arrival time of the packet. The tshark method: "tshark -r evidence06.pcap -R frame.time -T fields -e Frame.number -e Frame.time" Which results in the following output (reduced by analysis) 1 Apr 28, 2010 18:39:59.311284000 2 Apr 28, 2010 18:39:59.311382000 3 Apr 28, 2010 18:39:59.656689000 4 Apr 28, 2010 18:39:59.656768000 5 Apr 28, 2010 18:39:59.656892000 6 Apr 28, 2010 18:39:59.657013000 7 Apr 28, 2010 18:39:59.657108000 8 Apr 28, 2010 18:39:59.657213000 9 Apr 28, 2010 18:39:59.773396000 ... 2547 Apr 28, 2010 18:43:13.704484000 2548 Apr 28, 2010 18:43:13.704509000 2549 Apr 28, 2010 18:43:13.704633000 2550 Apr 28, 2010 18:43:13.704719000 2551 Apr 28, 2010 18:43:17.751040000 2552 Apr 28, 2010 18:43:17.751953000 2553 Apr 28, 2010 18:43:17.752630000 2554 Apr 28, 2010 18:43:17.753022000 Since we have been told that this was a phishing attack we can assume that there is likely a HTTP request of some sort. Let's examine the packet capture for any tell-tale signs of web (HTTP) requests. The Wireshark method: With our Filter window clear, type "http.request" (without the quotes) and hit apply. The tshark method: "tshark -r evidence06.pcap -R http.request -T fields -e frame.number -e frame.time -e ip.src -e http.host -e http.request.uri" will output the lines below which answer questions 1 and 3a respectively. Since it one of our goals here is to include a timeline I added a couple of extra items to the output. #1 Apr 28, 2010 18:39:59.311284000 10.10.10.70 10.10.10.10:8080 /index.php #9 Apr 28, 2010 18:39:59.773396000 10.10.10.70 10.10.10.10:8080 /index.phpmfKSxSANkeTeNrah.gif We can see that this provides us with the answers to questions 1 and 3a respectively. Now that we know Evil Ann's IP address, let's look at the other conversations between those two hosts. The reason for this is to get a feel for any other communication that might have been happening between the hosts. The Wireshark method: Click Statistics - Conversations, select the "TCP: 10" tab. Below is the output from the TCP: 10 window. Looking at this information provides an analyst with a good amount of information. 1. Looking at Vick's host IP address (Address B) we can see that Port B appears to be incrementing by one (1) for each new stream. 2. The streams when Vick's IP (Address B) is communicating with Evil Ann's IP (Address A) on port 4445 seem to repeat as though it is some type of heartbeat or check-in (constantly every 5.0 seconds) until the last communication which a larger amount of information is transferred between hosts. 3. The most information is transferred between hosts when Port A == 4444 4. The Relative Start time for each stream allow us to build a fairly accurate timeline of events (minus the details, which we get to later). Address A Port A Address B Port B Packets Bytes Packets A-B Bytes A-B Packets A<-B Bytes A<-B Rel Start Duration bps A-B bps A<-B 10.10.10.10 8080 10.10.10.70 1035 13 7409 8 6463 5 946 0.000000000 65.5650 788.59 115.43 10.10.10.10 4444 10.10.10.70 1036 1403 1414123 979 1293203 424 120920 1.265851000 86.3216 119849.73 11206.46 10.10.10.10 4445 10.10.10.70 1037 30 1830 15 900 15 930 35.947030000 5.0398 1428.63 1476.25 10.10.10.10 4445 10.10.10.70 1038 30 1830 15 900 15 930 47.732517000 4.9574 1452.37 1500.78 10.10.10.10 4445 10.10.10.70 1039 30 1830 15 900 15 930 59.462957000 5.0395 1428.71 1476.33 10.10.10.10 4445 10.10.10.70 1040 30 1830 15 900 15 930 71.257992000 4.9476 1455.26 1503.77 10.10.10.10 4445 10.10.10.70 1041 30 1830 15 900 15 930 82.993986000 5.0241 1433.08 1480.85 10.10.10.10 4445 10.10.10.70 1042 30 1830 15 900 15 930 94.878166000 5.1712 1392.34 1438.75 10.10.10.10 4445 10.10.10.70 1043 30 1830 15 900 15 930 106.838688000 5.1325 1402.83 1449.59 10.10.10.10 4445 10.10.10.70 1044 927 896235 664 869359 263 26876 118.746261000 79.6955 87268.09 2697.87 The tshark Method: The tshark method for this one I have struggeled with. I am able to pull the Bytes information but I have not been able to figure out how to bring the relative start or Duration time in. If anyone knows how to do this easily, please share the secret forumla. So the command to pull this information is "tshark -r evidence06.pcap -z conv,tcp" ================================================================================ TCP Conversations Filter: