Jump to content

TCP: php post login ?


Recommended Posts

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.

$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


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">
Edited by Dafrog
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

  • Recently Browsing   0 members

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