Quick Key Logger break down


Hello,

I had a simple malware sample (keylogger) I could show  to reinforce what my previous posts touched on.
https://tntrex77.blogspot.com/2018/10/quick-tip-sysinternals.html
https://tntrex77.blogspot.com/2018/12/how-i-use-sysinternals.html

This was an executable file (.exe) hanging out in the startup folder, trying to be all innocent named "msdefender.exe".   "I don't believe you, more like bsdefender.exe!"


https://www.virustotal.com/gui/file/0fd7513668d18c2c6be2ed2eed170b86217734d0af0385bca8eddb94404f05f5/detection
There were also a few detections from VirusTotal, (VT blog entry)

First thing I usually do is blast a file with sigcheck:  sigcheck -h -v <File>   (Hash and VT switches)
(Similar output to the VT website, use what you like)

Then I pop the file into DIE (Detect It Easy) just to verify file type and quick entropy and strings check.


A .rar archive? "But you said you were msdefender.exe!"  Let's pop it into WinRAR to see what we got.


"PSKILL!", "EXEC.BAT!", "BOBA FETT!"  This is not looking good.  Let's glance at that batch script (exec.bat).


Looks like it really wants to start "conhosts.exe".

This is my favorite part!  Lets oblige and run "conhosts.exe" ourselves, while we watch to see what happens.  (This should be done from the relative safety of a VM(bombshelter), see POST)

Lets setup our instrumentation first. (procmon)
I copy and rename the "conhosts.exe" to "sampley.exe"
I run procmon and set filters to; "Process Name" "Contains" "sampley" > Apply
Disconnect VM network or ensure "host-only"
Detonate the sample !*BANG*!
Examine procmon


Why the hell is this thing messing with "C:\Users\Matt\AppData\Local\winpfontcache1.dat"?!  And WTF is "winpfontcache1.dat"?!  These timestamps are fresh!   Let's see if we can find .dat money!


"And we do!"  You can see that "winpfontcache1.dat" is a text file containing my previous keystrokes.  This dirty "msdefender.exe" is actually a key stroke logger!

By honing in on the "conhosts.exe" I was able to determine the main malicious mechanism in this malware.  (alliteration obliteration!)  The "msdefender.exe" was hanging out in the startup folder to ensure this key-logger was run upon startup.

Nothing exotic or unique here but something I thought would be easy to follow and understand.    More posts to come!

Notepad++ > https://notepad-plus-plus.org/
DIE tool > http://ntinfo.biz/index.html

Comments

Popular posts from this blog

A magic-wormhole!

Quick Tip -Sysinternals-

How I use Sysinternals