[Dshield] blacklist parsing help

bradw tildar at sta-care.com
Thu May 23 17:53:23 GMT 2002


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

all i want is a file with 1 ip/mask per line.
trying to modify get_block.pl to do this

why is this not working?

# The block list that we downloaded from
# http://feeds.dshield.org/block.txt
open (F,"$tmpdir/$filenum");

open (O,"/etc/blacklist");

my ($start, $end, $block, $attacks, $name, $country, $email);
while (<F>) {
    next if /^#/;
    ($start, $end, $block, $attacks, $name, $country, $email)=split("\t");
    if ( ( $start =~ /^[\d\.]+$/ ) && ( $block =~ /^\d+/ ) ) {
        print O "$start/$block \n";
    }
}

- -- 
Brad Wyman           |\      _,,,---,,_
bradw at sta-care.com  /,`.-'`'    -.  ;-;;,_
Network Admin      |,4-  ) )-,_. ,\ (  `'-'
Sta-Care, Inc.    '---''(_/--'  `-'_)

PGP Fingerprint: 8B1E E12F 3982 0D54 E01C  DFD3 898B 6CA3 ED6F 3E56

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE87SyZiYtso+1vPlYRApJ1AJ46IalL4ShhbjRj5kVuIYCuIfbXKgCffULC
V42nLIkU0pw8WndwAAIuDds=
=DWVN
-----END PGP SIGNATURE-----




More information about the list mailing list