Skip to main content

shellcode

shellcode logo

Motivation

In the course of pawning n00bs often the need arises to introspect some (generated) shellcode or check it for sanity.

This tools does exactly that.

Installation

pip install shellcode

Usage

With defaults (x86 in 32bit mode)

echo "\x48\x83\xEC\x40\xB0\x3B\x48\x31\xD2\x48\x31\xF6\x52\x48\xBB\x2F\x2F\x62\x69\x6E\x2F\x73\x68\x53\x54\x5F\x0F\x05" | shellcode 

Outputs:

0x0:	dec	eax
0x1:	sub	esp, 0x40
0x4:	mov	al, 0x3b
0x6:	dec	eax
0x7:	xor	edx, edx
0x9:	dec	eax
0xa:	xor	esi, esi
0xc:	push	edx
0xd:	dec	eax
0xe:	mov	ebx, 0x69622f2f
0x13:	outsb	dx, byte ptr [esi]
0x14:	das	
0x15:	jae	0x7f
0x17:	push	ebx
0x18:	push	esp
0x19:	pop	edi
0x1a:	syscall

Fullblown

Usage: shellcode [OPTIONS] COMMAND [ARGS]...

  Supported archs are (default: CS_ARCH_X86):

          - CS_ARCH_ARM

          - CS_ARCH_ARM64

          - CS_ARCH_MIPS

          - CS_ARCH_X86

          - CS_ARCH_PPC

          - CS_ARCH_SPARC

          - CS_ARCH_SYSZ

          - CS_ARCH_XCORE

          - CS_ARCH_M68K

          - CS_ARCH_TMS320C64X

          - CS_ARCH_M680X

          - CS_ARCH_EVM

          - CS_ARCH_ALL

  Supported modes are (default: CS_MODE_32):

          - CS_MODE_LITTLE_ENDIAN

          - CS_MODE_BIG_ENDIAN

          - CS_MODE_16

          - CS_MODE_32

          - CS_MODE_64

          - CS_MODE_ARM

          - CS_MODE_THUMB

          - CS_MODE_MCLASS

          - CS_MODE_MICRO

          - CS_MODE_MIPS3

          - CS_MODE_MIPS32R6

          - CS_MODE_MIPS2

          - CS_MODE_V8

          - CS_MODE_V9

          - CS_MODE_QPX

          - CS_MODE_M68K_000

          - CS_MODE_M68K_010

          - CS_MODE_M68K_020

          - CS_MODE_M68K_030

          - CS_MODE_M68K_040

          - CS_MODE_M68K_060

          - CS_MODE_MIPS32

          - CS_MODE_MIPS64

          - CS_MODE_M680X_6301

          - CS_MODE_M680X_6309

          - CS_MODE_M680X_6800

          - CS_MODE_M680X_6801

          - CS_MODE_M680X_6805

          - CS_MODE_M680X_6808

          - CS_MODE_M680X_6809

          - CS_MODE_M680X_6811

          - CS_MODE_M680X_CPU12

          - CS_MODE_M680X_HCS08

Options:
  --arch TEXT                     [default: CS_ARCH_X86]
  --mode TEXT                     [default: CS_MODE_32]
  --color / --no-color            [default: True]
  --verbose / --no-verbose        [default: False]
  --b64 / --no-b64                [default: False]
  --start INTEGER                 [default: 0]
  --install-completion [bash|zsh|fish|powershell|pwsh]
                                  Install completion for the specified shell.
  --show-completion [bash|zsh|fish|powershell|pwsh]
                                  Show completion for the specified shell, to
                                  copy it or customize the installation.

  --help                          Show this message and exit.

License

This project is licensed under the GPL-3 license.

Metadata

Release files for shellcode 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for shellcode 0.2.1
File Size Uploaded
shellcode-0.2.1.tar.gz 3.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for shellcode 0.2.1
File Interpreter ABI Platform
shellcode-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 7.6 kB

Release files / shellcode-0.2.1.tar.gz

Download URL shellcode-0.2.1.tar.gz
Size 3.8 kB
Tags Source
SHA-256 checksum
How to use checksums
117f3277afbfe57f31e370f24a62e846bee1c8113755f12271f5383efd37743b
BLAKE2b-256 checksum
How to use checksums
4cca52b81f03d27a6682e6cc000e0b5dc3df6404c7fcec5c648584a9efe21ece
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.5 CPython/3.9.1 Linux/4.15.0-140-generic

Release files / shellcode-0.2.1-py3-none-any.whl

Download URL shellcode-0.2.1-py3-none-any.whl
Size 3.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
962b993962cff03f8f6b457d80a7e750a2e2b33a65c738ccfa78db7d8212edb5
BLAKE2b-256 checksum
How to use checksums
ffc8d6fe6025bf387487d6d0810132875110b101485a7e659136b33975f2b0d9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.5 CPython/3.9.1 Linux/4.15.0-140-generic

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.2.0

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page