Skip to content

Instantly share code, notes, and snippets.

@crazyboycjr
Created March 11, 2018 13:30
Show Gist options
  • Save crazyboycjr/2da7e947cd044f98a670ee1a1041c042 to your computer and use it in GitHub Desktop.
Save crazyboycjr/2da7e947cd044f98a670ee1a1041c042 to your computer and use it in GitHub Desktop.
list-alive.sh
#!/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