Lab 6-3
In this lab, we’ll analyze the malware found in the file Lab06-03.exe. Questions
- Compare the calls in main to Lab 6-2’s main method. What is the new function called from main?
- 401130
- What parameters does this new function take?
- character, filepath (buffer)
- What major code construct does this function contain
- switch?
- What can this function do?
- execute a specific operation based on the character after the HTML comment
- Are there any host-based indicators for this malware?
- same as before, + register things
- What is the purpose of this malware?
- executing the willness in the webpage of the attacker after the comment
But first a static analysis with PEStudio!
- File is not packed, PEiD won’t show anything
- sections are ok
- Libraries:
- it has wininet, so probably performs some kind of network activity
- it has advapi32, so probably installs some reg keys
- Imports:
- GetCurrentProcess: probably to check himself
- GetEnvironment Things: check the args
- WriteFile: duh
- InternetOpen/InternetClose/InternetRead/InternetGetConnected: all operations related to Internet, perhaps it downloads something from the internet
- Sleep
- Strings: same as the imports +
http://www.practicalmalwareanalysis.com/cc.htmSuccess: Parsed command is %c: probably used a reverse shell- Other error messages, related to internet, files and so on
Internet Explorer 7.5/pmaprobably a user agentC:\Temp\cc.exe: it probably copies itself hereSoftware\Microsoft\Windows\CurrentVersion\Runpersistance mechanism
Perhaps the malware could:
- Check if there is internet connection or not
- Download file from
http://www.practicalmalwareanalysis.com/cc.htm - Perform an action depending on the letter
- Sleep for 60 seconds
- Close itself
By using IDA:
- it first check connection
- it downloads cc file
- it reads cc file, ignore the comment syntax and print the fifth character
- if a letter is passed, then it says “parsed command is whatever”
- we now have a switch case:
- a: create a directory with pathname (C://Temp)
- b: copy file from specific location to C://Temp/cc.exe
- c: delete file from C://Temp/cc.exe
- d: create a new RegKey in Registry Called “Malware”, in this location “Software\Microsoft\Windows\CurrentVersion\Run”, and as executable “C:\Temp\cc.exe”
- it also check if everything’s successful, if not it prints an error message
- default: sleep 100 seconds
- if not a valid character, it prints “not a valid command provided”
- it sleeps for 100 seconds