[Dshield] blacklist parsing help

Bernd Loske bernd at loskeonline.net
Fri May 24 01:03:28 GMT 2002


try:

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

--Bernd

-----Original Message-----
From: list-admin at dshield.org [mailto:list-admin at dshield.org]On Behalf Of
bradw
Sent: Thursday, May 23, 2002 1:53 PM
To: list at dshield.org
Subject: [Dshield] blacklist parsing help


-----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-----

_______________________________________________
Dshield mailing list
Dshield at dshield.org
To change your subscription options (or unsubscribe), see:
http://www.dshield.org/mailman/listinfo/list




More information about the list mailing list