wsummerhill / IPv4Fuscation-Encrypted

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

IPv4Fuscation-Encrypted

C++ IPv4Fuscation technique to execute XOR encrypted shellcode stored in IP address format to help reduce entopy and detections on the typical hex/base64/other encoding techniques that are frequently used.

Usage:

XOR encrypt your shellcode into IP address format using IPv4encrypt-shellcode.py and whichever XOR key you want to specify in the Python script.
The Python script will output XOR encrypted shellcode in encrypted IP address format and copied to your Clipboard (saved in C++ format).

python3 IPv4encrypt-shellcode.py calc-x64.bin

Take the encrypted IPv4 shellcode and paste it into the C++ project file CPP-IPv4Fuscation-Decryption.cpp, then compile and execute!

Technical Details:

CPP-IPv4Fuscation-Decryption.cpp

  1. Read encrypted IPs into a char array
  • Convert each IP to its integer equivalent
  • Decrypt each integer using the XOR encryption key
  • Convert each decrypted int it to its IP address equivalent
  1. Initiate new heap space using HeapCreate() and HeapAlloc() functions from Kernel32
  2. Loop through decrypted IP addresses and convert each to its binary format using RtlIpv4StringToAddressA() function from Ntdll
  • This function will also output binary data to the target heap address pointer "ptr"
  1. Execute shellcode on heap using the callback function EnumSystemLocalsEx() from Kernel32 (feel free to use any execution technique here)
  2. Cleanup: Free up memory addresses, heap space, and encrypted IP address variabels


References:


Credits:

GitHub: wsummerhill | Twitter/X: @bsummerz

About


Languages

Language:C++ 67.4%Language:Python 32.6%