I use curl from within PHP with cookies and can succesfully login to the ui 
with that. You need something that keeps state and cookies won't do.

Regards,

Seth.

Op 20 mrt 2011, om 21:45 heeft Jostein Elvaker Haande het volgende geschreven:

> Hello,
> 
> This isn't really directly related to pfSense, and isn't really an
> error, just me trying to interact with pfSense in a non traditional
> manner. In this case, I'm trying to use curl to semi automate some
> minor tasks, but I'm already stopped at the entrance trying to log on.
> 
> pfSense and its lighttpd installation doesn't seem to use basic auth
> for logon, but instead relies on it's own built in authentication
> mechanism through the PHP based web interface. And from what I see, it
> uses the PHPSESSID stored in a cookie locally to verify the validity
> of the current login. I've been able to send the login form, and store
> the cookie, but when I try to access consecutive pages it just sends
> back the «index.php» page as if the login had failed.
> 
> This is what I'm using so far:
> 
>  curl -k --data-urlencode "usernamefld=admin&passwordfld=pfsense" -c
> cookies.txt https://xxx.xxx.xxx.1/index.php -v
>  curl -k -c cookies.txt https://xxx.xxx.xxx.1/status_services.php -v
> 
> Where «usernamefld» and «passwordfld» are the form fields for username
> and password. The file «cookies.txt» was deleted prior to the
> initialization of the commands, to make sure the file wasn't stale. It
> doesn't matter which page I try to access, pfSense still sends back
> what seems to be the login page.
> 
> Now I might be going around this all wrong, and thus, I'm open to
> suggestions to the method of approach I'm taking here.
> 
> Thanks in advance.
> 
> -- 
> Yours sincerely Jostein Elvaker Haande
> "A free society is a place where it is safe to be unpopular"
> - Adlai Stevenson
> 
> http://tolecnal.net -- tolecnal at tolecnal dot net
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
> 
> Commercial support available - https://portal.pfsense.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Commercial support available - https://portal.pfsense.org

Reply via email to