Skip to content

Instantly share code, notes, and snippets.

@superboum
Last active November 4, 2015 12:58
Show Gist options
  • Save superboum/d4922d0e0d15bf8119d8 to your computer and use it in GitHub Desktop.
Save superboum/d4922d0e0d15bf8119d8 to your computer and use it in GitHub Desktop.
Test Open Port
#!/bin/bash
PORT=80
printf "\n===\nNEW SCAN\n===\n" >> ./res.txt
while [ $PORT -le 1000 ]
do
curl --max-time 1 http://portquiz.net:$PORT 1>> ./res.txt 2> /dev/null
if [ $? -eq 0 ]; then
printf "x"
else
printf "."
fi
PORT=$(( $PORT + 1 ))
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment