[pwnable.kr] cmd1
Wargame/pwnable.kr
Mommy! what is PATH environment in Linux?ssh cmd1@pwnable.kr -p2222 (pw:guest)Attachment/* cmd1.c */#include #include int filter(char* cmd){ int r=0; r += strstr(cmd, "flag")!=0; r += strstr(cmd, "sh")!=0; r += strstr(cmd, "tmp")!=0; return r;}int main(int argc, char* argv[], char** envp){ putenv("PATH=/thankyouverymuch"); if(filter(argv[1])) return 0; system( argv[1] ); ..