Created
February 20, 2018 16:13
-
-
Save JeanOlivier/659d9692d0fd7b0ee2e07e7d782074a5 to your computer and use it in GitHub Desktop.
Creates a HTTPS server in the current directory with randomly generated username/password. Arguments are : 1- Username, 2- Number of random characters appended to username, 3- length of password, 4- Port number
This file contains 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
# SimpleHTTPAuthServer installed via: | |
# pip install git+git://github.com/tianhuil/SimpleHTTPAuthServer.git@master | |
function SpawnSimpleHttpAuthServer() | |
{ | |
name="${1:-username}-$(< /dev/urandom tr -dc A-Z-a-z-0-9 | head -c${2:-4};echo;)" | |
pass=$(< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${3:-32};echo;) | |
echo "Username is: $name" | |
echo "Password is: $pass" | |
python -m SimpleHTTPAuthServer --https ${4:-8000} $name:$pass | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Typical outputs: