summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2021-03-12 02:39:13 -0500
committerAndrew Cady <d@jerkface.net>2021-03-12 02:48:01 -0500
commitc58aa7f20d2c1440b1896f4e90a2bea66baa4423 (patch)
tree6e96de8df8fa8a4c9e52f6dc9ec962cc709e5b08
parentcac7f9da41cabdbc677d4680f587da5a04efcb05 (diff)
improve scan_network()
-rwxr-xr-xpenme10
1 files changed, 3 insertions, 7 deletions
diff --git a/penme b/penme
index 1a46e6c..af50ad5 100755
--- a/penme
+++ b/penme
@@ -16,15 +16,11 @@ write()
16 16
17scan_network() 17scan_network()
18{ 18{
19 arp-scan --localnet | 19 arp-scan -q --localnet | grep ' '
20 while read ip junk 20 while read ip junk
21 do 21 do
22 case "$ip" in 22 vprintf 'ARP scan found IP: %s\n' "$ip"
23 *.*.*.*) ;; 23 grep -qF " penme host key @ $ip\$" /root/.ssh/authorized_keys || echo "$ip"
24 *) continue ;;
25 esac
26 vprintf 'ARP scan found IP: %s\n' "$ip"
27 ( grep -q " penme host key @ $ip\$" /root/.ssh/authorized_keys ) || echo $ip
28 done 24 done
29} 25}
30 26