An Import Address Table obfuscation utility for C/C++ based windows implants
Project description
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.
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hashycalls-2.0.1.post1.tar.gz.
File metadata
- Download URL: hashycalls-2.0.1.post1.tar.gz
- Upload date:
- Size: 3.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3b145b4d6bff60723d86b94b5c419ebddddb846692cd0750ab1733d7aa22964d
|
|
| MD5 |
d1bbe3666d5a0342f030500f82685e30
|
|
| BLAKE2b-256 |
5af2cb08bf98862ebf5c959146c4b2ca13d975a39ce838681f115e639837707e
|
Provenance
The following attestation bundles were made for hashycalls-2.0.1.post1.tar.gz:
Publisher:
publish-to-pypi.yml on wizardy0ga/Hashycalls
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hashycalls-2.0.1.post1.tar.gz -
Subject digest:
3b145b4d6bff60723d86b94b5c419ebddddb846692cd0750ab1733d7aa22964d - Sigstore transparency entry: 339527054
- Sigstore integration time:
-
Permalink:
wizardy0ga/Hashycalls@43c4c764ac704cb8fd707b221a2f67664aac2f92 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/wizardy0ga
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@43c4c764ac704cb8fd707b221a2f67664aac2f92 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file hashycalls-2.0.1.post1-py3-none-any.whl.
File metadata
- Download URL: hashycalls-2.0.1.post1-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.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8dbfa04a099aa88b721a5ddc605c368384b6bee7c29700914f2c3dd2c9dc78d5
|
|
| MD5 |
71b81e5b6bf24e14302f5464ec5dc833
|
|
| BLAKE2b-256 |
926294cf323c2eeee48b8fd6e4652230b134df29f39b55b1631c8f6b98be3c96
|
Provenance
The following attestation bundles were made for hashycalls-2.0.1.post1-py3-none-any.whl:
Publisher:
publish-to-pypi.yml on wizardy0ga/Hashycalls
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hashycalls-2.0.1.post1-py3-none-any.whl -
Subject digest:
8dbfa04a099aa88b721a5ddc605c368384b6bee7c29700914f2c3dd2c9dc78d5 - Sigstore transparency entry: 339527070
- Sigstore integration time:
-
Permalink:
wizardy0ga/Hashycalls@43c4c764ac704cb8fd707b221a2f67664aac2f92 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/wizardy0ga
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@43c4c764ac704cb8fd707b221a2f67664aac2f92 -
Trigger Event:
workflow_dispatch
-
Statement type: