#!/usr/bin/perl -w # # 2007 Stefan Bauer # sb@plzk.de # # Reference: # # http://www.iana.org/assignments/operating-system-names # [RFC952] Harrenstien, K., Stahl, M., and E. Feinler, "DoD Internet # Host Table Specification", RFC 952, SRI, October 1985. # #----------------------------- use Net::Subnets; unlink "SCORE-I"; # abfrage der ip adresse/range/ print "\nenter start ip\t"; chomp ($lowip = ); print "\nenter end ip:\t"; chomp ($highip = ); open RANGE, ">RANGE"; # erstellen der ip-listen fuer die bearbeitung my $sn = Net::Subnets->new; my $listref = $sn->list( \( $lowip, $highip ) ); foreach my $address ( @{ $listref } ) { print RANGE "$address\n"; } close RANGE; #preufen ob der ftp dienst auf den hosts laueft #open RANGE, "RANGE"; #my @RANGE = ; #foreach my $addressraum (@RANGE) { #use IO::Socket::PortState qw(check_ports); #my $proto = 'tcp'; #my $port = '21'; #my $service = 'ftp'; #my $address = $addressraum; #my $timeout = 5; #my %porthash = (); $porthash{$proto}->{$port}->{'name'} = $service; check_ports( $address, $timeout, \%porthash ); #my $open = $porthash{$proto}->{$port}->{'open'}; if ($open) { #open SCORE1, ">>SCORE-I"; #print SCORE1 "$address"; #} #} #close RANGE; #close SCORE1; #Verbidung zu ftp Servern aufbauen und Info's erfragen # use Net::Scan::Ftp::Anonymous; open Ergebnis, "RANGE"; @Ergebnis = ; foreach $opfer (@Ergebnis) { my $scan = Net::Scan::Ftp::Anonymous->new({ host => $opfer, port => 21, timeout => 4, directory => 'test007', user => 'anonymous', password => 'anonymous', verbose => 1, debug => 1 }); my $results = $scan->scan; chomp $opfer; print "$opfer $results\n" if $results; }