随笔分类 - Perl
摘要:我就直接贴代码了。没做什么注释,因为还在修改,目前还有点不太理解,跑去看了下云舒的代码,感觉那个应该有点启发。回头好好修改下。这些多线程模块还有点不太熟悉,主要跟进程弄乱了。得好好琢磨下,如果可以改成别的就更爽了。不过他们都说perl多线程不靠谱。。汗。。#!/usr/bin/perluse Net::Ping;use threads;use threads::shared;system('clear');print "please set the IP(C):";chomp($ip=<STDIN>);print "StartIP:&q
阅读全文
摘要:该脚本我总觉得有问题,但是一直都没想到好的办法解决。例如扫描结束以后,端口链接还在。#!/usr/bin/perl#data:2012/11/19#port scan demouse Socket;system('clear'); print "Enter IP: ";my $x;my $servip = <STDIN>;chop $servip;for($a=0;$a<=65000;$a++) { $ip_addr = sockaddr_in($a, inet_aton($servip)); ...
阅读全文
摘要:当作偶尔练习,同时做个记录。小案例还是比较有用的。#!/usr/bin/perluse DBI;#connect my $dbh=DBI->connect("DBI:mysql:database=db;host=localhost","root","password",{'RaiseError'=>1});#select my $sth =$dbh->prepare("select * from people");$sth->execute();#clean up$dbh-&
阅读全文
摘要:我就直接贴代码了。没做什么注释,因为还在修改,目前还有点不太理解,跑去看了下云舒的代码,感觉那个应该有点启发。回头好好修改下。这些多线程模块还有点不太熟悉,主要跟进程弄乱了。得好好琢磨下,如果可以改成别的就更爽了。不过他们都说perl多线程不靠谱。。汗。。#!/usr/bin/perluse Net::Ping;use threads;use threads::shared;system('clear');print "please set the IP(C):";chomp($ip=<STDIN>);print "StartIP:&q
阅读全文
摘要:看了一些前辈的多线程文章,感觉理解了差不多了。就写了这个小程序。这个程序有点乱,不过没有时间整理写注释,回头有空写成mode吧。#!/usr/bin/perluse threads;use Net::Ping;$p=Net::Ping->new();sub slep_ping{ local($host_ip)=shift; if($p->ping($host_ip)) { print "$host_ip is access---------OK!\n"; }else{ print "$host_ip is No access\n"; } $p
阅读全文
摘要:加了一些注释,主要是为了复习一些包的使用。还有多线程的一些使用方法。#!/usr/bin/perluse Getopt::Long; #这个包使用来做选项用的use threads; #这个是线程包use Thread::Semaphore; #这个是线程信号量控制使用的包use Smart::Comments; #这个会在用FOREACH 的时候弄出进度条..不过没成功使用...use Net::Ping; #这个是主角,也是ping的使用包use threads::shared; #用于线程当中共享变量use Socket; #用于端口扫描#设定接受选项 -thread设置线程...
阅读全文
摘要:纯属手贱写着玩。。。这几天心情比较郁闷。所以动手写了下。#!/usr/bin/perluse HTTP::Request;use LWP::UserAgent;use Getopt::Long;use threads;use Thread::Semaphore;use Socket;print "-------------------\n";print "-----WebScan-------\n";print "-----XiaoCon-------\n";print "-------------------\n"
阅读全文
摘要:#!/usr/bin/perluse LWP::Simple;use threads;use Thread::Semaphore;#先下载文件下来.$k='321935'.'.html';while( 1 ){$url="http://xxx/Html/Book/0/549/$k";$page=getstore($url,"$k"); if($page=='200'){ print "[*] $url_name[7] 下>载成功! [*]\n"; print "[*] 对
阅读全文

浙公网安备 33010602011771号