Hi, please guys I really need help please.
I'm trying to login onto a web site using HttpWebRequest but it's seems like it doesn't work.
When I make Request, it's just bring me to the login page (see last picture) without doing anything.
I'm using Live Http headers as well to capture HTTP traffic.
I'm currently watching this video (
)
Just want to point out that on the video, he says to use "Referer" but in "Live Http Headers" I don't see "Referer" after "Content-Length: x" that's why I use "auth_key"
Below is my code and my screen capture from Live Http Headers.
I'm trying to login onto a web site using HttpWebRequest but it's seems like it doesn't work.
When I make Request, it's just bring me to the login page (see last picture) without doing anything.
I'm using Live Http headers as well to capture HTTP traffic.
I'm currently watching this video (
Just want to point out that on the video, he says to use "Referer" but in "Live Http Headers" I don't see "Referer" after "Content-Length: x" that's why I use "auth_key"
Below is my code and my screen capture from Live Http Headers.
Code:
Imports System.Net
Imports System.Text
Imports System.IO
Public Class Form1
Dim logincookie As CookieContainer
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim postData As String = "auth_key=880ea6a14ea49e853634fbdc5015a024&rememberMe=1&referer=http%3A%2F%2Fforums.zybez.net%2F&ips_username=" & TextBox1.Text & "&ips_password=" & TextBox2.Text & "&submit=Login"
Dim tempCookies As New CookieContainer
Dim encoding As New UTF8Encoding
Dim byteData As Byte() = encoding.GetBytes(postData)
Dim postReq As HttpWebRequest = DirectCast(WebRequest.Create("https://forums.zybez.net/index.php?app=curseauth&module=global§ion=login&do=process"), HttpWebRequest)
postReq.Method = "POST"
postReq.KeepAlive = True
postReq.CookieContainer = tempCookies
postReq.ContentType = "application/x-www-form-urlencoded"
postReq.Referer = "https://forums.zybez.net/index.php?app=curseauth&module=global§ion=login&do=process"
postReq.UserAgent = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0"
postReq.ContentLength = byteData.Length
'ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3
Dim postreqstream As Stream = postReq.GetRequestStream()
postreqstream.Write(byteData, 0, byteData.Length)
postreqstream.Close()
Dim postresponse As HttpWebResponse
postresponse = DirectCast(postReq.GetResponse(), HttpWebResponse)
tempCookies.Add(postresponse.Cookies)
logincookie = tempCookies
Dim postreqreader As New StreamReader(postresponse.GetResponseStream())
Dim thepage As String = postreqreader.ReadToEnd
RichTextBox1.Text = thepage
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
WebBrowser1.DocumentText = RichTextBox1.Text
End Sub
End Class
Attachments
Last edited: