Practical 2
Practical 2
You need 7-zip to extract the file. If you don't have it installed, download and install the 64-
bit version from:
https://www.7-zip.org/
Right-click the key.7z file and click 7-Zip, "Extract Here". Enter a password of malware
Using PEview
Open key.exe in PEview.
As shown below, if you expand "SECTION .rdata" and click "IMPORT Address Table", one of
the three DLL's imported is advapi32.dll.
Using BinText
Examine the strings in key.exe and find these items, as shown below.
Scroll up and find the key definitions, including #SHIFT# and #CAPS_LOCK#, as shown
below. These look like strings used by a keylogger.
We will use these three programs to see what the malware does:
1. Process Explorer
2. Wireshark
3. Process Monitor
Process Explorer shows currently running processes, with far more detail than Task
Manager. It doesn't keep a log of them, so it's harmless to leave running.
Start Wireshark and begin capturing packets from the interface that goes to the Internet, it
should be "Ethernet".
There will be a lot of traffic at the start because you are running RDP from your host machine
to the Windows cloud machine.
To filter out the RDP traffic, enter this into the Wireshark command line, replacing
192.168.10.10 with your host machine IP address:
!(ip.addr == 192.168.10.10)
Note: To get the ip of your host machine, Google search "What's My IP?
Once that command is entered, you can stop and start the capture again by clicking the red
box and the blue fin above the command line. Close any open web browsers to limit the
traffic.
Note: For this project, no web requests will be made by the malware, but it's a good idea to
monitor network traffic when running malware.
It's best to start Process Monitor last, so you can exclude all the harmless processes the other
tools are using.
Launch Process Monitor. If a Security Warning box pops up, allow the software to run.
You see Process Monitor, with a lot of visible events, as shown below.
Repeat the process until all current processes are hidden, as shown below.
Wireshark
No unusual traffic appears in Wireshark, because this sample doesn't use the Internet. Close
Wireshark.
Find the name of the exe covered in green in the image below. That is the flag.
The malware also creates persistence by modifying the run registry key for the current user (HKCU =
HKEY_CURRENT_USER). The programs referenced in this key will be executed when the user logs in.
In File Explorer, go to the folder where key.exe is, find log.txt and open it. You see the
captured keystrokes, as shown below.
Persistence Mechanism
In Process Explorer, right click key.exe and choose Kill Process.
This stops the keylogger for the current session. However, the malware has written itself into
the registry, so it will start back up at the next reboot.