- 编写 shellcode
.text
.global _start
_tiny_exit:
movl $0,%ebx
movl $1,%eax
int $0x80
_tiny_msg:
.ascii "Hello world!\n"
_get_rip:
mov (%esp), %ecx
ret
_start:
push %esp
push %ebp
mov %esp, %ebp
push %edx
push %ecx
push %ebx
push %eax
mov $14, %edx
call _get_rip
add $-36,%ecx
mov $1,%ebx
mov $4, %eax
int $0x80
pop %eax
pop %ebx
pop %ecx
pop %edx
pop %ebp
pop %esp
jmp _tiny_exit
- 对应的是 32 位
as --32 -o inject.o inject.s
ld -m elf_i386 -o inject inject.o
网友评论