Level16
-
[FTZ Level16 풀이]System/FTZ 2018. 2. 16. 20:06
[Level16 Code]12345678910111213141516171819#include void shell() { setreuid(3097,3097); system("/bin/sh");} void printit() { printf("Hello there!\n");} main(){ int crap; void (*call)()=printit; char buf[20]; fgets(buf,48,stdin); call();} cs코드를 보면 call( ) printit( )를 저장해서 call( )가 실행되면 printit( )함수가 실행되도록 되어있다.그리고 위에 shell( )는 쉘을 실행시켜준다. 따라서, 우리는 printif( )의 주소가 저장되는 스택에 shell( )의 주소를 저장해서call( )..