cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: curl command line and login to phpbb forum

From: Oren Amsalem <oren_amsalem1_at_hotmail.com>
Date: Wed, 23 Jul 2008 18:30:59 +0300

Thank you very much.
Ralph Mitchell

Well its Working but its wired....
this line

curl -b cookies.txt -c cookies.txt -s -S -L -o login.php -d password=153246 -d username=no_alone -d redirect=viewtopic.php?t=20715 -d login=Log+in http://Link/login.php

 does not work

but this line
**********************************************************************************************************************************************************************************
curl curl -b cookies.txt -c cookies.txt -s -S -L -o login.php -d password=153246 -d username=no_alone -d redirect=viewtopic.php?t=20715 -d login=Log+in http://link/login.php
**********************************************************************************************************************************************************************************
Is working

For some wired reason theres a need to put 2 curl in the start of the line... if I only put 1 curl its not working...

Anyway...
If anyone intresting to help me with the posting???(I'm really really really not planing a spam bot....)

this is what i try (2 curl Or 1 curl still not working...)
**********************************************************************************************************************************************************************************
curl curl -b cookies.txt -c cookies.txt -s -S -L -o posting.php -d "message=nice&attach_sig=1&notify=&mode=reply&sid=34909bef74838436dd98130f43226624&t=20715&post=Submit" http://Link/posting.php
**********************************************************************************************************************************************************************************

It give me "Invalid Session. Please resubmit the form" , and i'm still loged in....

The http header is
**********************************************************************************************************************************************************************************
http://link/posting.php

POST /posting.php HTTP/1.1
Host: porn-w.org
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; he; rv:1.9.0.1) Gecko/2008070208 Firefox/2.0.0.14;MEGAUPLOAD 1.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: he,en-US;q=0.7,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: windows-1255,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Referer: http://link/viewtopic.php?p=31626
Cookie: __utma=121132809.116931300.1216799770.1216816265.1216822323.4; __utmz=121132809.1216799770.1.1.utmccn=(referral)|utmcsr=hornywhores.net|utmcct=/rose-ryder-limo-bimbos-2/|utmcmd=referral; __utmc=121132809; phpbb2mysql_t=a%3A2%3A%7Bi%3A5745%3Bi%3A1216799845%3Bi%3A20715%3Bi%3A1216825208%3B%7D; __utmb=121132809; phpbb2mysql_data=a%3A2%3A%7Bs%3A11%3A%22autologinid%22%3Bs%3A0%3A%22%22%3Bs%3A6%3A%22userid%22%3Bs%3A4%3A%226781%22%3B%7D; phpbb2mysql_sid=34909bef74838436dd98130f43226624
Content-Type: application/x-www-form-urlencoded
Content-Length: 101
message=nice&attach_sig=1&notify=&mode=reply&sid=34909bef74838436dd98130f43226624&t=20715&post=Submit
HTTP/1.x 200 OK
Date: Wed, 23 Jul 2008 15:00:53 GMT
Server: Apache
X-Powered-By: PHP/5.2.0-8+etch11
Set-Cookie: phpbb2mysql_t=a%3A2%3A%7Bi%3A5745%3Bi%3A1216799845%3Bi%3A20715%3Bi%3A1216825253%3B%7D; path=/
Cache-Control: private, pre-check=0, post-check=0, max-age=0
Expires: 0
Pragma: no-cache
Keep-Alive: timeout=15, max=300
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html
**********************************************************************************************************************************************************************************

I dont know why its not working...

Anyway its phpbb 2 forum if anyone want to try...
Thank you all again...
  ----- Original Message -----
  From: Ralph Mitchell
  To: the curl tool
  Sent: Wednesday, July 23, 2008 4:56 PM
  Subject: Re: curl command line and login to phpbb forum

  On Wed, Jul 23, 2008 at 8:22 AM, Oren Amsalem <oren_amsalem1_at_hotmail.com> wrote:

    thanks but

    curl -d password=pass -d username=user -d redirect= -d login=Log+in -c cookiefile.txt -b cookiefile.txt http://link/login.php
    give not result

    This one
    curl -d password=pass -d username=user -d redirect= -d login=Log+in -c cookiefile.txt -b cookiefile.txt http://link/login.php
    give back

    curl: (6) Could not resolve host: password=pass; Host not found

    But how can he use the cookies if he just now get them?

  Those two command lines look the same to me.

  Are you fetching the login page first, then doing the post, or are you just jumping right in and posting the login details?? I've found that I often get some kind of cookie while fetching the login page, so I generally do something like:

       curl -b cookies -c cookies -s -S -L -o home_page.html http://server.domain.com/

       curl -b cookies -c cookies -s -S -L -o logged_in.html -d .... -d .... http://server.domain.com/xxx

  Even if you don't get a cookie with the first page fetch, it's possible the server is checking the "Referer" header to see if you went to the login page first.

  Ralph Mitchell

------------------------------------------------------------------------------

  -------------------------------------------------------------------
  List admin: http://cool.haxx.se/cgi-bin/mailman/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/cgi-bin/mailman/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2008-07-23