利用檢測工具DotDotPwn檢查主機是否有目錄遊走之弱點,安裝此工具前,必須先確認有安裝Perl(5.8 或 5.10)、Perl modules(HTTP::Lite、Net::FTP、TFTP、Time::HiRes、Socket、IO::Socket、Getopt::Std、Switch)、Nmap。
# perl -v
This is perl, v5.10.1 (*) built for x86_64-linux-thread-multi
....略
# rpm -qa nmap
nmap-5.51-3.el6.i686
安裝 Perl Modules 之前,要先安裝 CPANPLUS,CPANPLUS 是一個能夠幫你輕鬆安裝 CPAN 模組的工具,CPANPLUS 的細部設定可以參考我的文章Perlbrew安裝教學。
# yum install -y perl-CPANPLUS gcc-c++
# instmodsh
Available commands are:
l - List all installed modules
m - Select a module
q - Quit the program
cmd? l
Installed modules are:
Perl //很明顯並沒有我們要的模組
cmd?q
# cpanp
CPAN Terminal> i Net::FTP
Do you want to modify/update your configuration (y|n) ? [no] n
CPAN Terminal> i TFTP
CPAN Terminal> i Time::HiRes
CPAN Terminal> i Socket
CPAN Terminal> i IO::Socket
CPAN Terminal> i Switch
CPAN Terminal> i HTTP::Lite
Error installing 'HTTP::Lite'
註:為什麼不用安裝 Getopt::Std 模組?因為已經內建,若版本要升級則必須升級perl版本。HTTP::Lite模組用 CPANPLUS 安裝失敗,改用 CPAN 安裝。
# yum install -y perl-CPAN
# cpan
cpan[1]> install HTTP::Lite
cpan[2]> q
# instmodsh
Available commands are:
l - List all installed modules
m - Select a module
q - Quit the program
cmd? l
Installed modules are:
Perl
HTTP::Lite
Net
Switch
TFTP
Time::HiRes
cmd?q
安裝DotDotPwn
# mkdir -p /data/src/
# cd /data/src/
# wget http://www.brainoverflow.org/code/dotdotpwn-v3.0.tar.gz
# tar zxf dotdotpwn-v3.0.tar.gz
進行弱點掃瞄
# ./dotdotpwn.pl -m http -h localhost -d 1 //參數d:Deep of traversals (e.g. deepness 3 equals to ../../../; default: 6)
掃瞄結果:因為掃瞄深度我只設定 1 層(預設是 6),所以只花費 12 分鐘左右。
查看記錄檔
# pwd
/data/src/dotdotpwn-v3.0/Reports
# ll
total 4
-rw-r--r--. 1 root root 341 Mar 19 23:25 localhost_03-19-2014_23-13.txt
# cat localhost_03-19-2014_23-13.txt
[+] Date and Time: 03-19-2014 23:13:08
[========== TARGET INFORMATION ==========]
[+] Hostname: localhost
[+] Protocol: http
[+] Port: 80
[=========== TRAVERSAL ENGINE ===========]
[+] Traversal Engine DONE ! - Total traversal tests created: 2440
[+] Fuzz testing finished after 12.33 minutes (740 seconds)
[+] Total Traversals found: 0
使用 http-url 模組
# ./dotdotpwn.pl -m http-url -u http://(IP or Hostname)/TRAVERSAL -O -k "root:" -r webmin.txt
沒有留言:
張貼留言