Search This Blog

2020-09-23

Terminal Ping Sweep and Port Scan

Result: List of IP addresses that respond to ping on the specified prefix. Scan common ports on devices that respond to ping.
  1. Modify the prefix variable as necessary, and paste into terminal
  2. prefix="192.168.0."
  3. Copy and Paste the rest of the following script into the terminal application
  4. for i in {1..100}
    do
            ping -c1 -W1 -i0.2 $prefix$i > /dev/null
            if [ $? -eq 0 ]
            then
                    echo $prefix$i
                    nc -w 1 -vz $prefix$i 1-1056 2>&1 | grep succeeded
            fi
    done
    

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.