Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ###poor man's port scanner###
- #must support /dev/tcp -- use BASH
- #check port
- echo > /dev/tcp/127.0.0.1/8 && echo "Port is open" ||echo "Port is closed"
- #avoid errors on closed ports
- (echo > /dev/tcp/127.0.0.1/8) 2> /dev/null && echo "Port is open" ||echo "Port is closed"
- #scan many ports
- for i in {20..10000};
- do
- (echo > /dev/tcp/127.0.0.1/$i) &>/dev/null &&
- echo "Port $i is open";
- done
- #as oneliner
- for i in {20..10000};do (echo > /dev/tcp/127.0.0.1/$i) &>/dev/null && echo "Port $i is open";done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement