Winsock, swings and roundabouts

Results 1 to 2 of 2

Thread: Winsock, swings and roundabouts

  1. #1
    Join Date
    Dec 1969

    Default Winsock, swings and roundabouts

    Hi all,<BR><BR>Been writing an application for a Winsock application and h ave encountered a problem, I keep getting "invalid request" returned from the server.<BR><BR>I&#039;ll explain further and you might be able to advise.<BR><BR>The form i am spoofing is served as HTTP, and posts to an HTTPS page. I assume from this that the "POST" of information should have the header of "HTTP/1.1" and be sent out on port 80 not 443 (https port)? what do guys think? Here&#039;s a copy of the header i am sending:<BR><BR> strHttpRequest = "POST /_cqr/vllogin.adp HTTP/1.1" & vbCrLf<BR> strHttpRequest = strHttpRequest & "Host: " & m_strRemoteHost & vbCrLf<BR> strHttpRequest = strHttpRequest & "Accept: */*" & vbCrLf<BR> strHttpRequest = strHttpRequest & "User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Windows NT)" & vbCr<BR> strHttpRequest = strHttpRequest & "Connection: Close" & vbCrLf<BR> strHttpRequest = strHttpRequest & "user=" & Text1.Text & vbCrLf<BR> strHttpRequest = strHttpRequest & "pass=" & Text2.Text & vbCrLf<BR> strHttpRequest = strHttpRequest & "cmd=slogin" & vbCrLf<BR> strHttpRequest = strHttpRequest & "bid=aol" & vbCrLf<BR><BR><BR>The host is correct, as is the page name, username, password, etc.<BR><BR>Once clicking submit on my VB form i perform a netstat and it&#039;s clear to see that my app is communicating with the mail server i am trying to login to. It doesn&#039;t return "bad browser type" like it did to start with (using ServerXMLHTTP!) as that&#039;s now spoofed. <BR><BR>my netstat says:<BR> TCP Bud:2364 ESTABLISHED<BR><BR><BR><BR>I&#039;m just not sure where i am going wrong here!<BR><BR><BR>Any help would be great. Regards,<BR><BR>Jonny Tooze

  2. #2
    Join Date
    Dec 1969

    Default I think... need two vbcrlf&#039;s at the end. That ends the HTTP header.<BR><BR>The "Invalid Request" error literally means that the HTTP request was malformed in some way...<BR><BR>Craig.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts