본문 바로가기

System Hacking/Exploit-Exercise fusion

Exploit-Exercise :: fusion level00 by ORANG




소스를 제대로 안보고 익스플로잇을 짰는데,

뭔가 이상해서 분석결과를보니 fix_path함수에서

strcpy(path, resolved)가 아니라 realpath(path, resolved)에서 메모리 복사가 일어났다.


realpath 함수를 찾던 도중 취약점이 있는 함수라는 글이 많았는데

찾아보니 realpath함수는 상대경로에서 절대경로를 찾아주는? 함수인듯하다.

어쨌든 중요한건, 그 과정에서 realpath(a, b) a에서 b로 복사가 일어난다는것

그리고 앞에 "절대경로"가 붙는다 이문제에선 "/"