Okay with help from a PC guru friend of mine we solved the https difficulties.
However not with the above site who only was a test site I practiced on.
I used a program named charlie to log what curl did differently from firefox.
http://www.charlesproxy.com/
Code:
#!/bin/bash
curl -x 127.0.0.1:8888 -k -b kake3 -c kake3 https://site.com/noauth/login/
curl -x 127.0.0.1:8888 -k -b kake3 -c kake3 -d "USER=username&PASSWORD=password&TARGET=/options/for/stupid/script/" https://site.com/stupid_script_url
curl -x 127.0.0.1:8888 -k -b kake3 -c kake3 -o result.html https://site.com/real_url
So basicly I had a script that accepted hidden inputs and redirected me to the loginpage after giving me a coockie and all I needed to do was call the correct url afterwards with curl to be accepted into the site...
If that made any sense to anybody.
Update!!!
The redirect situation need not be as complicated as this.
I have just been made aware that curl don't redirect as default.
So a better way to do the above would just be adding a -L option like this.
Code:
#!/bin/bash
curl -x 127.0.0.1:8888 -k -L -b kake3 -c kake3 -d "USER=username&PASSWORD=password&TARGET=/options/for/stupid/script/" https://site.com/stupid_script_url