Scanning LAN IPs

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
User avatar
vovchik
Posts: 1507
Joined: Tue 24 Oct 2006, 00:02
Location: Ukraine

Scanning LAN IPs

#1 Post by vovchik »

Dear all,

I am trying to get a list of all active local IPs on a LAN - including two chromecast devices. The attached yad script does show a list but it varies - sometimes it is complete. It runs a scan function twice (just for testing), because the second time round it is more complete. Weird. Any ideas or better solutions?

With kind regards,
vovchik
Attachments
lanscan-gui.tar.gz
(574 Bytes) Downloaded 109 times

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#2 Post by mikeb »

Hmm sounds like the same behaviour as mpscan gives which I use for NFS scanning.

All I did was two scans but limit the first to only a small ip range to save time.

Nmap is a better tool but not normally in puppies

mikr

User avatar
trapster
Posts: 2117
Joined: Mon 28 Nov 2005, 23:14
Location: Maine, USA
Contact:

#3 Post by trapster »

It seems to be finding mine.

This is what I use

Code: Select all

#!/bin/bash

is_alive_ping()
{
  ping -c 1 $1 > /dev/null
  [ $? -eq 0 ] && echo IP: $i is up.
}

for i in 192.168.1.{1..255} 
do
is_alive_ping $i & disown
done

exec sleep 1
trapster
Maine, USA

Asus eeepc 1005HA PU1X-BK
Frugal install: Slacko
Currently using full install: DebianDog

User avatar
vovchik
Posts: 1507
Joined: Tue 24 Oct 2006, 00:02
Location: Ukraine

#4 Post by vovchik »

Dear trapster,

Your routine works better than mine. :) Thanks. Here is a little update using your routine and my yad tail.

With kind regards,
vovchik
Attachments
lanscan-gui.tar.gz
(528 Bytes) Downloaded 115 times

jafadmin
Posts: 1249
Joined: Thu 19 Mar 2009, 15:10

#5 Post by jafadmin »

Ping will only show those devices that allow replies to ping. You would need something like "arp-scan" or "nmap" to show the IP addresses that are active, but locked down.

User avatar
trapster
Posts: 2117
Joined: Mon 28 Nov 2005, 23:14
Location: Maine, USA
Contact:

#6 Post by trapster »

I recall using a java program that was called angry ip scanner that seemed decent
trapster
Maine, USA

Asus eeepc 1005HA PU1X-BK
Frugal install: Slacko
Currently using full install: DebianDog

step
Posts: 1349
Joined: Fri 04 May 2012, 11:20

#7 Post by step »

I have used angry ip and nmap on Fatdog64. In the end I think I prefer nmap, which is a command-line tool and a GUI tool (zenmap).
[url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Fatdog64-810[/url]|[url=http://goo.gl/hqZtiB]+Packages[/url]|[url=http://goo.gl/6dbEzT]Kodi[/url]|[url=http://goo.gl/JQC4Vz]gtkmenuplus[/url]

User avatar
vovchik
Posts: 1507
Joined: Tue 24 Oct 2006, 00:02
Location: Ukraine

#8 Post by vovchik »

Dear step,

Thanks. Nmap requires some libs (liblinear) and is a 17 MB download - whereas my script is well under 1000 bytes. The same with angry ip, which requires all of java in order to run. There must be something tiny that can deliver the local ips in a manner that can be shown using that yad_tail function in my script. I am not sure arp-scan is in all puppies. Does anybody know? Still thinking and testing....

With kind regards,
vovchik

User avatar
smokey01
Posts: 2813
Joined: Sat 30 Dec 2006, 23:15
Location: South Australia :-(
Contact:

#9 Post by smokey01 »

vovchik wrote:Dear trapster,

Your routine works better than mine. :) Thanks. Here is a little update using your routine and my yad tail.

With kind regards,
vovchik
Nice but it would be better if there were some details about the connections.

Also I had to change the IP range:

Code: Select all

for i in 10.1.1.{1..255}; do
I also found arp to be a bit flaky as it doesn't show all addresses, all of the time.

nmap -sP 10.1.1.* is better but as you say, much bigger.

Cheers

User avatar
vovchik
Posts: 1507
Joined: Tue 24 Oct 2006, 00:02
Location: Ukraine

#10 Post by vovchik »

Dear smokey01,

Thanks for testing. If you don't want to change the source, I think you can just supply 10.1.1 on the command line:

Code: Select all

./lanscan-gui 10,1,1
With kind regards,
vovchik

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#11 Post by BarryK »

In EasyOS and Quirky, I use arp-scan. This utility is also used by rcrsn51 in one of his apps, so is probably in all the pups.

Code: Select all

# arp-scan --localnet
[url]https://bkhome.org/news/[/url]

User avatar
smokey01
Posts: 2813
Joined: Sat 30 Dec 2006, 23:15
Location: South Australia :-(
Contact:

#12 Post by smokey01 »

Post by don570: Arp Scan 1.9.5 (64 bit)
http://murga-linux.com/puppy/viewtopic.php?t=112838

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#13 Post by 01micko »

I think arp-scan is a dep of rcrsn51's port scanner and I have it in all slacko variants.

@smokey.. try this from cli

Code: Select all

# arp-scan -r 3 -g -q -l -t 1000
It is slower because there are 3 retries (-r, default is 2) and timeout 1000 milliseconds.(-t, default is 500). You can up the timeout and retries for increased reliability at a *sometimes* severe speed penalty.

Try arp-scan -h for more options.

*note that the arp-scan in slacko variants is older than don570's.
Puppy Linux Blog - contact me for access

Post Reply