Skip to content

Instantly share code, notes, and snippets.

@pdxjohnny
Last active August 29, 2015 14:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pdxjohnny/1e720fca4a8f8715b946 to your computer and use it in GitHub Desktop.
Save pdxjohnny/1e720fca4a8f8715b946 to your computer and use it in GitHub Desktop.
Spawn sh shell
.file "sh.s"
.text
.globl main
.type main, @function
main:
subl $32, %esp
movb $0x2f, 16(%esp)
movb $0x62, 17(%esp)
movb $0x69, 18(%esp)
movb $0x6e, 19(%esp)
movb $0x2f, 20(%esp)
movb $0x73, 21(%esp)
movb $0x68, 22(%esp)
movb $0x0, 23(%esp)
lea 16(%esp), %edx
movl %edx, 24(%esp)
movl $0, 28(%esp)
leal 24(%esp), %ecx
mov $0,%edx
mov 24(%esp),%ebx
mov $11,%eax
int $0x80
.size main, .-main
.ident "GCC: (Ubuntu 4.8.2-19ubuntu1) 4.8.2"
.section .note.GNU-stack,"",@progbits
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment