Nimbin[12]?Administration / ipscan

ipscan Administration

A fast way to scan the local network!
Simply enter:
ipscan
to scan a range from 192.168.2.1-255.
Or enter:
ipscan "172.168"
to scan the range 172.168.1-255.1-255

wget https://git.christianimmanuel.de/scripts/raw/Administration/ipscan && chmod 740 ipscan
ipscan 895 B · 54 lines raw
#!/bin/bash

#################################################
### A fast way to scan the local network!
### Simply enter:
### ipscan 
### to scan a range from 192.168.2.1-255.
### Or enter:
### ipscan "172.168"
### to scan the range 172.168.1-255.1-255

IP="$1"

[[ -z $IP ]] &&
   IP="192.168.2"


LENG="$(echo "$IP" | sed "s/\./ /g" | wc -w)"



lookIp() {
   IPS="($(getIps | xargs))"

   echo ""
   echo "########################"
   echo "$IPN"
   echo ""

   eval $IPS  | parallel -k nslookup | sed '/^$/d' | 
      grep -v "Got bad packet: extra input data" |
      grep -v "server can't find" | grep -v "Authoritative answers can be found from:"
}

getIps() {
   for i in {1..255}; do
      echo "echo $IPN.$i; "
   done
}

getSecIps() {
   for i in {1..255}; do
      IPN="$IP.$i"
      lookIp
   done
}

if echo "$LENG" | grep -wq 2; then
   getSecIps
else
   IPN="$IP"
   lookIp
fi