All pastes #926227 Raw Edit

scanport

public text v1 · immutable
·published 2008-03-03 16:51 UTC
rendered paste body
#!/usr/local/bin/perl

use strict;
use warnings;
use Tk;
my $fen;
$fen = MainWindow->new();
$fen ->minsize('295','85');
$fen -> title("Scanport V1 /By kmkZ! ");
my $texte=$fen -> Label( -text => "Scanport V1 /By kmkZ") -> pack;

    use Net::Ping;
    use IO::Socket::INET;

    $|++; #pas de temporisation
print "+++++ → entrer une IP cible.. : \n";
my $base= <stdin>;
my $p = Net::Ping->new( 'icmp', 5);# délai d'attente sur le ping : 5 secondes 

  
   
        my $host = $base;    # d'abord on essaye le ping
        if ( $p->ping($host) ) 
{
            print "\r$host : Actif!\n";
}
           
my @ports=(21,22,23,25,79,80,107,110,138,139,143,194,220,222,1433,1521,3306,5222,5223,5900,6667,6697,8080);# si ça marche, on tente une connexion sur chaque ports voulu (on peu en ajouter bien sur ;)  )
    for my $port (@ports) {
        my $s = IO::Socket::INET->new(
            PeerAddr => $host,
            PeerPort => $port,
            Timeout  => 2,       # en secondes possibilité de modifié le temps
        );
        next if !( $s && $s->connected() );
        print " i)» port ouvert :  $port\n";
        close $s;
    }


print "\n";
print " #@@@@@@@@@@@@@@@@@@@#\n";
print "  #BY¤ KMKZ ¤TEAM KTK@#\n";
print "  #@@@@@@@@@@@@@@@@@@@#\n";
my $bouton=$fen -> Button( -text => "  Cliquer ici pour Fermer  ", -command => sub {exit})-> pack;
MainLoop;