Recon techniques

← maldev README · docs/index

The recon/* package tree groups discovery + environmental awareness primitives:

  • Anti-analysis — debugger / VM / sandbox detection (antidebug, antivm, sandbox, timing).
  • Hijack discovery — DLL search-order hijack opportunities (dllhijack).
  • Hook detection — hardware breakpoint inspection (hwbp).
  • System enumeration — drives, special folders, network (drive, folder, network).
flowchart TB
    subgraph anti [Anti-analysis]
        AD[antidebug]
        AV[antivm]
        TIME[timing]
        SB[sandbox<br>orchestrator]
        AD --> SB
        AV --> SB
        TIME --> SB
    end
    subgraph discovery [System discovery]
        DRV[drive]
        FLD[folder]
        NET[network]
    end
    subgraph hooks [Hook detection]
        HWBP[hwbp<br>DR0-DR3]
    end
    subgraph hijack [Hijack discovery]
        DLL[dllhijack<br>services + procs +<br>tasks + autoElevate]
    end
    SB --> BAIL[bail-on-detect]
    HWBP --> CLEAR[clear + unhook]
    DLL --> EXPLOIT[validate + deploy]
    DRV --> STAGE[USB-stage / SMB-share lateral]
    FLD --> PERSIST[persistence path resolution]
    NET --> C2[source-aware C2]

Packages

PackageTech pageDetectionOne-liner
recon/antidebuganti-analysis.mdquietCross-platform debugger detection (PEB / TracerPid)
recon/antivmanti-analysis.mdquietMulti-vendor hypervisor detection (7 dimensions)
recon/sandboxsandbox.mdquietMulti-factor sandbox orchestrator
recon/timingtiming.mdquietCPU-burn defeats Sleep-hook fast-forward
recon/dllhijackdll-hijack.mdmoderateDiscover DLL search-order hijack opportunities
recon/hwbphw-breakpoints.mdmoderateDetect + clear EDR HWBPs in DR0-DR3
recon/drivedrive.mdvery-quietDrive enum + USB-insert watcher (Windows)
recon/folderfolder.mdvery-quietWindows special-folder path resolution
recon/networknetwork.mdvery-quietCross-platform interface IPs + IsLocal

Quick decision tree

You want to…Use
…bail if a debugger is attachedantidebug.IsDebuggerPresent
…bail if running in a hypervisorantivm.Detect
…run multi-factor "is this analysis?"sandbox.New(DefaultConfig).IsSandboxed
…burn CPU to defeat Sleep fast-forwardtiming.BusyWait
…find DLL hijack candidatesdllhijack.ScanAll
…UAC bypass via autoElevate hijackdllhijack.ScanAutoElevate
…detect EDR HWBPs in ntdllhwbp.DetectClearAll
…list mounted drives + watch removable insertionsdrive.NewWatcher
…resolve %APPDATA% / %PROGRAMDATA%folder.Get
…list host IPs / detect self-referencesnetwork.InterfaceIPs / IsLocal

MITRE ATT&CK

T-IDNamePackagesD3FEND counter
T1622Debugger Evasionantidebug, hwbpD3-EI
T1497Virtualization/Sandbox EvasionsandboxD3-EI
T1497.001System ChecksantivmD3-EI
T1497.003Time Based EvasiontimingD3-EI
T1574.001Hijack Execution Flow: DLL Search Order HijackingdllhijackD3-EAL
T1548.002Bypass UACdllhijack (autoElevate)D3-EAL
T1027.005Indicator Removal from ToolshwbpD3-PSA
T1120Peripheral Device Discoverydrive
T1083File and Directory Discoveryfolder, drive
T1016System Network Configuration Discoverynetwork

See also