Created
March 11, 2018 13:30
-
-
Save crazyboycjr/2da7e947cd044f98a670ee1a1041c042 to your computer and use it in GitHub Desktop.
list-alive.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
port=$1 | |
if [ -z $port ]; then port=22; fi | |
echo 'scan port:' $port | |
for i in {1..254}; do echo 10.2.96.$i; done | xargs -P 300 -I {} sh -c "nc {} $port -z -w 1 && echo {} || true" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment