#141626 - 2005-06-15 01:44 AM
All IP-enabled devices
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
I need to generate a list of all IPs on the network and generate a log of them. I don't want to go through all 130,050 iterations of two octets..
Here is what I have so far and I have trimmed it down.
Requires WSHPING() and LOGGER() UDFs: Code:
CLS BREAK ON DIM $container DIM $containername DIM $computer
$logfile='H:\MMCInvent1.csv' IF EXIST($logfile) DEL $logfile ENDIF for $i=0 to 10 for $j=1 to 255 $res=wshping('1.1.$i.$j',1)[0] if @error=0 $data='1.51.$i.$j' ?'found '+$data LOGGER($logfile,$data+@crlf) endif next next
for $j=1 to 255 $res=wshping('2.2.255.$j',1)[0] if @error=0 $data='2.2.255.$j' ?'found '+$data LOGGER($logfile,$data+@crlf) endif next
for $i=0 to 16 for $j=1 to 255 $res=wshping('3.3.$i.$j',1)[0] if @error=0 $data='3.3.$i.$j' ?'found '+$data LOGGER($logfile,$data+@crlf) endif next next
Thanks,
Kent
|
|
Top
|
|
|
|
#141627 - 2005-06-15 06:16 AM
Re: All IP-enabled devices
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
I did something like this as well, but I included portqry.exe from MS to do some basic port scanning of IPs that replied to the pings
http://www.kixtart.org/ubbthreads/showfl...true#Post121952
Edited by Radimus (2005-06-15 06:18 AM)
|
|
Top
|
|
|
|
#141628 - 2005-06-15 08:26 AM
Re: All IP-enabled devices
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
|
|
Top
|
|
|
|
#141629 - 2005-06-15 09:35 AM
Re: All IP-enabled devices
|
Richard H.
Administrator
   
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
A couple of suggestions to reduce the time this sort of thing takes.
- If you *must* ping, use a parallel pinger and parse the results.
- Query your DNS server for your zone(s). This will give you your statically assigned addresses, also those devices that can dynamically update DNS.
- Query your DHCP servers for dynamically assigned addresses - where a MAC address appears more than once only use the most recently assigned address.
- Consider using a program specifically designed to do what you are attempting. I use nmap from http://www.insecure.org/ - it's a *nix tool but they do support a Windows port.
An example of how to query DNS and use a parallel pinger can be found in my PINGCHECK.KIX post at http://www.kixtart.org/ubbthreads/showflat.php?Cat=0&Number=128213&an=&page=0&vc=1 which also includes a link to the parallel pinger.
|
|
Top
|
|
|
|
#141630 - 2005-06-15 03:19 PM
Re: All IP-enabled devices
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
Richard,
This looks great! I need to ping/log only three subnets: 10.50, 10.52, and 10.55. Not the whole network. Anyway, I think I can still utilize your code though.
Thanks again.
Kent
|
|
Top
|
|
|
|
#141631 - 2005-06-15 10:01 PM
Re: All IP-enabled devices
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
Richard,
Well it looks like I spent all of this time for nothing. Went to our Network Security guy and he is able to pull a report using LAN Surveyor. Shows what type of connection, etc. He said that they stop nmap.
Thanks for your insights though.
Kent
|
|
Top
|
|
|
|
#141632 - 2005-06-15 11:48 PM
Re: All IP-enabled devices
|
angryscientist
Fresh Scripter
Registered: 2005-06-15
Posts: 18
|
nevermind, im dumb as hell, i just needed to put that statement before the statement that quereied the key to disable the firewall
|
|
Top
|
|
|
|
#141634 - 2005-06-16 06:25 PM
Re: All IP-enabled devices
|
angryscientist
Fresh Scripter
Registered: 2005-06-15
Posts: 18
|
sorry i thought i was in the thread i created when i posted this
|
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 1707 anonymous users online.
|
|
|