2017年6月21日 星期三

OverTheWire: Wargames - Natas Level 8 → Level 9


網址:http://overthewire.org/wargames/natas/

Natas Level 8 → Level 9

本題的重點在於要逆推回去原始的資料。


逆推的方式:

 <?php
        $str = "3d3d516343746d4d6d6c315669563362";
        echo base64_decode(strrev(hex2bin($str))) . "<br>";
        //return bin2hex(strrev(base64_encode($secret)));
    ?>

執行出來的結果:


將算出來的答案(oubWYf2kBq)帶回 textbox 中~



按下提交,答案出來囉!

Password: W0mMhUcRRnG8dcghE4qvk3JA9lGt8nDl








2017年6月20日 星期二

OverTheWire: Wargames - Natas Level 7 → Level 8

網址:http://overthewire.org/wargames/natas/

Natas Level 7 → Level 8

一進入網頁的畫面:

Home 的話,網址會變成 xxxxx/?page=home


About 的話,網址會變成 xxxxx/?page=about


點選檢視原始碼,看到了提示:

<!-- hint: password for webuser natas8 is in /etc/natas_webpass/natas8 -->



而錯誤的使用參數的方式,容易造成本地讀取的漏洞

讓我們更改網址,在網址後加上:一大堆的  ../  讓路徑回到根目錄


回到根目錄後,加上提示的路徑

http://natas7.natas.labs.overthewire.org/index.php/index.php?page=../../../../../../etc/natas_webpass/natas8

將將,成功獲得密碼囉!


Password:  DBfUBfqQG69KvJvJ1iAbMoIpwSNQ9bWe 








2017年6月19日 星期一

OverTheWire: Wargames - Natas Level 6 → Level 7

網址:http://overthewire.org/wargames/natas/

Natas Level 6 → Level 7

一進入題目畫面:


點選 View sourcecode 看看,觀察出若送出的參數 = $secret  即可拿到 natas7 的密碼。
且有 include "includes/secret.inc";


直接進去 view-source:http://natas6.natas.labs.overthewire.org/includes/secret.inc  後,得到 $secret = "FOEIUWGHFEEUHOFUOIU";


回到題目頁面,將 $secret 帶入




按下送出後,成功獲得 key  :D



Password: 7z3hEENjQtflzgnT29q7wAvMNfZdh0i9








OverTheWire: Wargames - Natas Level 5 → Level 6



進入後,網頁顯示:你還沒登入!?!
(心想,那應該是去改改看 HTTP Header ,可能可以獲得什麼)




查看 HTTP Header 後:




Cookie 的地方列了:

Cookie: __cfduid=d83f4b8433fdacce3c8f1ab58a8f0bad81497888194; __utma=176859643.894896581.1497888196.1497888196.1497891383.2; __utmc=176859643; __utmz=176859643.1497888196.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utmb=176859643.3.10.1497891383; __utmt=1; loggedin=0


發現後面帶有:loggedin = 0

將 Cookie 改成:

Cookie: __cfduid=d83f4b8433fdacce3c8f1ab58a8f0bad81497888194; __utma=176859643.894896581.1497888196.1497888196.1497891383.2; __utmc=176859643; __utmz=176859643.1497888196.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utmb=176859643.3.10.1497891383; __utmt=1; loggedin=1

成功轉址到頁面:



Password: aGoY4q2Dc6MgDq4oL4YtoKtyAg9PeHa1





OverTheWire: Wargames - Natas Level 4 → Level 5


網址:http://overthewire.org/wargames/natas/

Natas Level 4 → Level 5


檢測元素 --> 查看 Http Header 後,修改看看 

  
改成




成功得到密碼!


Password: iX6IOfmpN7AYOQGPwtn3fXpbaJVJcHfq 



OverTheWire: Wargames - Natas Level 3 → Level 4 & 了解 robot.txt

網址:http://overthewire.org/wargames/natas/

Natas Level 3 → Level 4


檢視原始碼也看出不所以然

試試看在網址後面加點東西... 來加個 robots.txt 看看
發現此網站有設定 robots.txt 

禁止訪問: /s3cr3t 的路徑,那當然來去看看啦XD


點開  users.txt 後,成功!

Password: Z9tkRkWmpt9Qr7XrR5jWRkgOU901swEZ



robots.txt 補充介紹:

robots.txt 檔案位於網站根目錄,能夠向搜尋引擎檢索器表明您不希望檢索器存取的網站內容。這種檔案採用漫遊器排除標準,這是內含少數指令的通訊協定,可依照網站各部分和特定的網路檢索器類型 (例如行動檢索器和電腦檢索器),表明可存取的網站內容。

資料來源:網址

也可以看看 Google 的 robot.txt 唷:https://www.google.com/robots.txt  







OverTheWire: Wargames - Natas Level 2 → Level 3

網址:http://overthewire.org/wargames/natas/

Natas Level 2 → Level 3

檢視原始碼:


發現:<img src="files/pixel.png">

直接連到路徑: 

點選: users.txt


Password: sJIJNW6ucpu6HPZ1ZAchaDtwd7oGrD14