Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports System.Net
- Imports System.Text.RegularExpressions
- Imports System.Web
- Public Class Form1
- Dim Cookies As String
- Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
- Dim stringPOSTData As String = "username=" & TextBox1.Text & "&enc_password=#PWD_INSTAGRAM_BROWSER:0:" & Get_time() & ":" & TextBox2.Text & "&queryParams={}&optIntoOneTap=false"
- Dim responString As String
- Using w As New WebClient
- w.Headers.Add("accept", "*/*")
- w.Headers.Add("content-type: application/x-www-form-urlencoded")
- w.Headers.Add("x-csrftoken", "missing")
- w.Headers.Add("user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.106 Safari/537.36")
- w.Headers.Add("x-instagram-ajax", "1")
- w.Headers.Add("x-requested-with: XMLHttpRequest")
- Try
- responString = w.UploadString("https://www.instagram.com/accounts/login/ajax/", "POST", Uri.EscapeUriString(stringPOSTData))
- 'MsgBox(responString)
- If w.ResponseHeaders("set-cookie").ToString.Contains("sessionid") Then
- ' Done login
- ' MsgBox("Done LOGIN")
- Dim resCookies As String = w.ResponseHeaders("set-cookie").ToString
- Cookies = Regex.Match(resCookies, "sessionid=(.*?);").Value & " " & Regex.Match(resCookies, "mid=(.*?);").Value & " " & Regex.Match(resCookies, "csrftoken=(.*?);").Value & " " & Regex.Match(resCookies, "ig_did=(.*?);").Value & " " & Regex.Match(resCookies, "rur=(.*?);").Value
- MsgBox(Cookies)
- Else
- ' Info Worng
- MsgBox("Error LOGIN")
- End If
- Catch ex As WebException
- Dim respon As String = New IO.StreamReader(ex.Response.GetResponseStream).ReadToEnd
- ' Error Login
- MsgBox(respon)
- End Try
- End Using
- End Sub
- Function Get_time() As String
- Return CLng(DateTime.UtcNow.Subtract(New DateTime(1970, 1, 1)).TotalMilliseconds)
- End Function
- End Class
Add Comment
Please, Sign In to add comment