Skip to main content

ShellcodeTester is a tool to assembly, compile and test ASM shellcode.

Project description

Shellcode Tester

Build Build Downloads Supported Versions Contributors PyPI version License: GPL-3.0

ShellcodeTester officially supports Python 3.8+.

Main features

  • Assembly ASM file (32 and 64 bits)
  • Assembly ASM file to Windows, Linux and MacOS
  • Check badchars
  • Output to several formats
  • NASM Shell
  • Other amazing features...

Shellcode Tester - Getting stats

shellcodetester -asm file.asm

This command will assembly the ASM file and compile an ELF binary

ShellcodeTester v0.2.0 by Helvio Junior (M4v3r1ck)
ShellcodeTester is a tool to assembly, compile and test ASM shellcode.
https://github.com/helviojunior/shellcodetester

 [+] Startup parameters
     command line: shellcodetester -asm test_linux.asm
     log level: NOTSET
     transform format: RAW
     bad chars: 0x00

 [+] start time 2023-02-12 01:53:56
 [+] Assembling x86 file teste_linux.asm to /home/shellcodetester/st_test_linux.o
 [+] Compiling x86 binary to /home/shellcodetester/st_test_linux.elf32
 [+] Payload size: 65 bytes
 [+] Final size of RAW data: 160 bytes
31c0b00431dbb301eb1259ba00000000b220cd8031c0b00131dbcd80e8e9ffffff4c616220303120636f6d706c657461646f20636f6d207375636573736f210a00

 [+] End time 2023-02-12 01:53:56

Nasm Shell - Getting stats

Assembling

$ nasm_shell
┌─[NASM Shell][x86 linux][ASM  Hex]
└──╼➤ push eax
[+] Payload size: 1 bytes
[+] Final size of RAW data: 2 bytes
50

[+] Disassembly
   0:	50                   	push   eax

┌─[NASM Shell][x86 linux][ASM  Hex]
└──╼➤ push eax ; retn 4
[+] Payload size: 4 bytes
[+] Final size of RAW data: 8 bytes
50c20400

[+] Disassembly
   0:	50                   	push   eax
   1:	c2 04 00             	ret    0x4

Disassembling

$ nasm_shell --mode dis
┌─[NASM Shell][x86 linux][Hex  ASM]
└──╼➤ 50ff501c
[+] Payload size: 4 bytes
[+] Final size of RAW data: 8 bytes
50ff501c

[+] Disassembly
   0:	50                   	push   eax
   1:	ff 50 1c             	call   DWORD PTR [eax+0x1c]

64 bits (x86-64)

$ nasm_shell --arch x86_64
┌─[NASM Shell][x86_64 linux][ASM  Hex]
└──╼➤ push rax
[+] Payload size: 1 bytes
[+] Final size of RAW data: 2 bytes
50

[+] Disassembly
   0:	50                   	push   rax

┌─[NASM Shell][x86_64 linux][ASM  Hex]
└──╼➤ push rax ; push rbx
[+] Payload size: 2 bytes
[+] Final size of RAW data: 4 bytes
5053

[+] Disassembly
   0:	50                   	push   rax
   1:	53                   	push   rbx

Installation

pip3 install --upgrade shellcodetester

Help

Shellcodetester

$ shellcodetester -h

ShellcodeTester v0.X.X by Helvio Junior (M4v3r1ck)
ShellcodeTester is a tool to assembly, compile and test ASM shellcode.
https://github.com/helviojunior/shellcodetester

options:
  -h, --help                      show this help message and exit

General Setting:
  -asm [ASM file name]            Assembly file to be assembled
  -o [output file]                Save output to disk (default: none)

Custom Settings:
  --break-point                   Set software breakpoint (INT3) before shellcode (default: false)
  --bad-chars [bad char list]     List of bad chars to highlight (ex: \x00\x0a, default: \0x00)
  --remove                        Remove bad chars from final binary executable (EXE, ELF and Mach-O). (default: false)
  --cave-size [size]              Code cave size (default: 1024)
  --fill-with-nop                 Fill entire page with NOP (default: false)
  --list                          List all supported output format
  -f [format], --format [format]  Output format (use --list formats to list)
  -v, --verbose                   Shows more options (-h -v). Prints commands and outputs. (default: quiet)

Nasmshell

$ nasm_shell -h
options:
  -h, --help                      show this help message and exit

General Setting:
  --mode [mode]                   Operation mode. (default: assembly, permitted: assembly and disassembly)
  --arch [architecture]           Architecture to assembly/disassembly. (default: x86, permitted: x86_64 and x86)
  --platform [platform]           Platform. (permitted: linux, windows and darwin)

Custom Settings:
  --bad-chars [bad char list]     List of bad chars to highlight (ex: \x00\x0a, default: \0x00)
  --list                          List all supported output format
  -f [format], --format [format]  Output format (use --list formats to list)
  -v, --verbose                   Shows more options (-h -v). Prints commands and outputs. (default: quiet)
  -q, --quiet                     Quiet mode, not show banners. (default: false)

Windows Users

Check specific instructions by Windows Users

Windows Instructions

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ShellcodeTester-0.2.3.tar.gz (44.6 kB view details)

Uploaded Source

File details

Details for the file ShellcodeTester-0.2.3.tar.gz.

File metadata

  • Download URL: ShellcodeTester-0.2.3.tar.gz
  • Upload date:
  • Size: 44.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.3

File hashes

Hashes for ShellcodeTester-0.2.3.tar.gz
Algorithm Hash digest
SHA256 769401dcbc616242ae9ed569b851b7ec7b65f62311320a211bf510183f508810
MD5 0013292c72111c73ffaed1ec47b2c42f
BLAKE2b-256 f39e0671a65bde44a820da3ab9d49f9745b416dbdadc2d1ae016775c72a85297

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page