Analysis Methods #
- Static - methods not involving the running of the malware
- AV Scanning - gives a quick indication as to whether something is malicious
- Fingerprinting - checking against other online sources (e.g. VirusTotal)
- Strings - find domains, IP addresses, function names and can be used to give small clues to the function of malware
- Packing/Obfuscation - knowing tools used to pack or obfuscate can help in unpacking & executing and knowing the language or tooling that is used
- PE File Format - finding sections in the executable to be reversed
- Libraries & Functions - good indication of what the malware is doing
- Reverse Engineering & Assembly - (e.g. GDB)
- Dynamic - methods involving running and observing events
- Run Malware & Monitor Activity - useful to confirm whether it is performing as expected from static analysis
- Processes - what processes are created?
- System Calls
- Registry Keys
- Network Activity
- Debugging
Library types #
- Static - whole code copied and included with program
- Runtime - program interacts with libraries only when needed
- Dynamic - program imports referenced libraries as program starts.
PE File Format #
Name | Description |
---|---|
DOS MZ Header | |
DOS Stub | |
PE Header | Metadata - signature, number of sections, executable or DLL, timestamp, machine |
.text | Executable code to be copied to RAM |
.idata | Imported data |
.data | Data loaded to initialise - static & global variables |
.rdata | Runtime data during execution |
.edata | Export information |
.rsrc | Resources used by executable (e.g. files) |
.reloc |
Memory #
Name | Description |
---|---|
Data | Values |
Code | Instructions to be fetched by the CPU |
Heap | Dynamically allocated variables |
Stack | Function parameters, controls program flow |
Tools #
- malwr.com, VirusTotal
- strings
- md5sum, sha1sum, sha1deep, WinMD5, etc…
- PEiD - detect packed files
- PEView - examine PE files
- PE Browse / PE Explorer - browse PE headers
- ImpREC - rebuild import table
- LordPE - dump executable from memory
- Dependency Walker - explore DLLs and imported functions
- Process Explorer
- Process Monitor (procmon)
- RegShot
- rundll32.exe
- WireShark
- tcpdump
- Apate DNS
- netcat
- Volatility Framework
- OllyDbg
- IDA Pro
- WinDBG
- GDB (reference)
- Ghidra
- Joe Sandbox