加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

Perl 导入nmap端口信息

发布时间:2020-12-16 00:01:46 所属栏目:大数据 来源:网络整理
导读:平台有个需求要导入信息到MYSQL.. 分析了下,写了个脚本,几分钟搞定。。。 while ( ){ @tmp = split (/t/, $_ ); @xieyi = split (///, $tmp [ 1 ]); if ( $xieyi [ 1 ] eq ' tcp ' ){ if ( $tmp [ 3 ]=~m/^ # (.*)/){ print " portname:$tmp[0] port_nu

平台有个需求要导入信息到MYSQL..

分析了下,写了个脚本,几分钟搞定。。。

while(<>){ @tmp=split(/t/,$_); @xieyi=split(///,$tmp[1]); if($xieyi[1] eq 'tcp'){ if($tmp[3]=~m/^#(.*)/){
        print "portname:$tmp[0] port_number:$xieyi[0] port_text:$1 n"; } } } sub db_insert{ my $name=shift; my $text=shift; my $port=shift; my $in=DBI->connect("DBI:mysql:database=w3a_system;host=localhost","root","") or die "NO :$!"; my $insert=$in->do("insert into w3a_net_scan_service(service_name,service_text,service_port)values('$name','$text',$port)"); $in->disconnect(); }

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读