perl版 Webshell存活检测
2016-11-30 22:44
281 查看
原理:
检测url返回状态即可
源码:
#等有时间优化一下
#注意, 这个是用于win版本, 因为开头的#!路径, 还有就是system(‘cls’)用于WIN, 如果是linux的话
#请修改system(‘cls’)为system(‘clear’)
#再把开头的#!c:\\perl\\bin\\perl.exe修改为相应的perl路径
#
#
检测url返回状态即可
源码:
1 #!c:\\perl\\bin\\perl.exe 2 use warnings; 3 use strict; 4 use LWP::UserAgent; 5 $| = 1; 6 print "---------------------------------------------------------\n"; 7 print "| Webshell online check v1.0 |\n"; 8 print "---------------------------------------------------------\n"; 9 print "| |\n"; 10 print '| Power by :FireC@t |'."\n"; 11 print "| bbs:www.script-toolf.info |\n"; 12 print "| |\n"; 13 print "---------------------------------------------------------\n"; 14 my $ua = LWP::UserAgent->new(); 15 $ua->timeout(5); 16 my $ok = 'OK'; 17 my $false = 'False'; 18 while(1){ 19 print "---------------------------------------------------------\n"; 20 open FILE, "<", "webshell.txt" or die "webshell file open error:$!\n"; 21 foreach(<FILE>){ 22 chomp; 23 if($_ !~ m#^http#i){$_ = 'http://'.$_;} 24 my $req = HTTP::Request->new(GET => "$_"); 25 my $rep = $ua->request($req); 26 if($rep->status_line =~ /200/){ 27 print "Yes --> $_\n"; 28 }else{ 29 print " No --> $_\n"; 30 } 31 } 32 close FILE; 33 print "---------------------------------------------------------\n"; 34 print "Ctrl+c to exit\nThe Next Check after 30sec please waite.....\n"; 35 sleep(30); 36 system('cls'); 37 #system('clear'); 38 } 39 40 print "press any key to continue"; 41 getc();
#等有时间优化一下
#注意, 这个是用于win版本, 因为开头的#!路径, 还有就是system(‘cls’)用于WIN, 如果是linux的话
#请修改system(‘cls’)为system(‘clear’)
#再把开头的#!c:\\perl\\bin\\perl.exe修改为相应的perl路径
#
#
相关文章推荐
- perl多线程ping检测C段存活主机
- 【Python】多线程getwebshell+存活检测+菜刀发包协议+源码分析
- 同时测试多个服务是否存活的脚本[shell和perl]
- webshell检测方法归纳
- 使用perl 检测硬盘信息-共勉
- 检测局域网内ip的存活情况
- 利用Perl&nbsp;Net::Ping检测网段IP是否…
- Zabbix监控(十五):心跳检测Zabbix Server的存活状态
- 【shell脚本】检测局域网内存活主机
- shell——主机存活检测
- 浅谈webshell检测方式 推荐
- 【转】webshell检测——使用auditd进行system调用审计
- perl检测无效符号链接
- perl 文件检测操作
- redis分布式锁,无须设置有效期,自动检测hold锁的节点是否存活
- Android APP存活检测
- 2017中国网络安全大会,安普诺创始人就WebShell检测做分享
- Perl 检测 MD5 安全可靠用法
- perl检测服务是否正常
- 通过zookeeper如何做服务存活检测: