Maldev Academy Tool - HellShell
Demonstrating a tool that performs encryption & obfuscation using the methods discussed in previous modules.
Jump to Section (5)
Learning Objectives
0/1 doneIntroduction
At this point of the course, one should have a solid grasp of static evasion using encryption (XOR/RC4/AES) and obfuscation (IPv4/IPv6/MAC/UUID) techniques. Implementing one or more of the previously discussed evasion techniques in the malware can be time-consuming. One solution is to build a tool that takes in the payload and performs the encryption or obfuscation methods.
This module will demo a tool made by the Maldev Academy team that performs these tasks.
Tool Features
The tool has the following features:
-
Supports IPv4/IPv6/MAC/UUID Obfuscation
-
Supports XOR/RC4/AES encryption
-
Supports payload padding
-
Provides the decryption function for the selected encryption/obfuscation technique
-
Randomly generated encryption keys on every run
Usage
To use HellShell, download the source code and compile it manually. Ensure the build option is set to Release.
###########################################################
# HellShell - Designed By MalDevAcademy @NUL0x4C | @mrd0x #
###########################################################
[!] Usage: HellShell.exe <Input Payload FileName> <Enc/Obf *Option*>
[i] Options Can Be :
1.>>> "mac" ::: Output The Shellcode As A Array Of Mac Addresses [FC-48-83-E4-F0-E8]
2.>>> "ipv4" ::: Output The Shellcode As A Array Of Ipv4 Addresses [252.72.131.228]
3.>>> "ipv6" ::: Output The Shellcode As A Array Of Ipv6 Addresses [FC48:83E4:F0E8:C000:0000:4151:4150:5251]
4.>>> "uuid" ::: Output The Shellcode As A Array Of UUid Strings [FC4883E4-F0E8-C000-0000-415141505251]
5.>>> "aes" ::: Output The Shellcode As A Array Of Aes Encrypted Shellcode With Random Key And Iv
6.>>> "rc4" ::: Output The Shellcode As A Array Of Rc4 Encrypted Shellcode With Random Key
Example Commands
-
HellShell.exe calc.bin aes- Generates an AES encrypted payload and prints it to the console -
HellShell.exe calc.bin aes > AesPayload.c- Generates an AES-encrypted payload and outputs it toAesPayload.c -
HellShell.exe calc.bin ipv6- Generates an IPv6 obfuscated payload and prints it to the console
Demo
The image below shows HellShell being used to encrypt the payload using the RC4 encryption algorithm and outputting to a file.

Companion Project & Source Code
9 readable source/config files extracted directly from the archive
#pragma once
#include <Windows.h>
#ifndef COMMON_H
#define COMMON_H
// to help identifying user input
#define UUIDFUSCATION 0x444
#define AESENCRYPTION 0x555
#define RC4ENCRYPTION 0x666
#define IPV6FUSCATION 0x111
#define IPV4FUSCATION 0x222
#define MACFUSCATION 0x333
// to help working with encryption algorithms
#define RC4KEYSIZE 16
#define AESKEYSIZE 32
#define AESIVSIZE 16
//-------------------------------------------------------------------------------------------------------------------------------
//
// from IO.c
// read file from disk
BOOL ReadPayloadFile(const char* FileInput, PDWORD sPayloadSize, unsigned char** pPayloadData);
// write file to disk
BOOL WritePayloadFile(const char* FileInput, DWORD sPayloadSize, unsigned char* pPayloadData);
//-------------------------------------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------------------------------------
//
// from StringFunctions.c
// print the decryption / deobfuscation function (as a string) to the screen
VOID PrintDecodeFunctionality(IN INT TYPE);
//-------------------------------------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------------------------------------
//
// from Encryption.c
// generate random bytes of size "sSize"
VOID GenerateRandomBytes(PBYTE pByte, SIZE_T sSize);
// print the input buffer as a hex char array (c syntax)
VOID PrintHexData(LPCSTR Name, PBYTE Data, SIZE_T Size);
//-------------------------------------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------------------------------------
//
// from Encryption.c
// wrapper function for InstallAesEncryption that make things easier
BOOL SimpleEncryption(IN PVOID pPlainTextData, IN DWORD sPlainTextSize, IN PBYTE pKey, IN PBYTE pIv, OUT PVOID* pCipherTextData, OUT DWORD* sCipherTextSize);
// do the rc4 encryption
BOOL Rc4EncryptionViSystemFunc032(IN PBYTE pRc4Key, IN PBYTE pPayloadData, IN DWORD dwRc4KeySize, IN DWORD sPayloadSize);
//-------------------------------------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------------------------------------
//
// from Obfuscation.c
// generate the UUid output representation of the shellcode
BOOL GenerateUuidOutput(unsigned char* pShellcode, SIZE_T ShellcodeSize);
// generate the Mac output representation of the shellcode
BOOL GenerateMacOutput(unsigned char* pShellcode, SIZE_T ShellcodeSize);
// generate the ipv6 output representation of the shellcode
BOOL GenerateIpv6Output(unsigned char* pShellcode, SIZE_T ShellcodeSize);
// generate the ipv4 output representation of the shellcode
BOOL GenerateIpv4Output(unsigned char* pShellcode, SIZE_T ShellcodeSize);
//-------------------------------------------------------------------------------------------------------------------------------
#endif // !COMMON_H
Full Archive Manifest (10 files inside .zip)
- HellShell/HellShell.sln
- HellShell/HellShell/Common.h
- HellShell/HellShell/Encryption.c
- HellShell/HellShell/HellShell.c
- HellShell/HellShell/HellShell.vcxproj
- HellShell/HellShell/HellShell.vcxproj.filters
- HellShell/HellShell/HellShell.vcxproj.user
- HellShell/HellShell/IO.c
- HellShell/HellShell/Obfuscation.c
- HellShell/HellShell/StringFunctions.c