Skip to main content

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

Project description

Typing SVG Typing SVG

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.1.1.tar.gz (3.7 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.1.1-py3-none-any.whl (1.3 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: hashycalls-2.1.1.tar.gz
  • Upload date:
  • Size: 3.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for hashycalls-2.1.1.tar.gz
Algorithm Hash digest
SHA256 038f3c978b91beb61cb2ce69ba7be288c1d75097c8bf89f724f69196387465b5
MD5 6bb6c013abeff1d2852b6207f801fdae
BLAKE2b-256 4d679a109be30a0006636f5bba48260bb661d3ffbf6513c6fa07a8392e34e0fd

See more details on using hashes here.

Provenance

The following attestation bundles were made for hashycalls-2.1.1.tar.gz:

Publisher: publish-to-pypi.yml on wizardy0ga/Hashycalls

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: hashycalls-2.1.1-py3-none-any.whl
  • Upload date:
  • Size: 1.3 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for hashycalls-2.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ecba9eef101ea66af20606d49e6fa5986cecc8fad7086ec3c760b7abc35728ce
MD5 c1e3051a0c1aca64e74bd4b8ed1558e0
BLAKE2b-256 a923efbc774c46dd1d994299a179f95b5040f8ff42d1901024b2d1909dddaf3b

See more details on using hashes here.

Provenance

The following attestation bundles were made for hashycalls-2.1.1-py3-none-any.whl:

Publisher: publish-to-pypi.yml on wizardy0ga/Hashycalls

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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