쉘코딩을 하다보면 시스템 콜이 필요할 때가 있다. 이때 rax에 요청을 넣고 rdi, rsi, rdx등의 레지스터에 인자값을 넣고 syscall을 하면 다양한 syscall을 할 수 있다.
참고: https://dreamhack.io/learn/63#8
표 참고: https://blog.rchapman.org/posts/Linux_System_Call_Table_for_x86_64/
!2022.02.05 추가
위 규칙은 x64 환경에서만 적용된다. x86 환경에서는 다르다.
https://chromium.googlesource.com/chromiumos/docs/+/master/constants/syscalls.md
Chromium OS Docs - Linux System Call Table
Linux System Call Table These are the system call numbers (NR) and their corresponding symbolic names. These vary significantly across architectures/ABIs, both in mappings and in actual name. This is a quick reference for people debugging things (e.g. secc
chromium.googlesource.com
x86실행파일에서는 eax에 syscall넘버를 넣고 인자를 ebx, ecx, edx, esi등 순서로 넣는다.
'system hacking > dreamhack(드림핵)' 카테고리의 다른 글
ssp_000 (0) | 2022.03.03 |
---|---|
basic_exploitation_001 (0) | 2022.02.10 |
gdb attach (0) | 2022.02.10 |
basic_exploitation_000 (0) | 2022.02.10 |
shell_basic (0) | 2022.02.05 |