LNO_LiGhT

bash port scanner by light

Jan 30th, 2016
1,518
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.41 KB | None | 0 0
  1. #!/bin/bash
  2. #by light, very bored. lol
  3. if [ $# != 2 ]; then
  4. echo "Usage: bash $0 <ip_list> <port>"
  5. exit 0
  6. fi
  7. while IFS='' read -r line || [[ -n "$line" ]]; do
  8.         if [[ $(nc -v -z $line $2 | grep succeeded) != "" ]]
  9.         then
  10.         echo "Host: $line | Port: $2" && echo $line >>open.txt #prints ip w/ open port and sends ip to an active ip list
  11.         fi
  12. done < "$1"
  13. #educational purposes only ;)
Advertisement
Add Comment
Please, Sign In to add comment