Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Generate random ip to test internet protocols ports on

Status
Not open for further replies.

Phalanx1

Programmer
Jul 21, 2003
128
US
Sorry about this hack but it works on my windows 2003 machine with activestate perl installed. but as i was saying this program capable of Generating millions of ips or a certain set to test ftp, telnet, and https and http ports. write ip 0 or 1, returns 1 if connect succeed, 0 if not. i could make it write an extremely tediouse batch file to execute all this but i stick with PERL just for forum my own purposes.

sorry about that in the past and all not posting with
TGML Before my code is different but neat. i like the way it looks;
Code:
 open IPS, ">>GIPS.txt";#Open a Logging FileHandle
#Logging Just Means That it will append the new info if the
#File is their, and if it isn't their it will create a new one.
@ARRIP = (1..10000);#test up to 255 to the 3rd power or 16_581_375 Ips probably could go higher but perl complains aboout the iterations being to many.
foreach $_ (@ARRIP) {   
$IPOct1 = int(rand(256));#establish randomized intergers
$IPOct2 = int(rand(256));#just above 255 to get all
#number..number to set range
$IPOct3 = int(rand(256));#like (127..128) only two ips or 
#(128) effectivly (0..128)
$IPOct4 = int(rand(256));#
$IP4Oct =  print IPS system("telnet $IPOct1.$IPOct2.$IPOct3.$IPOct4\r\n");
#Replace with ("C:\progra~1intern\IExplore.exe https:\\\\$IPOct1.$IPOct2.$IPOct3.$IPOct4"); #or ftp or
#http or gopher or others 
#that my mere knowledge is not the know about.
}
 
#Replace sorry about that replace this ("C:\progra~1intern\IExplore.exe https:\\\\$IPOct1.$IPOct2.$IPOct3.$IPOct4");
with ("C:\progra~1\intern~1\IExplore.exe https:\\\\$IPOct1.$IPOct2.$IPOct3.$IPOct4");
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top