|
-
Mar 8th, 2007, 05:20 PM
#1
Thread Starter
Frenzied Member
vb expert help needed
I'm not sure what to send to the server, but I want to somehow log into
http://www.sparkpea.net/signin.php
using winsock.
So, opening a socket on www.sparkpea.net - port 80, sending the necessary POST headers.
but im not sure how to login by sockets using my email/password for that site/or what headers to send etc. I hope someones vb expertise can help me out as im desperate to get this working!
Thanks in advance guys!
-
Mar 8th, 2007, 10:30 PM
#2
Re: vb expert help needed
Use a packet sniffer to look at the HTTP POST data when signing into the website. I use Ethereal since it's free and it's good.
Then just connect to the server and send the data. The POST data should follow the HTTP header.
Then you'll need to parse the response on the Winsock_DataArrival() event.
-
Mar 9th, 2007, 07:53 AM
#3
Thread Starter
Frenzied Member
Re: vb expert help needed
Thanks Digi, I packet sniffed it.
I did the necessary response but it still does not login.
-
Mar 9th, 2007, 09:52 AM
#4
Re: vb expert help needed
 Originally Posted by Pouncer
Thanks Digi, I packet sniffed it.
I did the necessary response but it still does not login.
Does it do anything?
-
Mar 9th, 2007, 10:16 AM
#5
Thread Starter
Frenzied Member
Re: vb expert help needed
Hi Hack, thank you fr posting. I hope you can help me.
Code:
Private Sub Form_Load()
winsock.Connect "www.sparkpea.net", 80
End Sub
Private Sub winsock_Connect()
Dim content As String
contet = "[email protected]&pass=mypass123&sublogin=1&submit=Sign+in"
winsock.SendData "POST /signin.php HTTP/1.1" & vbCrLf & _
"Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*" & vbCrLf & _
"Referer: http://www.sparkpea.net/signin.php" & vbCrLf & _
"Accept-Language: en-us" & vbCrLf & _
"Content-Type: application/x-www-form-urlencoded" & vbCrLf & _
"Accept-Encoding: gzip, deflate" & vbCrLf & _
"User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)" & vbCrLf & _
"Host: www.sparkpea.net" & vbCrLf & _
"Content-Length: " & Len(content) & vbCrLf & _
"Connection: Keep-Alive" & vbCrLf & _
"Cache-Control: no-cache" & vbCrLf & _
"Cookie: PHPSESSID=" & vbCrLf & vbCrLf & content & vbCrLf & vbCrLf
End Sub
Private Sub winsock_DataArrival(ByVal bytesTotal As Long)
Dim str As String
winsock.GetData (str)
Debug.Print str
End Sub
Its not printing anything. I packet sniffed it, and put the right headers in to try and login from the signin.php, but please, anything im doing wrong?
Last edited by Pouncer; Mar 9th, 2007 at 10:20 AM.
-
Mar 9th, 2007, 11:20 AM
#6
Addicted Member
Re: vb expert help needed
I'm not sure if a type error or not but
you Dimmed 'content'
and the next line set 'contet' = to "........."
-
Mar 9th, 2007, 04:03 PM
#7
Thread Starter
Frenzied Member
Re: vb expert help needed
 Originally Posted by re_turner_jr
I'm not sure if a type error or not but
you Dimmed 'content'
and the next line set 'contet' = to "........."
ty, changed it, still makes no difference.
it doesnt print anything or log me in :'(
-
Mar 9th, 2007, 04:08 PM
#8
Re: vb expert help needed
Put Option Explicit at the very top of your code. Then tell us if you get an error or not.
Edit: Also, debug the Winsock_Error() event, ie:
Code:
Private Sub Winsock1_Error(ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean)
Debug.Print Description
End Sub
-
Mar 9th, 2007, 04:13 PM
#9
Also...
Also, you may want to leave out the PHPSESSID/cookie information in the header.
Just supply the HTTP Header and post information that you have in "content"
Also packet sniff again when using your program to make sure all of it is correct.
-
Mar 9th, 2007, 06:55 PM
#10
Thread Starter
Frenzied Member
Re: vb expert help needed
I am trying everything guys, it's not working at all for me. Could someone else please packet sniff to confirm i am doing it right?
Code:
Option Explicit
Private Sub Form_Load()
winsock.Connect "www.sparkpea.net", 80
End Sub
Private Sub winsock_Connect()
Dim content As String
content = "[email protected]&pass=mypass123&sublogin=1&submit=Sign+in"
winsock.SendData "POST /signin.php HTTP/1.1" & vbCrLf & _
"Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*" & vbCrLf & _
"Referer: http://www.sparkpea.net/signin.php" & vbCrLf & _
"Accept-Language: en-us" & vbCrLf & _
"Content-Type: application/x-www-form-urlencoded" & vbCrLf & _
"Accept-Encoding: gzip, deflate" & vbCrLf & _
"User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)" & vbCrLf & _
"Host: www.sparkpea.net" & vbCrLf & _
"Content-Length: " & Len(content) & vbCrLf & _
"Connection: Keep-Alive" & vbCrLf & _
"Cache-Control: no-cache" & vbCrLf & _
"Cookie: & vbCrLf & vbCrLf & content & vbCrLf & vbCrLf"
End Sub
Private Sub winsock_DataArrival(ByVal bytesTotal As Long)
Dim str As String
winsock.GetData (str)
Debug.Print str
End Sub
Private Sub winsock_Error(ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean)
Debug.Print Description
End Sub
it just does nothing
-
Mar 10th, 2007, 07:49 AM
#11
Thread Starter
Frenzied Member
Re: vb expert help needed
is this not possible then guys?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|