0xc0rvu5.github.io

View on GitHub

PMAT Final Breakdown

Let’s start with the prerequisites.

Before we break down the PMAT-Final we are going to touch base on the static and dynamic malware analysis methodologies and how to accomplish them.

Static malware analysis is the process of analyzing malware by examining its code and other artifacts that it leaves behind without actually executing the code. This can be done manually or with the use of tools that can automatically extract and analyze various aspects of the malware, such as strings, symbols, and other indicators of its behavior.

Dynamic malware analysis involves actually executing the code in a controlled environment and observing its behavior as it runs. This can be done by setting up a sandbox or virtual machine and monitoring the actions that the malware takes, such as network connections it establishes or files it modifies. Dynamic analysis can provide more insight into the full range of behaviors of the malware, but it also carries the risk of allowing the malware to potentially cause harm or propagate.

Now let’s breakdown the following steps 1 by 1.

Static
1. Check VirusTotal by searching MD5 or SHA of the file in question
2. Further enumerate the file by using 'strings' and/or 'floss'
3. Check PEView and search IAT (Import Address Table) to determine if there are any known malicious Windows API calls
	1. DownloadFromURL
	2. InternetOpenURLA
	3. ShellExec
4. Check PEStudio which is a variant of PEView that combines numerous tools and may help in indentifying issues

Dynamic
5. Start Remnux
6. Start inetsim in terminal
	1. inetsim
7. Start wireshark in terminal
	1. sudo wireshark &
8. Start Flare-VM
10. Run the target binary
	1. Analyze wireshark output. 
	2. If DNS is involved
		1. Restart
		2. Go to C:\windows\system32\drivers\etc\hosts on flareVM and point DNS to 127.0.0.1
		3. Re-run the target binary
11. Restart
12. Start procmon and TCPView
	1. Run the target binary

Advanced
13. Cutter
14. Debugger

Static

Step 1:

Step 2:

Step 3:

Dynamic

Now I will not go into details in regards to the configuration and setup of Remnux and inetsim. I will refer you to purchasing the course created by HuskyHacks called the PMAT. Alternatively, you can research into the matters yourself.

Step 5:

Step 6:

Step 7:

Step 8:

Step 9:

Step 10:

Step 11:

Advanced

Step 12:

Step 13:

Static
1. Check VirusTotal by searching MD5 or SHA of the file in question
2. Further enumerate the file by using 'strings' and/or 'floss'
3. Check PEView and search IAT (Import Address Table) to determine if there are any known malicious Windows API calls
	1. DownloadFromURL
	2. InternetOpenURLA
	3. ShellExec
4. Check PEStudio which is a variant of PEView that combines numerous tools and may help in indentifying issues

Dynamic
5. Start Remnux
6. Start inetsim in terminal
	1. inetsim
7. Start wireshark in terminal
	1. sudo wireshark &
8. Start Flare-VM
9. Run the target binary
	1. Analyze wireshark output. 
	2. If DNS is involved
		1. Restart
		2. Go to C:\windows\system32\drivers\etc\hosts on flareVM and point DNS to 127.0.0.1
		3. Re-run the target binary
10. Restart
11. Start procmon and TCPView
	1. Run the target binary

Advanced
12. Cutter
13. Debugger

Now let’s get into the PMAT-Final!!! The Source pdf can be found here:

We will begin with the executive summary.

Executive summary:

image

High-level technical summary:

image

Malware composition:

image

Basic static analysis:

image

image

Dynamic analysis:

image

image

image

image

Below we recreate a similar binary to portray what the malware is capable of. We do this because the reverse-shell created by the malware is encrypted. Thus, without an encryption key we cannot actually see the output of the commands being run. Here we use the putty.exe binary, inject a malicious payload and show a PoC with code execution.

image

Indicators of compromise:

image

image

Appendices:

image