Page 1 of 1 1
Topic Options
#141626 - 2005-06-15 01:44 AM All IP-enabled devices
Kdyer Offline
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
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#141627 - 2005-06-15 06:16 AM Re: All IP-enabled devices
Radimus Moderator Offline
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)
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#141628 - 2005-06-15 08:26 AM Re: All IP-enabled devices
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Thanks Rad!
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#141629 - 2005-06-15 09:35 AM Re: All IP-enabled devices
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
A couple of suggestions to reduce the time this sort of thing takes.

  1. If you *must* ping, use a parallel pinger and parse the results.
  2. Query your DNS server for your zone(s). This will give you your statically assigned addresses, also those devices that can dynamically update DNS.
  3. Query your DHCP servers for dynamically assigned addresses - where a MAC address appears more than once only use the most recently assigned address.
  4. 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 Offline
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
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#141631 - 2005-06-15 10:01 PM Re: All IP-enabled devices
Kdyer Offline
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
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#141632 - 2005-06-15 11:48 PM Re: All IP-enabled devices
angryscientist Offline
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
#141633 - 2005-06-16 12:51 AM Re: All IP-enabled devices
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
hmmmm Did I miss something here? What does your post have to do with this topic?
Top
#141634 - 2005-06-16 06:25 PM Re: All IP-enabled devices
angryscientist Offline
Fresh Scripter

Registered: 2005-06-15
Posts: 18
sorry i thought i was in the thread i created when i posted this
Top
Page 1 of 1 1


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1707 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.135 seconds in which 0.116 seconds were spent on a total of 11 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org