Skip to main content

An Import Address Table obfuscation utility for C/C++ based windows implants

Project description

banner

About

Hashycalls is an import address table obfuscation utility for C/C++ implants targeting the windows operating system. This tool automates the process of creating hashes & associated resolution code. Developers need only provide a list of api calls to generate the hashycalls template. Implant side, this template can be used to access all of the function calls. Upon compilation, the function calls will not appear in the import address table.

Limitations

The hashycalls module itself is only intended for use on windows. Linux is not currently supported however this feature is not off the table.

The template only supports x64 based implants.

Installation

Manual Installation
git clone https://github.com/wizardy0ga/hashycalls
pip install .\hashycalls
Via PyPi
pip install hashycalls

Documentation

Module

Using hashycalls from the command line
Using hashycalls in a script

Template

Using the hashycalls template file

Tutorials

Writing a basic injector with hashycalls
Writing a compilation script for the basic injector

Basic Usage

This provides a brief synopsis on using the module & generated template file.

Hashcalls Module

The module is the first step to using this in your project. The module provides user interfaces from the command line & in python scripts for automating your implants build routine.

From the Command Line

If your python Scripts directory is in your PATH variable, the hashycalls command can be accessed from the command line. This provides ease of access for generating templates & writing them to applicable directories. Click here for further command line usage information.

help

In a Script

Hashycalls provides the HashyCalls class which is a container for the associated source & header files. This interface allows developers to import & modify the source code within their own automated build routines. Click here for more information on this topic.

from hashycalls import HashyCalls
hashysource = HashyCalls(
    apicalls        = [ 'OpenProcess', 'VirtualAllocEx', 'WriteProcessMemory', 'CreateRemoteThread' ]
    , algo          = 'djb2'
    , globals       = True
    , api_list_name = 'pHashyCalls'
    , seed          = 782
    , debug         = False 
)
hashysource.source.write_to_dir('src')
hashysource.header.write_to_dir('inc')

Hashycalls Template

To use hashycalls in your implant, include the hashycalls.h header file in any source file where you need to access the hidden function calls. InitApiCalls needs to be called once during runtime to populate the hashed api structure. From there, developers can access function calls using the structure itself or the EXEC macro.

# include "hashycalls.h"
int main()
{

/* Initialize the hashed api calls */
# ifdef hc_GLOBAL
	if ( !InitApiCalls() )
		return -1;
# endif

# ifndef  hc_GLOBAL
	PHWINAPI hWin32;
	if ( ( hWin32 = InitApiCalls() ) == NULL )
		return -1;
# endif

    /* Running some functions using both sytax styles */
	hWin32->Kernel32.GetCurrentProcessId();
	EXEC( User32, MessageBoxA ) ( 0, "Testing", "Hashed MessageBoxA", MB_OK );

	return 0;
}

Credits

Have to give credit where it's do!

Cracked5pider

The HWINAPI structure is heavily influenced by Cracked5piders INSTANCE structure for grouping api calls in the havoc payload. Check out the havoc framwork repository & website.

reverseame

reverseame has provided a repository containing a dataset for the entire windows API in JSON. This dataset has proven to be very useful for some of my projects, having saved me the time & effort of creating one myself. Checkout the winapi-categories repository for yourself.

vx-underground

VX-API is a great repo!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hashycalls-2.0.0.tar.gz (3.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hashycalls-2.0.0-py3-none-any.whl (2.0 MB view details)

Uploaded Python 3

File details

Details for the file hashycalls-2.0.0.tar.gz.

File metadata

  • Download URL: hashycalls-2.0.0.tar.gz
  • Upload date:
  • Size: 3.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for hashycalls-2.0.0.tar.gz
Algorithm Hash digest
SHA256 59a4040f52db7507a411946aab0d499c2057482e5f6c666620e853ba37fce97e
MD5 09bdba2dd96c577b6583a3997b75ec81
BLAKE2b-256 72e057dcb8088eaf3757bfc16cd3e235ce893164e811c5331bc4ec021c765189

See more details on using hashes here.

File details

Details for the file hashycalls-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: hashycalls-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 2.0 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for hashycalls-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 004aaeb71f6213cc3fba10c086255fc35bfc26025cf1cc17048ddf4693656212
MD5 58fd3da4c24a94ef5778f15a4723ae84
BLAKE2b-256 e7be63a41a84930458cbec22394e66e53ba075295d5878fe8f5c6dc8ef05a07d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page