MalDev Study
Core Module 25beginner8 code files

Maldev Academy Tool - MiniShell

Demonstrating a tool that performs RC4 & AES encryption.

Jump to Section (5)

Learning Objectives

0/1 done

Introduction

This is another Maldev Academy tool, similar to HellShell, which allows encryption of raw payloads. The tool only supports RC4 and AES.

Features

  • Outputs the decryption function of the selected encryption type

  • Outputs the encrypted bytes as a bin file

  • Randomly generated keys for the encryption algorithms

Usage

POWERSHELL
                         ###########################################################
                         # MiniShell - Designed By MalDevAcademy @NUL0x4C | @mrd0x #
                         ###########################################################

[!] Usage: C:\Users\User\source\repos\MiniShell\x64\Debug\MiniShell.exe <Input Payload FileName> <Enc *Option*>  <Output FileName>
[i] Encryption Options Can Be :
        1.>>> "aes"     ::: Output The File As A Encrypted File Using AES-256 Algorithm With Random Key And IV
        2.>>> "rc4"     ::: Output The File As A Encrypted File Using Rc4 Algorithm With Random Key

Examples

  • .\MiniShell.exe .\calc.bin rc4 encpayload.bin - Use RC4 for encryption, write the encrypted bytes to encpayload.bin, output the decryption functionality to the console

  • .\MiniShell.exe .\calc.bin rc4 encpayload.bin > rc4.c - Use RC4 for encryption, write the encrypted bytes to encpayload.bin - output the decryption function to rc4.c.

  • .\MiniShell.exe .\calc.bin aes calcenc.bin - Use AES for encryption, write the encrypted bytes to calcenc.bin, and output the decryption function to the console.

  • .\MiniShell.exe .\calc.bin aes calcenc.bin > aes.c - Use AES for encryption, write the encrypted bytes to calcenc.bin, and output the decryption function to aes.c.

Demo

The image below shows MiniShell being used to encrypt the calc.bin file with the encrypted bytes being written to AesCalc.bin and the decryption function being saved to Aes.c.

image

Diagram

Companion Project & Source Code

8 readable source/config files extracted directly from the archive

Download 25.MiniShell.zip
2.4 KB
#pragma once


#include <Windows.h>

#ifndef COMMON_H
#define COMMON_H




// to help identifying user input
#define AESENCRYPTION		0x311
#define RC4ENCRYPTION		0x133

// 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);
//-------------------------------------------------------------------------------------------------------------------------------






#endif // !COMMON_H
Full Archive Manifest (9 files inside .zip)
  • MiniShell/MiniShell.sln
  • MiniShell/MiniShell/Common.h
  • MiniShell/MiniShell/Encryption.c
  • MiniShell/MiniShell/IO.c
  • MiniShell/MiniShell/MiniShell.vcxproj
  • MiniShell/MiniShell/MiniShell.vcxproj.filters
  • MiniShell/MiniShell/MiniShell.vcxproj.user
  • MiniShell/MiniShell/StringFunctions.c
  • MiniShell/MiniShell/main.c

Search all modules and companion code

No matching modules or source files found for “”.
    Covers all 91 Core + 38 Advanced modules + source archives

    Reader Settings & Progress

    Color Theme

    Reading Font Size

    Study Progress & Cross-Device Backup

    0/129
    Completed
    0
    Bookmarked
    0
    Module Notes

    Progress is saved locally in your browser. Export a JSON backup to move your progress between laptop and phone.