Sign in to follow this  
Followers 0
Dafrog

TCP: php post login ?

3 posts in this topic

#1 ·  Posted (edited)

Hi there..

i wondered if anybody could help me to login to a site that uses POST or atleast help me to set the cookies needed to browse the site after logging in thru some browser so the session is there.

i got the cookies Auth sess_cookie and PHPSESSID

this is what i got of code atm.

it basicly just returns the source of the site.

TCPStartup()
$host = "www.somesite.com"
$IP = TCPNameToIp($host)
$Socket = TCPConnect($IP,80)
$Header = "POST /clogin.php HTTP/1.1" & @CRLF & _
"Connection: close" & @CRLF & _
"Host: " & $host & @CRLF & _
"User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)" & @CRLF & _
"Accept-Charset: ISO-8859-1,UTF-8;q=0.7,*;q=0.7" & @CRLF & _
"Cache-Control: no" & @CRLF & _
"Set-Cookie: Auth=3985+e3d82ee1dcf3cd895013e25950ef1b9f" & @CRLF & _
"Set-Cookie: sess_cookie=852c973f3ab61566a87a751ee68fc6fe" & @CRLF & _
"Set-Cookie: PHPSESSID=28e300lede4d85r7fbmkfpqbn2" & @CRLF & _
"Accept-Language: de,en;q=0.7,en-us;q=0.3" & @CRLF & @CRLF
$Send = TCPSend($Socket,$Header)

While 1
    $Recv = TCPRecv($Socket, 1024)
    If $Recv <> '' Then
    While 1
        $Recv &= TCPRecv($Socket, 1024)
        If @error Then
        ExitLoop 2
        EndIf
    WEnd
EndIf

WEnd
MsgBox(0,"",$Recv)

the form is like this.

<form action="clogin.php" method="post">
<input size="35" name="musername" type="text">
<input size="35" name="mpassword" type="password">
<input name="rememberlogin" value="1" checked="checked" type="CHECKBOX">
<input name="submitit">
</form>
Edited by Dafrog

Share this post


Link to post
Share on other sites



the url to get a file and login is ftp://username:pass@url

dont know if that helps...

Share this post


Link to post
Share on other sites

the url to get a file and login is ftp://username:pass@url

dont know if that helps...

since it´s not an FTP i can´t see how that helps.. it´s an HTML form sending a POST to another PHP script. that way logging in and setting some cookies.

Share this post


Link to post
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
Sign in to follow this  
Followers 0