cURL / Mailing Lists / curl-users / Single Mail

curl-users

AW: Problem logging into website

From: <Alexander.Elgert_at_external.t-systems.com>
Date: Thu, 25 Oct 2012 21:13:15 +0200

Hello,

maybe, you will find it nice to see the communication between your browser and the web application.
Webscarab is such a proxy, which acts as a man in the middle. (If someone knows another/better proxy, please tell me.)

As curl is able to use proxies too, it will be very useful to look at a successfull browser communication first.
Then use curl to produce the same steps.

Greetings,
Alexander

--
Deutsche Telekom AG
Seamless ICT Security Infrastructure & Management
im Auftrag T-Systems International GmbH
Dipl. Inf Alexander Elgert
Langwadener Strasse 17
64625 Bensheim
+49 176 22 717 661 (Mobil)
+49 671 83419-12 (Tel)
+49 671 83419-30 (Fax)
E-Mail: alexander.elgert_at_gmx.de
________________________________________
Von: curl-users [curl-users-bounces_at_cool.haxx.se] im Auftrag von Trevor Barrie [tbarrie_at_gmail.com]
Gesendet: Donnerstag, 25. Oktober 2012 19:55
An: curl-users_at_cool.haxx.se
Betreff: Problem logging into website
Hi all,
Novice curl user here, hoping I could get some help. I need to write a
script to log into http://www.ghcommunity.info/maintenance/ but I
can't get it to work.
The <form> section of the page's source code looks like this:
<form action="/maintenance/login/login" method="post">
        <table width="300" border="0" cellpadding="0" cellspacing="0"
style="margin: 0 auto;">
                <tr valign="top">
                        <td width="100" height="24">
                                <div align="left">Suite Number:</div>
                        </td>
                        <td width="200">
                                <div align="left">
                                        <input id="user[login]" maxlength="15" name="user[login]"
size="20" type="text" value="" />
                                </div>
                        </td>
                </tr>
                <tr valign="top">
                        <td width="100">
                                <div align="left">Password: </div>
                        </td>
                        <td width="200">
                                <div align="left">
                                        <input id="user[password]" maxlength="15" name="user[password]"
size="20" type="password" value="" />
                                </div>
                        </td>
                </tr>
        </table>
    <p>
       <input class="smallbutton" type="submit" value="Login" />
    </p>
</form>
Based on that I tried
curl -F "user[login]=XXX&user[password]=YYY"
http://ghcommunity.info/maintenance/login/login
But it just gave me a message that I was being redirected to the login page.
Later, I tried the trick of copying the source to a local file and
changing POST to GET to see what the resulting URL looked like, and I
found that it used "%5B" and "%5D" instead of "[" and "]", so I tried
this:
curl -F "user%5Blogin%5D=XXX&user%5Bpassword%5D=YYY"
http://ghcommunity.info/maintenance/login/login
In this case, though, it just returns an error page, the same as I get
in my browser if I try to navigate directly to
http://ghcommunity.info/maintenance/login/login.
Any ideas what might be the problem?
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2012-10-25