Jump to content

curl forum log-in


Recommended Posts

I'm tring to build a forum auto poster...

Not bot.. for posting spam... a bot that will help someone to post stuff on multiplay forum..

But as lame as i am... i cant manage to even log-in the forum....

The code i use

Dim $sLogin = user
Dim $sPassw = psss

Dim $iPidCurl = Run(@ComSpec & " /c " & -->curl log in...<--- , @ScriptDir, @SW_HIDE,2+4)

Dim $sOut
While 1
    $sOut &= StdoutRead($iPidCurl)
    If @error Then ExitLoop
WEnd
While 1
    $sOut &= StderrRead($iPidCurl)
    If @error Then ExitLoop
WEnd
ConsoleWrite($sOut)

---> curl log in <---

well i attempted a couple of thing and the best one is

curl -d -k username=$sLogin -d password=$sPassw -d redirect= -d login=Log+in http://porn-w.org/login.php

This one gives me wrong username or password inactive, and i have no idea why i need the -k...

Iknwo its not really a autoit question.. its more a curl one..

But i dont have anywhere to ask..

Thanks i advance...

I used http live header to get the respond i use when i log-in and this is what i got

********************************************************************************************

http://link/login.php

POST /login.php HTTP/1.1

Host: link.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/login.php

Cookie: __utma=121132809.116931300.1216799770.1216799770.1216804449.2; __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%3A1216800237%3B%7D; phpbb2mysql_data=a%3A2%3A%7Bs%3A11%3A%22autologinid%22%3Bs%3A0%3A%22%22%3Bs%3A6%3A%22userid%22%3Bi%3A-1%3B%7D; phpbb2mysql_sid=dbbb779f7ae6412c18023ba6d73940a2; __utmb=121132809

Content-Type: application/x-www-form-urlencoded

Content-Length: 56

username=no_alone&password=****&redirect=&login=Log+in

HTTP/1.x 302 Found

Date: Wed, 23 Jul 2008 09:14:04 GMT

Server: Apache

X-Powered-By: PHP/5.2.0-8+etch11

Set-Cookie: 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; expires=Thu, 23-Jul-2009 09:14:04 GMT; path=/

Set-Cookie: phpbb2mysql_sid=dbbb779f7ae6412c18023ba6d73940a2; path=/

Location: http://link/index.php?sid=dbbb779f7ae6412c18023ba6d73940a2

Content-Length: 0

Keep-Alive: timeout=15, max=299

Connection: Keep-Alive

Content-Type: text/html

***********************************************************************************************

the log-in source look like that...

****************************************

<form action="login.php" method="post" target="_top">

<th height="25" class="thHead" nowrap="nowrap">Please enter your username and password to log in.</th>

<td width="45%" align="right"><span class="gen">Username:</span></td>

<input type="text" class="post" name="username" size="25" maxlength="40" value="" />

<td align="right"><span class="gen">Password:</span></td>

<input type="password" class="post" name="password" size="25" maxlength="32" />

********************************

Please help

Thanks

Edited by oren
Link to comment
Share on other sites

I got this advice

> curl -d -k username=no_alone -d password=***** -d redirect= -d login=Log+in 
> http://forumlink/login.php
...
> Set-Cookie: phpbb2mysql_sid=dbbb779f7ae6412c18023ba6d73940a2; path=/

First error usually is the cookies. Make a try adding "-c cookiefile.txt -b 
cookiefile.txt" to the commandline. That will store and send the cookies for 
you.

And i tried

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

  % Total   % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent  Left  Speed

  0 56  0    0  0   56    0   3500 --:--:-- --:--:-- --:--:--  3500
  0 56  0    0  0   56    0 199 --:--:-- --:--:-- --:--:--   0


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=153246; Host not found
  % Total   % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent  Left  Speed

  0 43  0    0  0   43    0   1387 --:--:-- --:--:-- --:--:--  1387
  0 43  0    0  0   43    0 137 --:--:-- --:--:-- --:--:--   0
  0 43  0    0  0   43    0 137 --:--:-- --:--:-- --:--:--   0
Edited by oren
Link to comment
Share on other sites

Well its working ... If anyone is intresting...

Dim $sLogin = user
Dim $sPassw = pass

Dim $iPidCurl = Run(@ComSpec & " /c " & 'curl curl -b cookies.txt -c cookies.txt -s -S -L -o login.php -d password=$sPassw -d username=$sLogin -d redirect= -d login=Log+in http://porn-w.org/login.php', @ScriptDir, @SW_HIDE,2+4)

Dim $sOut
While 1
    $sOut &= StdoutRead($iPidCurl)
    If @error Then ExitLoop
WEnd
While 1
    $sOut &= StderrRead($iPidCurl)
    If @error Then ExitLoop
WEnd
ConsoleWrite($sOut&@LF&"***************************************************************************"&@LF)

Now lets see about posting.....

this is not working...

If anyone care to help??

live headers

http://porn-w.org/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://porn-w.org/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

When i try this

Dim $iPidPost = Run(@ComSpec & " /c " & '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://porn-w.org/posting.php', @ScriptDir, @SW_HIDE,2+4)

I get invalid post session...

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...