James_inthe_box

Dumping

Oct 25th, 2019
1,929
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.72 KB | None | 0 0
  1. Tools:
  2. http://split-code.com/processdump.html
  3. https://github.com/hasherezade/pe-sieve/releases
  4. https://docs.microsoft.com/en-us/sysinternals/downloads/procdump
  5. https://github.com/limbenjamin/TCPHound
  6. https://github.com/CodeCracker-Tools/MegaDumper (compiled hash ab7691992a11bb2def8228f85f4f098594ff2b4405860eba6e1f99e912761cf9 on Hybrid Analysis and Malshare)
  7. For windows users to use instead of stringex below:
  8. https://www.mzrst.com/ PPEE (puppy)
  9. https://www.winitor.com/get.html PEStudio
  10.  
  11. Setup
  12. all apps in C:\Apps (or wherever you want)
  13.  
  14. on a known clean VM/bare metal box, run the below to create known good hash db:
  15. pd64 -db gen
  16. pd64 -db add C:\Apps
  17.  
  18. Sometimes I change the names of the applications in case some malware search the drive for them.
  19.  
  20. Run the malware and when you see a connection attempt run the dump.bat script, if this is a .NET binary dump it via MegaDumper as well
  21. you should end up with several files and usually a process_<digits> dir:
  22. 32952333 Oct 25 2019 DHL 4562262.exe_191025_121116.dmp
  23. 155648 Oct 25 2019 DHL 4562262_exe_PID918_DHL 4562262.exe_400000_x86.exe
  24. 516096 Oct 25 2019 DHL 4562262_exe_PID918_hiddenmodule_1E0000_x86.exe
  25. 4096 Oct 25 11:26 process_2328
  26.  
  27. use stringex <filename> (or PPEE or PEStudio) and look for interesting strings...a safe bet is to look for the network hosts you saw the malware connecting to as a starting point.
  28.  
  29. dump.bat:
  30. C:\Apps\pd64.exe -pid %1
  31. C:\Apps\pe-sieve64 /imp /pid %1
  32. C:\Apps\procdump -ma %1
  33.  
  34. stringex:
  35. #!/bin/bash
  36. (strings -a -td "$@" | sed 's/^\(\s*[0-9][0-9]*\) \(.*\)$/\1 A \2/' ; strings -a -td -el "$@" | sed 's/^\(\s*[0-9][0-9]*\) \(.*\)$/\1 W \2/' ; strings -a -td -eb "$@" | sed 's/^\(\s*[0-9][0-9]*\) \(.*\)$/\1 U \2/') | sort -n
Add Comment
Please, Sign In to add comment