need http request help

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
idiot
Macro Veteran
Posts: 152
Joined: Thu Mar 01, 2007 9:21 am

need http request help

Post by idiot » Sat Dec 04, 2010 6:37 am

ok i need to try and open ip adress's with range 192.168.*.*
and test to see if each one is working or not and for it to either log results to file or just inform me as it finds working ones
is there a simple way to do this?
if idiots rule the world then im the king!!!!
i want a free t-shirt give me all of your rep!!!
please give me pro version of macro scheduler and appnavigator!!!

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Sat Dec 04, 2010 8:23 am

I guess you need two nested loops of 255 iterations each:

Code: Select all

Let>quad3=0
Repeat>quad3
  Let>quad3=quad3+1
  Let>quad4=0
  Repeat>quad4
    Let>quad4=quad4+1
    
    Let>IP=192.168.%quad3%.%quad4%
    //HTTPRequest>.......
    
  Until>quad4=255
  
Until>quad3=255
But I should think this will take a very long time as you are attempting 255*255 = 65025 http requests!! What you might want to do is perform a ping first to see if the IP address responds before attempting to do a HTTPRequest. Even so I think this is going to be very slow .....
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Sat Dec 04, 2010 5:30 pm

A few FWIW comments:

As Marcus writes this will be very slow since (I'm guessing) you'll be waiting for timeout on most of the IP range.

HTTP Request may not tell you what you want to know unless you are looking for a webserver.

If you are looking for the IP of some device that you know is on the network but have lost track of the address then (if it's a small network) I would first use Microsoft's free Network Monitor and look for traffic from unexpected IP's. Note that the output can be overwhelming without using the filtering options.

If that doesn't work I would use a tool like nmap which can scan the network using ping and other protocols (important because not everything returns a ping). Note nmap and similar programs can be regarded as hacker tools so be careful only to use them where you are authorized to do so (also some of the websites offering downloads of such programs may be nasty).

idiot
Macro Veteran
Posts: 152
Joined: Thu Mar 01, 2007 9:21 am

thanks

Post by idiot » Sat Dec 04, 2010 8:40 pm

appreciate it both of you thanks :D
if idiots rule the world then im the king!!!!
i want a free t-shirt give me all of your rep!!!
please give me pro version of macro scheduler and appnavigator!!!

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts