#!/usr/bin/perl # # Usage : # # sockscan.pl # # # written by SnakeByte [ SnakeByte@kryptocrew.de ] # www.kryptocrew.de/snakebyte/ # use Net::SOCKS; if ( @ARGV < 5 ) { print "\nThis tool performs a portscan on a host,\n"; print "over a socks proxy to hide your IP\n"; print "and to make it possible, to see ports, which\n"; print "are blocked to certain IP Ranges\n"; print "written by SnakeByte [Snakebyte\@kryptocrew.de]\n\n"; print "Usage : \n"; print "sockscan \n\n"; exit; } print "sockscan by SnakeByte [ SnakeByte\@kryptocrew.de ]\n"; $proxy = @ARGV[0]; $proxyport = @ARGV[1]; $target = @ARGV[2]; $startport = @ARGV[3]; $endport = @ARGV[4]; print "scanning $target ...\n"; my $sock = new Net::SOCKS( socks_addr => $proxy, socks_port => $proxyport, # user_id => $ID, # user_password => $pass, protocol_version => 4 ); for ( $i = $startport ; $i <= $endport ; $i++ ) { $f = $sock->connect( peer_addr => $target, peer_port => $i ); if ( $sock->param('status_num') == SOCKS_OKAY ) { print "--- Port $i open ! --- \n"; # here we could easily retrieve a banner } $sock->close(); } print "\nScan finished..\n";