network scanning

zimu

Diamond Member
Jun 15, 2001
6,209
0
0
just wondering, there's a local network here with the 192.168.x.x prefix. wanted to know if there was any way to basically run a scan that would start at 192.168.0.1 and end at 192.168.255.254 and return all the machines that have the ip address as well as the hostnames?

Thanks :)
 

Atheus

Diamond Member
Jun 7, 2005
7,313
2
0
Originally posted by: zimu
wanted to know if there was any way to basically run a scan...

Is there ever. Nmap is everyone's favourite 'port scanner', it's full of features and I think it's available for windows these days, if not scanline is a nice simple cli scanner for 2000/xp.

 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
It's not like it would be difficult to write a single for loop in any shell that would run host (or nslookup if your system is crippled) on each address.
 

kt

Diamond Member
Apr 1, 2000
6,032
1,348
136
Originally posted by: Nothinman
It's not like it would be difficult to write a single for loop in any shell that would run host (or nslookup if your system is crippled) on each address.

but why re-invent the wheel?
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Because the linked executable is a Windows app and nmap isn't exactly non-invasive. I guess you could tell nmap to just do a ping scan, but that would still take longer than just doing the DNS queries.

That and it took me like 10 seconds to write :

for i in `seq -s ' ' 1 255`; do for j in `seq -s ' ' 0 255`; do host 192.168.$j.$i; done; done
 

nweaver

Diamond Member
Jan 21, 2001
6,813
1
0
I think they all assumed "Windows" and windows has horrible shell for scripting. My first thought is "Perl" and then "angryIP if they run windows and don't have perl"
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
It's possible to do the for loop in the CMD as well, although there's no host command so you'd have to use nslookup or ping, but I don't know the syntax off the top of my head.
 

nweaver

Diamond Member
Jan 21, 2001
6,813
1
0
Originally posted by: Nothinman
It's possible to do the for loop in the CMD as well, although there's no host command so you'd have to use nslookup or ping, but I don't know the syntax off the top of my head.

point being that the windows shell is not nearly as scriptable or easy (imho) as bash on a linux machine for many common tasks.