https://learn.dreamhack.io/50#7
스켈레톤 코드 작성 문법:
// File name: execve.c
// Compile Option: gcc -o execve execve.c -masm=intel
__asm__(
".global run_sh\n"
"run_sh:\n"
"mov rax, 0x68732f6e69622f\n"
"push rax\n"
"mov rdi, rsp # rdi = '/bin/sh'\n"
"xor rsi, rsi # rsi = NULL\n"
"xor rdx, rdx # rdx = NULL\n"
"mov rax, 0x3b # rax = sys_execve\n"
"syscall # execve('/bin/sh', null, null)\n"
"xor rdi, rdi # rdi = 0\n"
"mov rax, 0x3c # rax = sys_exit\n"
"syscall # exit(0)");
void run_sh();
int main() { run_sh(); }
'system hacking > 개념, 준비물' 카테고리의 다른 글
ida64 free 다운로드와 설치, qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found오류 (0) | 2022.05.19 |
---|---|
docker (pwnable 문제 다양한 ubuntu버전에서 실행하기) (0) | 2022.05.15 |
포너블 문제 풀이시 설치할 것들 (0) | 2022.05.13 |
libc 링킹(patchelf) (0) | 2022.04.17 |
heap (0) | 2022.04.14 |