volatile
-
[FTZ Level14 풀이]System/FTZ 2018. 2. 16. 02:07
[Level14 Code]123456789101112131415#include #include main(){ int crap; int check; char buf[20]; fgets(buf,45,stdin); if (check==0xdeadbeef) { setreuid(3095,3095); system("/bin/sh"); }} cs Level14번 문제는 fgets( )에서 취약점이 발생한다.buf의 크기는 20인데, 표준입력으로 45Byte만큼의 데이터를 버퍼에 저장하고 있다. 그리고 밑에 if문으로 check의 값이 [0xdeadbeef]로 변조될 시, system("/bin/sh")가 실행되는 것을 볼수 있다.따라서, 우리는 BOF로 check메모리를 deadbeef로 변조해주면 Level15권한..