-
[System Security] 7.2 쉘 코드 획득Security/System Security 2021. 5. 10. 20:35
0. gcc -o shell shell.c -fno-stack-protector -mpreferred-stack-boundary=2 -static
- fno-stack-protector : Canary 해제
- mpreferred-stack-boundary=2 : main함수에 스택을 정렬하는 인스트럭션 제거
- static : static 컴파일 할거야
1. gdb shell -q
- shell 파일 조용하게 디버그 시작
2. disass main
- movl 상수값 발견
3. x/2s 0x80ae428
- 해당 주소에서 string 두개를 보여줘
4. si
- execve함수로 si
5. x/x $esp
- esp 레지스터 hex한개 보여줘
6. disass execve
'Security > System Security' 카테고리의 다른 글
[System Security] 명령어 정리 (0) 2021.05.11 [System Security] 7.3 쉘 코드 작성 (0) 2021.05.11 [System Security] 7.1 시스템콜 원리 (0) 2021.05.10 [System Security] 6.5 Lena's Crackme : Ollydbg (0) 2021.05.10 [System Security] 6.4 문자열 패치 (0) 2021.05.10