Perl ile port taramak
Bu Port Scanner girdiğiniz ip adresinin açık ve kapalı olan portlarını gösterir.
■Adres kısmına adresi taratmak istediginiz adresi yazacaksınız
■Sayi kısmına 1.porttan kaça kadar tarayacağınızı yazacaksınız
■Örnek: perl portscanner.pl 127.0.0.1 500
■127.0.0.1`i 1. porttan baslayarak 500e kadar tarar.
Bu Port Scanner girdiğiniz ip adresinin açık ve kapalı olan portlarını gösterir.
■Adres kısmına adresi taratmak istediginiz adresi yazacaksınız
■Sayi kısmına 1.porttan kaça kadar tarayacağınızı yazacaksınız
■Örnek: perl portscanner.pl 127.0.0.1 500
■127.0.0.1`i 1. porttan baslayarak 500e kadar tarar.
Kod:
[COLOR=#000000][FONT=courier new]$adres = $ARGV[0];[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new] $sayi = $ARGV[1];[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new] [/FONT][/COLOR]
[COLOR=#000000][FONT=courier new] [/FONT][/COLOR]
[COLOR=#000000][FONT=courier new] [/FONT][/COLOR]
[COLOR=#000000][FONT=courier new]if(!$ARGV[0]){[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new] print "Kullanimi:\n\t$0 #perl portscanner.pl [adres] [sayi]\n";[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new] exit();[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new] }[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new] [/FONT][/COLOR]
[COLOR=#000000][FONT=courier new] [/FONT][/COLOR]
[COLOR=#000000][FONT=courier new] [/FONT][/COLOR]
[COLOR=#000000][FONT=courier new]$port=0;[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new] do {[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new] $port++;[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new] use IO::Socket;[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new] $socket = new IO::Socket::INET( PeerAddr => $adres,[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new] PeerPort => $port,[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new] Proto => ’tcp’);[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new] if ($socket){[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new] print "$port ---> acik\n";[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new] close($socket);[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new] }[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new] if (!$socket){[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new] print "$port ---> kapali\n";[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new] close($socket);[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new] }[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new] [/FONT][/COLOR]
[COLOR=#000000][FONT=courier new] [/FONT][/COLOR]
[COLOR=#000000][FONT=courier new] [/FONT][/COLOR]
[COLOR=#000000][FONT=courier new]} while ($port < $sayi);[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new] [/FONT][/COLOR]
[COLOR=#000000][FONT=courier new] [/FONT][/COLOR]
[COLOR=#000000][FONT=courier new] print "Her zaman Tesekkurler ByPolice\n";[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new] exit();[/FONT][/COLOR]