Skip to content

secnnet/Shellcode-Generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Shellcode Generator

This is a Python script that generates shellcode in C and C# programming languages from a binary file. Shellcode is commonly used in software exploitation and security testing for tasks such as code injection and payload execution.

Features

  • Generates C shellcode: The script reads a binary file and converts each byte into its hexadecimal representation, producing C shellcode as output.

  • Generates C# shellcode: Similar to the C shellcode, the script generates C# shellcode by prefixing each byte with "0x" and separating them with commas.

  • Customizable output format: The C shellcode can be split into multiple lines if a maximum length is reached. The script provides flexibility in adjusting the maximum length.

Usage

  1. Make sure you have Python installed on your system.

  2. Clone the repository:

git clone https://github.com/your-username/shellcode-generator.git

  1. Navigate to the project directory:

cd shellcode-generator

  1. Run the script with the following command:

python shellcode_generator.py <filename> <output_language>

  • <filename>: The name of the binary file you want to generate shellcode from.
  • <output_language>: Specify the output language as either "c" for C shellcode or "cs" for C# shellcode.
  1. The generated shellcode will be displayed in the console.

Examples

To generate C shellcode from a binary file named "payload.bin", run the following command:

python shellcode_generator.py payload.bin c

To generate C# shellcode from the same file, use:

python shellcode_generator.py payload.bin cs

License

This project is licensed under the MIT License.