이 문제의 경우 함수의 심볼이 없는 것 같습니다. gdb로 분석해도 main도 못 찾습니다. 그래서 radare2로 확인해 보았지만 여전히 다른 풀이에 나와 있는 get_shell의 주소가 아닌 다른 주소를 알려줍니다. 혹시나 아키텍처의 차이인가 싶었는데 radare2가 알려준 다른 주소로는 안 되고 0x401216으로 주소를 입력해야만 작동하는 걸 보면 아키텍처의 차이도 아닌 듯 합니다. 다른 분들은 get_shell의 주소를 어떻게 구하셨나요?
안녕하세요
저는 해당 문제 파일에 존재하는 Dockerfile로 환경구성 후 소스코드에 나와있는 옵션을 사용하되 디버깅심볼을 지우는 옵션만 제거하여 컴파일을 하였고
해당 디버깅 심볼이 있는 버전의 바이너리를 분석해서 payload를 짜고 풀었습니다.
디버깅 심볼이 있고 없고에 따라 offset 차이는 없는걸로 알고 있어서 그런식으로 풀이하였습니다.
First of all, as you may notice, this is a stripped binary, which means its symbols no longer exist. You can read more about it here.
You can still use reverse engineering tools like Ghidra or IDA. These tools typically rely on the __libc_start_call_main
function to locate the main function. Additionally, since this binary does not have PIE enabled, its addresses are fixed. This makes it easier to locate the get_shell
function by checking the function list, and you can get its address by looking at the disassembly section.