Una imagen
El codigo
Código
#!usr/bin/perl #ScanPort 0.6 #Version Tk #Coded By Doddy H use Tk; use IO::Socket; my $color_fondo = "black"; my $color_texto = "green"; if ( $^O eq 'MSWin32' ) { use Win32::Console; Win32::Console::Free(); } my $kax = MainWindow->new( -background => $color_fondo, -foreground => $color_texto ); $kax->geometry("422x130+20+20"); $kax->resizable( 0, 0 ); $kax->title("Scan Port 0.6 || Coded By Doddy H"); $kax->Label( -text => "Host : ", -font => "Impact", -background => $color_fondo, -foreground => $color_texto my $hostx = $kax->Entry( -width => 30, -background => $color_fondo, -foreground => $color_texto $kax->Label( -text => "From port : ", -font => "Impact", -background => $color_fondo, -foreground => $color_texto my $startx = $kax->Entry( -width => 8, -background => $color_fondo, -foreground => $color_texto $kax->Label( -text => "To : ", -font => "Impact", -background => $color_fondo, -foreground => $color_texto my $endx = $kax->Entry( -width => 8, -background => $color_fondo, -foreground => $color_texto $kax->Label( -text => "Progress : ", -font => "Impact", -background => $color_fondo, -foreground => $color_texto my $tatus = $kax->Entry( -width => 8, -background => $color_fondo, -foreground => $color_texto $kax->Button( -text => "Fast", -width => 6, -background => $color_fondo, -foreground => $color_texto, -activebackground => $color_texto, -command => \&scanuno $kax->Button( -text => "Full", -width => 6, -background => $color_fondo, -foreground => $color_texto, -activebackground => $color_texto, -command => \&scandos $kax->Label( -text => "Port Found", -font => "Impact", -background => $color_fondo, -foreground => $color_texto my $porters = $kax->Listbox( -width => 20, -height => 4, -background => $color_fondo, -foreground => $color_texto MainLoop; sub scanuno { my %ports = ( "21" => "ftp", "22" => "ssh", "25" => "smtp", "80" => "http", "110" => "pop3", "3306" => "mysql" ); $porters->delete( "0.0", "end" ); $tatus->configure( -text => " " ); $kax->update; $tatus->configure( -text => $port ); if ( new IO::Socket::INET( PeerAddr => $hostx->get, PeerPort => $port, Proto => "tcp", Timeout => 0.5 ) ) { $porters->insert( "end", $port ); } } $tatus->configure( -text => " " ); } sub scandos { $porters->delete( "0.0", "end" ); $tatus->configure( -text => " " ); for my $port ( $startx->get .. $endx->get ) { $kax->update; $tatus->configure( -text => $port ); if ( new IO::Socket::INET( PeerAddr => $hostx->get, PeerPort => $port, Proto => "tcp", Timeout => 0.5 ) ) { $porters->insert( "end", $port ); } } $tatus->configure( -text => " " ); } # The End ?