CURL request using .netrc file
Clash Royale CLAN TAG #URR8PPP up vote 0 down vote favorite I am trying to write a script which is saving the credentials to a .netrc file and then it is reading from the file in order to pass them to a curl command and saves the returned cookie file for future use. I am interested if this is secure way to pass the username and password and if there is a man in the middle attack would they be able to sniff the credentials if the server which I am trying to reach is over HTTP. #!/bin/bash IP="192.168.0.1" user="Administrator" pass="Password1234" function credentials mkdir "$HOME"/.netrc rm "$HOME"/.netrc/credentials.txt touch "$HOME"/.netrc/credentials.txt echo "machine $IP"; echo "login $user"; echo "password $pass"; >> "$HOME"/.netrc/credentials.txt chmod 600 "$HOME"/.netrc/credentials.txt function cookie curl -v -c cookie.txt -n "$HOME"/.net...