Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- set -e
- # This script is meant for quick & easy port finding tool for docker containers:
- # $ curl -fsSL gist.github.com/4669842/4745de80e90839eec44eb7ed3577c8af/raw/1ff0bf239022e6ce68006441c480b3653735a781/pscan.sh -o pscan.sh | bash pscan.sh
- #
- # NOTE: This is designed to be bundled within a package of scripts, while it does work on its
- # own, its currently very limited, I will plan on adding functionality.
- findaport=""
- findaport= comm -23 <(seq 49152 65535) <(ss -tan | awk '{print $4}' | cut -d':' -f2 | grep "[0-9]\{1,5\}" | sort | uniq) | shuf | head -n 1
- echo "${findaport}"
Add Comment
Please, Sign In to add comment