############################################################################### # © Gustavo Romero López 2019 - GPLv3 - gustavo@ugr.es # int execve(const char *filename, const char *argv[], const char *envp[]); # al ebx ecx edx # 0xb /bin/sh null null # cc -m32 -nostartfiles 21.s -o 21 ############################################################################### .text _start: .globl _start xor %ecx, %ecx # ecx = argv = null mul %ecx # edx = envp = null push %eax # "\0" push $0x68732f2f # "//sh" push $0x6e69622f # "/bin" mov %esp, %ebx # ebx = esp = &"/bin//sh\0" mov $0xb, %al # execve int $0x80 # syscall