Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports System.IO
- Imports System.Net
- Imports System.Net.Security
- Imports System.Net.Sockets
- Imports System.Text
- Imports System.Text.RegularExpressions
- Public Class Form1
- ' _ _ _ _ _ _ _ _ _ _
- ' /\_\ /\ \ /\ \ _ /\ \ /\ \ /\ \ /\_\/\_\ _ / /\ /\ \
- ' / / / _ \ \ \ / \ \ /\_\ / \ \ / \ \____ / \ \ / / / / //\_\ / / \ / \ \
- ' / / / /\_\ /\ \_\ / /\ \ \_/ / // /\ \_\ / /\ \_____\ / /\ \ \ /\ \/ \ \/ / // / /\ \__ / /\ \ \
- ' / / /__/ / / / /\/_/ / / /\ \___/ // / /\/_/ / / /\/___ // / /\ \ \ / \____\__/ // / /\ \___\ / / /\ \ \
- ' / /\_____/ / / / / / / / \/____// / / ______ / / / / / // / / \ \_\ / /\/________/ \ \ \ \/___// / / \ \_\
- ' / /\_______/ / / / / / / / / // / / /\_____\ / / / / / // / / / / // / /\/_// / / \ \ \ / / / \/_/
- ' / / /\ \ \ / / / / / / / / // / / \/____ // / / / / // / / / / // / / / / /_ \ \ \ / / /
- ' / / / \ \ \ ___/ / /__ / / / / / // / /_____/ / / \ \ \__/ / // / /___/ / // / / / / //_/\__/ / / / / /________
- '/ / / \ \ \ /\__\/_/___\/ / / / / // / /______\/ / \ \___\/ // / /____\/ / \/_/ / / / \ \/___/ / / / /_________\
- '\/_/ \_\_\\/_________/\/_/ \/_/ \/___________/ \/_____/ \/_________/ \/_/ \_____\/ \/____________/
- ' '
- '
- '
- '
- ' Kingdom ( الممَلكة ) .
- ' instagram : KingDomSc .
- ' whatsapp : 00966501615727 .
- Function getCasperData(username As String, password As String) As String
- Try
- Dim request As HttpWebRequest = HttpWebRequest.Create("http://kingdomsc.us/snap/api.php")
- request.CookieContainer = New CookieContainer
- request.Method = "POST"
- request.UserAgent = "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:53.0) Gecko/20100101 Firefox/53.0"
- request.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
- request.Headers.Add("Accept-Language: en-US,en;q=0.5")
- request.ContentType = "application/x-www-form-urlencoded"
- Dim PostData As String = "usname=" & username & "&pwd=" & password & "&data=1"
- Dim bytearray As Byte() = Encoding.Default.GetBytes(PostData)
- request.ContentLength = bytearray.Length
- Dim dataStream As Stream = request.GetRequestStream()
- dataStream.Write(bytearray, 0, bytearray.Length)
- dataStream.Close()
- Dim response As HttpWebResponse = request.GetResponse()
- dataStream = response.GetResponseStream()
- Dim reader As New StreamReader(dataStream)
- Dim responseFromServer As String = reader.ReadToEnd()
- reader.Close()
- dataStream.Close()
- response.Close()
- Return "{" & Regex.Match(responseFromServer & vbNewLine, vbNewLine & "{(.*?)}" & vbNewLine).Groups.Item(1).Value & "}"
- Catch ex As WebException
- Return "Error is:" & vbNewLine & New StreamReader(ex.Response.GetResponseStream).ReadToEnd
- End Try
- End Function
- Function SnapChat_Login(CasperResponse As String, username As String, password As String) As String
- tt:
- Dim timestamp As String = Regex.Match(CasperResponse, """timestamp"":(.*?),").Groups.Item(1).Value
- Dim req_token As String = Regex.Match(CasperResponse, """req_token"":""(.*?)"",").Groups.Item(1).Value
- Dim d As String = "confirm_reactivation=false&from_deeplink=false&height=1136&nt=1&password=" & password & "&pre_auth_token=&remember_device=true&req_token=" & Regex.Match(CasperResponse, """req_token"":""(.*?)""").Groups.Item(1).Value & "&screen_height_in=3.5&screen_height_px=568&screen_width_in=1.9&screen_width_px=320×tamp=" & Regex.Match(CasperResponse, """timestamp"":(.*?),").Groups.Item(1).Value & "&username=" & Regex.Match(CasperResponse, """username"":""(.*?)""").Groups.Item(1).Value & "&width=640"
- Dim data As String = "POST /loq/login HTTP/1.1
- Accept: */*
- Accept-Language: en;q=1
- Accept-Locale: en_US
- User-Agent: Snapchat/10.6.2.0 (iPhone6,2; iOS 9.3.2; gzip)
- X-Snapchat-Client-Token: " & Regex.Match(CasperResponse, """X-Snapchat-Client-Token"":""(.*?)""").Groups.Item(1).Value & "
- X-Snapchat-Client-Auth-Token: " & Regex.Match(CasperResponse, """X-Snapchat-Client-Auth-Token"":""(.*?)""").Groups.Item(1).Value & "
- X-Snapchat-UUID: " & Regex.Match(CasperResponse, """X-Snapchat-UUID"":""(.*?)""").Groups.Item(1).Value & "
- Content-Type: application/x-www-form-urlencoded
- Content-Length: " & d.Length & "
- Host: app.snapchat.com
- Connection: Keep-Alive
- " & d
- Dim client As New TcpClient()
- client.Connect("app.snapchat.com", 443)
- Dim by As Byte() = Encoding.Default.GetBytes(data, 0, data.Length)
- Dim Stream As SslStream = New SslStream(client.GetStream, False, Function()
- Return True : End Function, Nothing)
- Stream.AuthenticateAsClient("app.snapchat.com")
- Stream.Write(by, 0, by.Length)
- Stream.Flush()
- by = New Byte(1024) {}
- Dim Response As New StringBuilder()
- Do
- Dim dd As New StringBuilder()
- dd.Append(Encoding.ASCII.GetString(by, 0, Stream.Read(by, 0, by.Length)))
- Try
- Response.Append(Regex.Unescape(dd.ToString))
- Catch ex As Exception
- Response.Append(dd.ToString)
- End Try
- If dd.ToString.Contains("}" & vbNewLine) Then
- Exit Do
- End If
- Loop
- Return Response.ToString
- End Function
- Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load
- Dim Casper_response As String = getCasperData("snap_username", "snap_password")
- MsgBox(SnapChat_Login(Casper_response, "snap_username", "snap_password"))
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement