Jump to content

WinHTTP and HTTPS


Recommended Posts

Hey,

because I receive a lot of spam mails every day I would like to create some new email adresses with AutoIt.

But there are several problem I could not solve :blink:.

Here's the page: https://user.web.de/all.jsf?mc=hp@fm@modullink.produkte@freemail

I would like to donwload the captcha to show it in my GUI.

This is the Header:

https://user.web.de/all.jsf?mc=hp@fm@modullink.produkte@freemail

GET /all.jsf?mc=hp@fm@modullink.produkte@freemail HTTP/1.1
Host: user.web.de
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; de; rv:1.9.2.7) Gecko/20100713 Firefox/3.6.7 GTB7.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
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: 115
Connection: keep-alive

And the answer:

HTTP/1.1 200 OK
Date: Fri, 23 Jul 2010 13:39:07 GMT
Server: Apache
Pragma: no-cache
Cache-Control: no-cache,no-store,max-age=0,post-check=0,pre-check=0
Expires: Sat, Jun 18 1983 08:15:00 GMT
Content-Language: de
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Type: text/html;charset=UTF-8
Set-Cookie: JSESSIONID=02E214BA5B2C7F015CB2C67FF30D885D.a02a01d41t21; Path=/
Connection: close
Transfer-Encoding: chunked

If I try to script this with AutoIt I always receive an error:

#include <WinHTTP.au3>

FileDelete("test.html")

$hw_open = _WinHttpOpen("Mozilla/5.0 (Windows; U; Windows NT 6.1; de; rv:1.9.2.7) Gecko/20100713 Firefox/3.6.7 GTB7.1")
$hw_connect = _WinHttpConnect($hw_open, "user.web.de" ,$INTERNET_DEFAULT_HTTPS_PORT)
$h_openRequest = _WinHttpOpenRequest($hw_connect, "GET", "/all.jsf?mc=hp@fm@modullink.produkte@freemail", "HTTP/1.1", _
                $WINHTTP_NO_REFERER, $WINHTTP_DEFAULT_ACCEPT_TYPES, $WINHTTP_FLAG_SECURE)

_WinHttpAddRequestHeaders($h_openRequest, "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8")
_WinHttpAddRequestHeaders($h_openRequest, "Accept-Language: de-de,de;q=0.8,en-us;q=0.5,en;q=0.3")
_WinHttpAddRequestHeaders($h_openRequest, "Accept-Encoding: gzip,deflate")
_WinHttpAddRequestHeaders($h_openRequest, "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7")
_WinHttpAddRequestHeaders($h_openRequest, "Keep-Alive: 115")
_WinHttpAddRequestHeaders($h_openRequest, "Connection: keep-alive")

_WinHttpSendRequest($h_openRequest)
_WinHttpReceiveResponse($h_openRequest)

$header = _WinHttpQueryHeaders($h_openRequest)
MsgBox(0, "Header", $header)
If _WinHttpQueryDataAvailable($h_openRequest) Then
    Local $data=""
    Do
        $data&=_WinHttpReadData($h_openRequest)
    Until @error<>0
    MsgBox(0, "Body", $data)
    FileWrite("test.html", $data)
EndIf

_WinHttpCloseHandle($h_openRequest)
_WinHttpCloseHandle($hw_connect)
_WinHttpCloseHandle($hw_open)

The answer here is:

HTTP/1.1 500 Internal Server Error
Connection: close
Date: Fri, 23 Jul 2010 13:54:58 GMT
Transfer-Encoding: chunked
Content-Type: text/html;charset=utf-8
Content-Encoding: gzip
Server: Apache
Vary: Accept-Encoding

I think that's because of the Javascript cookie management, but I don't know how to go on.

I would appreciate it if somebody could help me.

Thanks!!!

arnonym

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