Wechall.net是一個國外用於練習CTF和攻防的網站,國內資料writeup很少,只有個別幾篇。做爲小白,近日玩了幾道有意思的題目,在此分享php
題目地址:http://www.wechall.net/challenge/Z/aaa/index.phphtml
題目大意是要入侵一個網絡,給了一些已知的信息linux
在源碼中找到www.wechall.net/challenge/Z/aaa/partners.html網絡
而後找到技術文檔:http://www.wechall.net/challenge/Z/aaa/tech_spec.txtssh
提示了管理員帳號密碼和幾個頁面,發現只有router_config.html能夠用默認密碼登錄工具
http://www.wechall.net/challenge/Z/aaa/router_config.html網站
根據題目提示,設置路由策略劫持通訊:.net
Here is the information you have already gathered:3d
The SoftMicro's network is 207.46.197.0 orm
Your public IP is 17.149.160.49
成功執行命令後,提示以下
http://www.wechall.net/challenge/Z/aaa/upload_md5.php
要求傳入兩個文件,包含兩個字符串,md5要相等,內容要不等
頁面中有Hidden hint: search for md5 collision.
搜索獲得用fastcoll,其中good.txt就包含兩個字符串做爲前綴
fastcoll_v1.0.0.5.exe -p good.txt
兩個文件都有目標字符串,上傳
結果獲得第二部分的祕鑰
而後有了新提示
回去router界面設置
http://www.wechall.net/challenge/Z/aaa/upload_ssh.php
這裏的fingerprint檢查是隻檢查前2位和最後1位
hidden hint: Search for fuzzy fingerprinting. You can find the tool with other search words, but thats the tool you really need.
用ssh-keygen查看指紋信息
E:\Program Files\Git\usr\bin>ssh-keygen -l -E md5 -f f:\vsa_public.pub
1024 MD5:03:88:9c:36:41:50:39:15:04:95:89:a4:15:84:fb:b3 f:\vsa_public.pub (RSA)
https://www.thc.org/papers/ffp.html
用THC-FuzzyFingerprint工具來構造與上述指紋一致的私鑰
注意1:這是一個linux工具
注意2:須要將main.c中這部分註釋掉,從新./configure->make->make install
注意3:要看看有沒有/var/tmp/ffp.state這個文件,若是有要刪除,不然下面可能報錯
用指令進行fuzz fingerprint(-l是保存好指紋的數目)
ffp -f md5 -k rsa -b 1024 -l 1000 -t 03:88:9c:36:41:50:39:15:04:95:89:a4:15:84:fb:b3
運行久了就看到符合前2位校驗,後1位校驗的key,Ctrl+c打斷後,用ffp就能夠繼續執行
須要用指令將查到的key輸出到tmp目錄
ffp -e -d /tmp
在/tmp目錄下用命令列出key
[root@anicvm tmp]# for i in /tmp/ssh-rsa??.pub ; do ssh-keygen -f $i -l ; done
太多的話,grep一下找到b3的
[root@anicvm tmp]# for i in /tmp/ssh-rsa??.pub ; do ssh-keygen -f $i -l ; done | grep 'b3'
而後ssh-rsa00.pub是公鑰,ssh-rsa00是私鑰(還覺得要3個)結果一個就過了
www.wechall.net/challenge/Z/aaa/ssh_private_key_fingerprint.html
提示要回去配置路由,清理痕跡
route del -net 12.110.110.0 netmask 255.255.255.0 gw 17.149.160.49
route del -net 207.46.197.0 netmask 255.255.255.0 gw 17.149.160.49
而後將各個階段得到的secret string提交,DONE!
routeevilmd5mitmfingerprintgameover