SamSuka
oalabs
oalabs

patreon


Analyzing BlackMatter Anti-Debug With IDA Pro

In this tutorial we analyze the anti-debug checks in BlackMatter ransomware with IDA Pro. We use static analysis to determine exactly what the checks are doing. 

BlackMatter sample:

Malshare Download 

Anti-debug feature explained:

Anti-Debug NtSetInformationThread

Anti-Debug NtGlobalFlag 


Analyzing BlackMatter Anti-Debug With IDA Pro

Comments

I should have explained this better, there are some Windows tricks that are assumed with handles. Null for the main thread is translated into -2 for the current thread, or if a valid handle is passed in (not null) then they use the handle that was passed. In this case they are passing null that is translated into -2 for current thread. You can see the cast here in the POC code https://anti-debug.checkpoint.com/techniques/interactive.html#ntsetinformationthread

OALABS

I'm not quite understand how the second anti-debug detects the debugger. From the code, seems it check the thread number whether it's 0(false), if not then hide the main thread from debugger. The question is, will the main thread number to be changed when the executable loaded by debugger?

Y G


More Creators