Skip to content

Khal1d-AL1/Cyberdefenders-Malware-Traffic-Analysis-3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 

Repository files navigation

Cyberdefenders-Malware-Traffic-Analysis-3

The Challenge gives a person knowledge on:

  • How network traffic flow occurs between a client and a server.
  • How certain protocols work and their purpose.
  • Type and signature of several malwares.

Identifying malware traffic and analyzing the captured network packets to identify patterns, behaviors, and indicators of compromise (IoCs).

Generally, criminal groups use two methods for widespread distribution of malware. The most common method is malicious spam (malspam). This is a fairly direct mechanism, usually through an email attachment or a link in the message to the malware. However, malspam requires some sort of action by the user to be successful ( $${\color{red} (for \space example,\space opening \space an \space attached \space file ) }$$ .

The other method for widespread malware distribution is an $${\color{red}Exploit \space Kit \space (EK)}$$ . EKs are designed to work behind the scenes while a potential victim is browsing the web. An EK does not require any additional action by the end user.

2 1

EKs are a sophisticated delivery method. Malware distribution through an EK involves other components in the chain of events that lead to a malware infection.



Here we will focus on $${\color{red} Angler \space EK}$$, where Angler EK activity targeting computers running Microsoft Windows.

Angler Exploit Kit (EK) is one of the most sophisticated exploit kits in the world, used by cybercriminals to deliver diverse malware to compromised websites and infect victims. Angler EK first appeared in late 2013.

Angler EK’s exploit code and malware payload are highly obfuscated in order to bypass IDS/IPS. The kit uses 302 cushioning and Domain Shadowing to evade detection, and it checks anti-virus software and the virtualized environment before running the exploit.

Angler EK starts with a compromised legitimate website and uses this to redirect its visitors to an actual landing page. HTML iframe can be used to redirect the traffic and make detection more difficult. However, in order to evade detection by signature-based IDS/IPS, more and more redirection methods have recently been used in Angler EK. 302 Cushioning or cushion attack is used to redirect a victim’s browser to a compromised website. Domain shadowing is also used in Angler EK to bypass the domain URL blocklists and make it difficult to create an IOC list.

let's start Angler Exploit Kit Deobfuscation and Analysis, using following tools :

  • NetworkMiner
  • Wireshark
  • PacketTotal
  • VirusTotal
  • Brim (Zui)



Q(1) What is the IP address of the Windows VM that gets infected?

Open Wireshark Select >> Statistics >> Conversations >> IPv4

Ans: 192.168.137.62

1

or

Use Brim(Zui) query { event_type=="alert" |alerts:= union(alert.category) by src_ip, dest_ip}

2



Q(2) What is the Exploit kit (EK) name? (two words)

Ans: Exploit kit Named Angler will be detected by Snort

Upload thr PCAP file to VirusTotal

2



Q(3) What is the FQDN that delivered the exploit kit?

Ans: qwe.mvdunalterableairreport[.]net



1- Search about Domains related to the port 80

2- Use Wireshark filter {http}, and Go to > File > Export Objects > HTTP and search by port 80

3- go to Packet No 2957 that related to domain qwe[.]mvdunalterableairreport[.]net.

4- follow > HTTP stream, we can see a large amount of obfuscated text (obfuscated Payload).

5- Export the objects to find out, if any malicious file has been been sent.

6- will find an obfuscated file named 680VBFhpBNBJOYXebSxgwLrtbh3g6JFUllqksWFSsGshhwsguyNL26MGul2oZ3b8.



Q(4) What is the redirect URL that points to the exploit kit landing page?

Ans: Referer: http[:]//lifeinsidedetroit[.]com/02024870e4644b68814aadfbb58a75bc.php?q=e8bd3799ee8799332593b0b9caa1f426



We know that the FQDN that delivered the exploit kit is qwe.mvdunalterableairreport[.]net and its ip = 92.99.198.158

Use wireshark filter {http && ip.addr == 192.99.198.158 }

First packet with No 2272 select >> follow >> Http Stream

Will find the redirect URL http[:]//lifeinsidedetroit[.]com/02024870e4644b68814aadfbb58a75bc.php?q=e8bd3799ee8799332593b0b9caa1f426



Q(5) What is the FQDN of the compromised website?

Ans: the FQDN of the compromised website is www[.]earsurgery[.]org



[from Q(3)] We know that the FQDN that delivered the exploit kit is qwe.mvdunalterableairreport[.]net and its ip = 92.99.198.158

[from Q(3)] we know the Referer of qwe.mvdunalterableairreport[.]net is lifeinsidedetroit[.]com

ip of lifeinsidedetroit.com = 173.201.198.128

1- Use wireshark filter { http && ip.addr == 173.201.198.128 } will find only two packets select >> follow >> Http Stream

2- Will find Referer: http[://]adstairs[.]ro/544b29bcd035b2dfd055f5deda91d648.swf

3- Now it is found that the Referer of lifeinsidedetroit[.]com is http[:]//adstairs[.]ro

4- the ip of http[:]//adstairs[.]ro = 93.114.64.118

5- use wireshark filter {http && ip.addr == 93.114.64.118} will find only two packets select >> follow >> Http Stream

6- will find Referer: http[:]//www[.]earsurgery[.]org/

7- Now it is found that the Referer of http[:]//adstairs[.]ro is www[.]earsurgery[.]org

8- the ip of www[.]earsurgery[.]org] = 216.9.81.189

9- if we used wireshark filter {http && ip.addr == 216.9.81.189} will find the Referer: http[:]//www.earsurgery[.]org/

it is found that the Referer is itself, this mean that first website the Vicitem visited was www[.]earsurgery[.]org

  • Finally, the vicitem first visited the legitimate comporomized website "www[.]earsurgery[.]org"
  • www[.]earsurgery[.]org Redirected him to http[://]adstairs[.]ro
  • http://]adstairs[.]ro] edirected him again to lifeinsidedetroit[.]com]
  • lifeinsidedetroit[.]com Redirected him again to qwe[.]mvdunalterableairreport[.]net that delivered the exploit

=> Now We can Say, the FQDN of the compromised website is www[.]earsurgery[.]org



Q(6) Which TCP stream shows the malware payload being delivered? Provide stream number.

Ans: the stream number [tcp.stream eq 80]

  • Use Wireshark filter {http} and Go to > File > Export Objects > HTTP
  • at the search field ==> Text filter: 80
  • will find the packet number that delivered the payload with type octet-stream.
  • qwe[.]mvdunalterableairreport[.]net:80 and Packet No 2957

  • Go to Packet No 2957 that related to qwe[.]mvdunalterableairreport[.]net:80, and > follow > HTTP stream, we can see a large amount of obfuscated text
  • Export the objects to find out, if any malicious file has been been sent.
  • will find a malware payload being delivered with file named 680VBFhpBNBJOYXebSxgwLrtbh3g6JFUllqksWFSsGshhwsguyNL26MGul2oZ3b8.



Q(7) What is the IP address of the C&C server?

Ans: C&C server ip is 209.126.97.209



[from Q(3)] We know that the FQDN that delivered the exploit kit is qwe[.]mvdunalterableairreport[.]net and its ip = 92.99.198.158, where the Packet No:2957 and Time: 2014-12-04 18:27:36.961555

1- the exploit kit delivered to the compromized machine at Time: 2014-12-04 18:27:36.961555

2- So we will search after this time, because C&C Server Stage Comes after delivery Stage

3- Since the C&C server will be outside the local network, you can narrow down the traffic to external destinations by excluding local IP addresses. Following Wireshark filter will help you identify communications to a remote server.

4- Following Wireshark filter will display all packets after this time 2014-12-04 18:27:36.961555

{ frame.time >= "2014-12-04 18:27:36.961555" && ip.src != 192.168.137.0/24 && ip.dst == 192.168.137.62 && tcp }

5- Following filter to display all connections between 209.126.97.209 and 192.168.137.62

{ frame.time >= "2014-12-04 18:27:36.961555" && ip.addr== 209.126.97.209 }

Result: at packet No 3111 the local_ip 192.168.137.62 started an TCP connection with the external_ip 209.126.97.209 at time: 2014-12-04 18:27:43.578079, after the exploit kit delivered to the compromized machine with 8 seconds, where the source ip is src:192.168.137.62 and dstination ip is dst: 209.126.97.209

6- Finally: the exploit kit delivered to the compromized machine -----------------------------------> at time: 2014-12-04 18:27:36.961555

TCP connection was established from local_ip 192.168.137.62 to external_ip 209.126.97.209-------> at time: 2014-12-04 18:27:43.578079

7- Select >> follow >> Http Stream,



Q(8) What is the expiration date of the SSL certificate?

Ans: Certificate valid to => 11/24/2024 6:39:56 PM

1- Use NetworkMiner tool

2- select parameters

3- search on the ip = 209.126.97.209

4- will find the certificate Valid from 11/27/2014 6:39:56 PM to ---> 11/24/2024 6:39:56 PM



Question doesn't exist so we go to Question 10



Q(10) The malicious domain served a ZIP archive. What is the name of the DLL file included in this archive?

Ans: name of the DLL file: icVsx1qBrNNdnNjRI.dll

1- Use Brim(Zui) Query {"files" mime_type=="application/zip" }

2- will find mime_type:"application/zip" with the ip:192.99.198.158 of website qwe[.]mvdunalterableairreport[.]net that delivered the exploit kit.

3- Upload the file hash md5:017a6f0ffc32eda9e183580f61da8a17 to Virutotal.



Q(11) Extract the malware payload, deobfuscate it, and remove the shellcode at the beginning. This should give you the actual payload (a DLL file) used for the infection. What’s the MD5 hash of the payload?

Ans: MD5 hash = 3dfa337e5b3bdb9c2775503bd7539b1c

1- [from Q(3)] We know that the FQDN that delivered the exploit kit is qwe[.]mvdunalterableairreport[.]net at packet No 2957

2- Based on the detection timeframe of the Angler Payload from the previous question, being at time: 2014-12-04 18:27:36.961555, we can actually determine which file is the specific malware payload

3- by downloading all of the files associated with qwe.mvdunalterableairreport.net, will find an Octet Stream file with name:680VBFhpBNBJOYXebSxgwLrtbh3g6JFUllqksWFSsGshhwsguyNL26MGul2oZ3b8.

4- Go To CyberChef, we can see that the string "adR2b4nh" is being repeated in between unique string values.

5- Note!, XOR ciphers can be decrypted by simply applying the XOR cipher again with the given key to remove the cipher.

6- XOR string with key "adR2b4nh"

7- after XOR Operation save the decrypted file, we can then extract the actual payload (DLL file) using binwalk linux tool, by binwalk we can see all the files contained in this file

8- Using binwalk tool



Q(12) What were the two protection methods enabled during the compilation of the PE file?

Ans: two protection methods [SEH, stack cookie]

SEH: "Structured Exception Handler" is a protection mechanism that was implemented to mitigate the abuse of buffer overflows

Stack Cookie (known as "canary") used to detect a stack buffer overflow before execution of malicious code can occur.



Q(13) When was the DLL file compiled?

Ans: Compilation Timestamp : 2002-01-09 15:50:55 UTC

1- Upload the dll file to virus total.

2- Go to the details section and analyse the header part.



Q(14) A Flash file was used in conjunction with the redirect URL. What URL was used to retrieve this flash file?

Ans: The URL used to retrieve flash file is http[://]adstairs[.]ro/544b29bcd035b2dfd055f5deda91d648[.]swf

1- Open up export HTTP objects in Wireshark >> File >> Export Objects >> http >> and look for flashfiles

2- Go to Packet No: 1875 , and select >> http stream >> , Will find [GET /544b29bcd035b2dfd055f5deda91d648[.]swf HTTP/1.1]



Q(15) What is the CVE of the exploited vulnerability?

Ans: CVE-2013-2551

Search for Angler EK adR2b4nh cve in google.

will find {exploit was CVE-2013-2551 Internet Explorer exploit lunched from Angler Exploit Kit which tries always to encrypt or obfuscate the payload}



Q(16) What was the web browser version used by the infected host?

Ans: web browser version is "MSIE 9.0"

1- We know that the IP address of the infected machine is 192.168.137.62

2- use wireshark filter {http && ip.addr == 192.168.137.62}

3- Check the http over tcp stream of a random packet.

4- Analyse the User-agent tag will find the "MSIE 9.0"



Q(17) What is the DNS query that had the highest RTT?

Ans: The answer should be dsms0mj1bbhn4[.]cloudfront[.]net but it is instead ssl[.]gstatic[.]com

1- Use Wireshark Select View >Time Display Format > Seconds.

2- filter by dns query.

3- Then calculate the time difference between different sites.

Q(18) What the name of the SSL certificate issuer that appeared the most? (one word)

Ans: google.com

use NetworkMiner tool, and searche by .cer files, then you can see the SSL certificate issuer is Google.

Finally:

I hope this report gives you a lot of skills and experience that helps in identifying malware.

Author: Khal1d-AL1

Contact: Linkedin

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published