EvilZone

Programming and Scripting => Scripting Languages => : Axon February 19, 2012, 12:17:54 AM

: [Perl] Port Scanner
: Axon February 19, 2012, 12:17:54 AM
:
use Socket;
$host="xxx.xxx.xxx.xxx.";                                (XXX.xxxx.xxxx.xxx)  Type here your ip
 
print("Scan $host:\n");
for($i=0; $i<65000; $i++){                ( Type here what ports do you want to scan )                           
socket(SOCK, PF_INET, SOCK_STREAM, getprotobyname('tcp'));
$iaddr = inet_aton($host);
$paddr = sockaddr_in($i, $iaddr);
if(connect(SOCK, $paddr)){
print("$i - OK\n");
}else{
print("$i - NO\n");
}
}
: Re: [Perl] Port Scanner
: FuyuKitsune February 19, 2012, 03:25:22 AM
How is Perl? The syntax looks so much nicer than Python, I am trapped in C++ style syntax.
: Re: [Perl] Port Scanner
: 10n1z3d February 19, 2012, 09:26:44 AM
How is Perl? The syntax looks so much nicer than Python, I am trapped in C++ style syntax.

/facepalm

I was going to argue here, but I will just say that Perl got a reputation of a write-only language, guess why.
: Re: [Perl] Port Scanner
: FuyuKitsune February 20, 2012, 12:06:14 AM
So people write crappy code with it because they can.
: Re: [Perl] Port Scanner
: xzid February 22, 2012, 11:36:02 PM
TCP connect scan, huge range of ports, hmm