FreeBSD Execve
Usando syscall execve em um FreeBSD.
Descrição
Usando syscall execve em um FreeBSD.
#Assembly FreeBSD x86 #syscall(59,"/bin/sh".....); #as execve.s -o execve.o #ld execve.o -o execve #______[execve.s]_________ .section .text .globl _start _start: xor %eax,%eax #%eax = 0 push %eax #Empurra %eax = 0 = NULL na stack push $0x68732f6e #Empurra sh/n push $0x69622f2f #Empurra ib// mov %esp,%edx #Move %esp = sh/nib// para %edx push %eax #Empurra %eax = 0 = NULL push %esp #Empurra %esp = /bin/sh terminando com NULL push %edx #Empurra %edx = /bin/sh push %eax #Empurra %eax = NULL mov $0x3b,%al #Syscall 0x3b = 59 = execve int $0x80 #Interupção do Kernel