黑客防线,在攻与防的对立统一中寻求突破!2001年创刊的黑客技术专业刊物!

设为首页
收藏本站
联系我们
网站导航


黑客文章 - 黑客编程 - 浏览 - Debian 下防止arp病毒的perl脚本
Debian 下防止arp病毒的perl脚本
http://www.hacker.com.cn/ 2008-9-7 0:11:25
Debian 下防止arp病毒的perl脚本
#!/usr/bin/perl
use strict;
my $LocalIp="192.168.1.79";
my $file="/tmp/mac.txt";
system("sudo nmap -sP 192.168.1.0/24 > $file");
open(OLD,$file); my @content=;close OLD;
open(NEW,">$file");
foreach my $con (@content)
{
    if( $con =~ /Nmap/ig){$con="";}
    if( $con =~ /$LocalIp/ig){$con="";}
    if($con =~ /(\d+)\.(\d+)\.(\d+)\.(\d+)/)
    {
        print "$1\.$2\.$3\.$4\t";
        print NEW "$1\.$2\.$3\.$4\t";
    }
    if($con =~ /(\w+)\:(\w+)\:(\w+)\:(\w+):(\w+):(\w+)/)
    {
        print "$1\:$2\:$3\:$4\:$5:$6\n";
        print NEW "$1\:$2\:$3\:$4\:$5:$6\n";
    }
}
close NEW;
system("sudo arp -f $file");
所属分类: 黑客编程   所属专题:
共有 220 人次浏览 收藏本页 返回上一页
评论作者:
电子邮件:
评论内容:
投票评价:
验 证 码:
图片包含4个随机字符,点击刷新
请输入上面图片中的随机字符