Jump to content

Need your help for HTTP POST


n0way
 Share

Recommended Posts

Hi everybody,

I'm working on a project, i would like my script does 2 things :

first login in the website

then click an image (that redirect to a link of the website)

And i would like it does that hidden to don't perturb what i'm doing.

So i began with that :

$loginpost = "checkHidden=PITEUR&userform=MYLOGIN&passform=MYPASS"

$packet = "POST /index.php?section=connexion HTTP/1.1" & @CRLF & _
"Host: www.THEWEBSITE.com" & @CRLF & _
"User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13 ( .NET CLR 3.5.30729) " & @CRLF & _
"Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" & @CRLF & _
"Accept-Language: fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3" & @CRLF & _
"Accept-Encoding: gzip,deflate" & @CRLF & _
"Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7" & @CRLF & _
"Keep-Alive: 115" & @CRLF & _
"Connection: keep-alive" & @CRLF & _
"Referer: http://www.THEWEBSITE.com/index.php?section=index" & @CRLF & _
"Content-Type: application/x-www-form-urlencoded" & @CRLF & _
"Content-Length: 50" & @CRLF & @CRLF & $loginpost



TCPStartup()
$sock = TcpConnect(TCPNameToIP("wwww.THEWEBSITE.com"), 80)
TCPSend($sock, $packet)
Do
    $rcv = TCPRecv($sock, 1024)
Until $rcv <> ""
Do
    $rcv &= TCPRecv($sock, 1024)
Until @error Or StringINStr($socket, "</html>")

msgbox(1, "ok", "ok")
FileWrite(@ScriptDir & '\test.html')
TCPCloseSocket($sock)
TCPShutdown()

That's the begin, i'm working on the connection (the harder of both) ... but it never write anything in my test.html ... i don't know why

Thanks for you help,

n0way

Edited by n0way
Link to comment
Share on other sites

There's n0way to do that the way you think. For example you need to properly handle cookies in order to stay logged-in, at top of all other issues you have, not to mention that you are saying to the server that you are willing to accept compressed content.

Find some other means to do what you want except "raw" TCP.

♡♡♡

.

eMyvnE

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...