Guest User

Untitled

a guest
Mar 20th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. #!/bin/sh
  2. set -e
  3.  
  4. # This script is meant for quick & easy port finding tool for docker containers:
  5. # $ curl -fsSL gist.github.com/4669842/4745de80e90839eec44eb7ed3577c8af/raw/1ff0bf239022e6ce68006441c480b3653735a781/pscan.sh -o pscan.sh | bash pscan.sh
  6. #
  7. # NOTE: This is designed to be bundled within a package of scripts, while it does work on its
  8. # own, its currently very limited, I will plan on adding functionality.
  9. findaport=""
  10. 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
  11. echo "${findaport}"
Add Comment
Please, Sign In to add comment