Jump to content

HTTP/1.1 POST Request


phew
 Share

Recommended Posts

hi

at first: yes i know its much ugly useless code (the rand stuff) and i'll change it by time.

my problem is i dunno where the problem is! well after executing my script i do not receive anything from the server.

here's the code:

$site = 'siteaktion=anmelden&number1=&number2=&message=&number_anm1=%2B49' & StringLeft(StringTrimLeft(GUICtrlRead($num), 1), 3) & _ 
    '&number_anm2=' & StringTrimLeft(GUICtrlRead($num), 4) & '&username=' & Chr(Random(Asc("a"), Asc("z"), 1)) & Chr(Random(Asc("a"), Asc("z"), 1)) & _ 
    Random(1, 9, 1) & Random(1, 9, 1) & Random(1, 9, 1) & Chr(Random(Asc("a"), Asc("z"), 1)) & '&Submit=ANMELDEN'
    $socket = TCPConnect(TCPNameToIP('www.futuresms.ch'), 80)
    $cmd &= 'POST /anmelden.php HTTP/1.1' & @CRLF
    $cmd &= 'Host: www.futuresms.ch' & @CRLF
    $cmd &= 'User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.9) Gecko/20071025 Firefox/2.0.0.9' & @CRLF
    $cmd &= 'Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5' & @CRLF
    $cmd &= 'Accept-Language: de-de,de;q=0.8,en-us;q=0.5,en;q=0.3' & @CRLF
    $cmd &= 'Accept-Encoding: gzip,deflate' & @CRLF
    $cmd &= 'Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7' & @CRLF
    $cmd &= 'Keep-Alive: 300' & @CRLF
    $cmd &= 'Connection: keep-alive' & @CRLF
    $cmd &= 'Referer: http://www.futuresms.ch/anmelden.php' & @CRLF
    $cmd &= 'Cookie: fsmsID=' & Chr(Random(Asc("a"), Asc("z"), 1)) & Chr(Random(Asc("a"), Asc("z"), 1)) & Random(1, 9, 1) & Random(1, 9, 1) & Chr(Random(Asc("a"), Asc("z"), 1)) & Chr(Random(Asc("a"), Asc("z"), 1)) & Random(1, 9, 1) & Random(1, 9, 1) & _ 
    Random(1, 9, 1) & Random(1, 9, 1) & Chr(Random(Asc("a"), Asc("z"), 1)) & Random(1, 9, 1) & Chr(Random(Asc("a"), Asc("z"), 1)) & Chr(Random(Asc("a"), Asc("z"), 1))& Chr(Random(Asc("a"), Asc("z"), 1)) & Random(1, 9, 1) & Chr(Random(Asc("a"), Asc("z"), 1)) & Chr(Random(Asc("a"), Asc("z"), 1)) & _ 
    Random(1, 9, 1) & Random(1, 9, 1) & Random(1, 9, 1) & Chr(Random(Asc("a"), Asc("z"), 1)) & Chr(Random(Asc("a"), Asc("z"), 1)) & Random(1, 9, 1) & Chr(Random(Asc("a"), Asc("z"), 1)) & Chr(Random(Asc("a"), Asc("z"), 1)) & _ 
    Random(1, 9, 1) & Chr(Random(Asc("a"), Asc("z"), 1)) & Chr(Random(Asc("a"), Asc("z"), 1)) & Chr(Random(Asc("a"), Asc("z"), 1)) & Random(1, 9, 1) & Random(1, 9, 1) & @CRLF  
    $cmd &= 'Content-Type: application/x-www-form-urlencoded' & @CRLF
    $cmd &= 'Content-Length: ' & StringLen($site) & @CRLF
    $cmd &= $site
    $cmd &= '' & @CRLF
    TCPSend($socket, $cmd)
    $f = FileOpen("y.txt", 1)
    FileWrite($f, $cmd)
    FileClose($f)

and here the parsed thing, my debugfile "y.txt":

POST /anmelden.php HTTP/1.1
Host: www.futuresms.ch
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.9) Gecko/20071025 Firefox/2.0.0.9
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: de-de,de;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Referer: http://www.futuresms.ch/anmelden.php
Cookie: fsmsID=zn44za9372m7xzz6ia724nx2hm9qon12
Content-Type: application/x-www-form-urlencoded
Content-Length: 119
siteaktion=anmelden&number1=&number2=&message=&number_anm1=%2B49171&number_anm2=6544374&username=bw825t&Submit=ANMELDEN

what am i doing wrong?

greetings

Link to comment
Share on other sites

Alternatively;

$oHTTP = ObjCreate("winhttp.winhttprequest.5.1")
$oHTTP.Open("POST", "http://futuresms.ch/anmelden.php")
$oHTTP.SetRequestHeader("Cookie", "fsmsID=zn44za9372m7xzz6ia724nx2hm9qon12")
$oHTTP.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded")
$oHTTP.Send("siteaktion=anmelden&number1=&number2=&message=&number_anm1=%2B49171&number_anm2=6544374&username=bw825t&Submit=ANMELDEN")
ConsoleWrite($oHTTP.ResponseText & @CRLF)
# MY LOVE FOR YOU... IS LIKE A TRUCK- #
Link to comment
Share on other sites

$oMyError = ObjEvent("AutoIt.Error","MyErrFunc")

$oHTTP = ObjCreate("winhttp.winhttprequest.5.1")
$oHTTP.Open("POST", "http://futuresms.ch/anmelden.php")
$oHTTP.SetRequestHeader("Cookie", "fsmsID=zn44za9372m7xzz6ia724nx2hm9qon12")
$oHTTP.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded")
$oHTTP.Send("siteaktion=anmelden&number1=&number2=&message=&number_anm1=%2B49171&number_anm2=6544374&username=bw825t&Submit=ANMELDEN")
ConsoleWrite($oHTTP.ResponseText & @CRLF)

Func MyErrFunc() 
   $HexNumber=hex($oMyError.number,8) 
   Msgbox(0,"","We intercepted a COM Error !" & @CRLF & _
                "Number is: " & $HexNumber & @CRLF & _
                "Windescription is: " & $oMyError.windescription ) 

   SetError(1)
Endfunc

# MY LOVE FOR YOU... IS LIKE A TRUCK- #
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...