Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sun 18 Nov 2018, 21:45
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
Scanning LAN IPs
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [13 Posts]  
Author Message
vovchik


Joined: 23 Oct 2006
Posts: 1469
Location: Ukraine

PostPosted: Wed 15 Aug 2018, 07:02    Post subject:  Scanning LAN IPs  

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
lanscan-gui.tar.gz
Description 
gz

 Download 
Filename  lanscan-gui.tar.gz 
Filesize  574 Bytes 
Downloaded  45 Time(s) 
Back to top
View user's profile Send private message 
mikeb


Joined: 23 Nov 2006
Posts: 11195

PostPosted: Wed 15 Aug 2018, 13:34    Post subject:  

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
Back to top
View user's profile Send private message 
trapster


Joined: 28 Nov 2005
Posts: 2115
Location: Maine, USA

PostPosted: Thu 16 Aug 2018, 09:26    Post subject:  

It seems to be finding mine.

This is what I use

Code:
#!/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
Back to top
View user's profile Send private message Visit poster's website 
vovchik


Joined: 23 Oct 2006
Posts: 1469
Location: Ukraine

PostPosted: Thu 16 Aug 2018, 10:45    Post subject:  

Dear trapster,

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

With kind regards,
vovchik
lanscan-gui.tar.gz
Description 
gz

 Download 
Filename  lanscan-gui.tar.gz 
Filesize  528 Bytes 
Downloaded  52 Time(s) 
Back to top
View user's profile Send private message 
jafadmin

Joined: 19 Mar 2009
Posts: 857

PostPosted: Thu 16 Aug 2018, 15:56    Post subject:  

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.
Back to top
View user's profile Send private message 
trapster


Joined: 28 Nov 2005
Posts: 2115
Location: Maine, USA

PostPosted: Thu 16 Aug 2018, 16:45    Post subject:  

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
Back to top
View user's profile Send private message Visit poster's website 
step

Joined: 04 May 2012
Posts: 1105

PostPosted: Sun 19 Aug 2018, 06:00    Post subject:  

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).
_________________
Fatdog64-800|+Packages|Kodi|Findnrun|+forum|gtkmenuplus
Back to top
View user's profile Send private message 
vovchik


Joined: 23 Oct 2006
Posts: 1469
Location: Ukraine

PostPosted: Sun 19 Aug 2018, 07:23    Post subject:  

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
Back to top
View user's profile Send private message 
smokey01


Joined: 30 Dec 2006
Posts: 2771
Location: South Australia :-(

PostPosted: Sun 19 Aug 2018, 08:17    Post subject:  

vovchik wrote:
Dear trapster,

Your routine works better than mine. Smile 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:
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

_________________
Software <-> Distros <-> Tips <-> Newsletters
Back to top
View user's profile Send private message Visit poster's website 
vovchik


Joined: 23 Oct 2006
Posts: 1469
Location: Ukraine

PostPosted: Sun 19 Aug 2018, 08:50    Post subject:  

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:
./lanscan-gui 10,1,1


With kind regards,
vovchik
Back to top
View user's profile Send private message 
BarryK
Puppy Master


Joined: 09 May 2005
Posts: 8710
Location: Perth, Western Australia

PostPosted: Sun 19 Aug 2018, 20:16    Post subject:  

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:
# arp-scan --localnet

_________________
http://bkhome.org/news/
Back to top
View user's profile Send private message Visit poster's website 
smokey01


Joined: 30 Dec 2006
Posts: 2771
Location: South Australia :-(

PostPosted: Sun 19 Aug 2018, 21:20    Post subject:  

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

_________________
Software <-> Distros <-> Tips <-> Newsletters
Back to top
View user's profile Send private message Visit poster's website 
01micko


Joined: 11 Oct 2008
Posts: 8682
Location: qld

PostPosted: Sun 19 Aug 2018, 21:26    Post subject:  

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:
# 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
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 1 of 1 [13 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0680s ][ Queries: 13 (0.0144s) ][ GZIP on ]