
makin - rivela trucchi anti-debugging e anti-VM [Questo progetto non è più mantenuto]
Ho creato makin per rendere la valutazione iniziale dei malware un po' più facile per me, penso che possa essere utile anche per altri. Aiuta a rivelare le tecniche di rilevamento del debugger utilizzate da un campione.
makin apre un campione come debuggee e inietta asho.dll (il modulo principale rinomina tutte le dll prima dell'iniezione). asho.dll esegue l'hook di diverse funzioni nelle librerie ntdll.dll e kernelbase.dll e, dopo i controlli dei parametri, invia il messaggio corrispondente al debugger (makin.exe).
makin genera anche uno script per IDA Pro per impostare breakpoint sulle API rilevate.
Al momento, makin è in grado di rilevare le seguenti tecniche:
ntdll.dll:
NtClose - ref: The "Ultimate" Anti-Debugging Reference: 7.B.iiNtOpenProcess - ref: The "Ultimate" Anti-Debugging Reference: 7.B.iNtCreateFile - ref: The "Ultimate" Anti-Debugging Reference: 7.B.iii (Apre se stesso)NtCreateFile - ref: The "Ultimate" Anti-Debugging Reference: 7.B.iii (Apre un driver)LdrLoadDll - ref: The "Ultimate" Anti-Debugging Reference: 7.B.ivNtSetDebugFilterState - ref: The "Ultimate" Anti-Debugging Reference: 7.D.viNtQueryInformationProcess - ref: The "Ultimate" Anti-Debugging Reference: 7.D.viii.a, 7.D.viii.b, 7.D.viii.cNtQuerySystemInformation - ref: kernelbase.dll:
IsDebuggerPresent - ref: MSDNCheckRemoteDebuggerPresent - ref: MSDNSetUnhandledExceptionFilter - ref: The "Ultimate" Anti-Debugging Reference: D.xvRegOpenKeyExInternalW - controlla le chiavi di registroRegQueryValueExW - controlla i valori delle chiavi di registroPuoi aggiungere più controlli VM modificando il file checks.json, senza modificare l'eseguibile
Per ora è tutto, puoi aggiungerne quanti vuoi :)

NtSetInformationThread - ref: The "Ultimate" Anti-Debugging Reference 7.F.iiiNtCreateUserProcess - ref: The "Ultimate" Anti-Debugging Reference 7.G.iNtCreateThreadEx - ref: ntuery blog postNtSystemDebugControl - ref: @waleedassar - pastebinNtYieldExecution - ref: The "Ultimate" Anti-Debugging Reference 7.D.xiiiNtSetLdtEntries - ref: ANTI-UNPACKER TRICKS: PART ONE - 2.1.2NtQueryInformationThread - ref: ntquery - NtQueryInformationThreadNtCreateDebugObject e NtQueryObject - ref: Anti-Debug NtQueryObjectRtlAdjustPrivilege - ref: Using RtlAdjustPrivilege to detect debugger by insid3codeteamPEB->BeingDebugged - Invece di chiamare IsDebuggerPresent(), alcuni programmi controllano manualmente il PEB (Process Environment Block) per il flag BeingDebugged.PEB->NtGlobalFlag - ref: al-khaserUserSharedData->KdDebuggerEnabled - ref: al-khaser - SharedUserData_KernelDebuggerPROCTECTED - ref: al-khaser - HANDLE_FLAG_PROTECT_FROM_CLOSE