############################################################################### # © 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 22.s -o 22 ############################################################################### .text _start: .globl _start xor %ecx, %ecx # ecx = argv = null mul %ecx # edx = envp = null push $0x0b68732f # "/sh" + \x0b push $0x6e69622f # "/bin" mov %esp, %ebx # ebx = esp = &"/bin//sh\0" xchg 7(%esp), %al # sys_execve int $0x80 # system call