· 9 years ago · Jan 30, 2017, 04:44 PM
1 Private Sub Label3_Click(sender As Object, e As EventArgs) Handles Label3.Click
2 'Dim flag As Boolean = login(TextBox1.Text, TextBox2.Text)
3 'If flag Then
4 ' Dim flag2 As Boolean = GetSettings()
5 ' If flag2 Then
6 ' TextBox5.Text = "Logged in " & TextBox1.Text & "."
7 ' TextBox5.ForeColor = Color.Green
8 ' Label3.Enabled = False
9 ' ThreadPoint = TextBox4.Text
10 ' TargetName = TextBox3.Text
11 ' Dim Threader As New Thread(AddressOf SetStatus) : Threader.Start()
12 ' Dim Thread As New Thread(AddressOf DoThreadsWorks, 100) With {.IsBackground = True}
13 ' Thread.Start(New ThreadStart(AddressOf Turbo))
14 ' Else
15 ' TextBox5.Text = "Timeout Information Connection."
16 ' TextBox5.ForeColor = Color.Red
17 ' End If
18 'ElseIf CustomCookies = "checkpoint" Then
19 ' TextBox5.Text = "Active your account first !."
20 ' TextBox5.ForeColor = Color.Orange
21 'ElseIf CustomCookies = "no" Then
22 ' TextBox5.Text = "Timeout Login Connection."
23 ' TextBox5.ForeColor = Color.Red
24 'Else
25 ' TextBox5.Text = "Something error."
26 ' TextBox5.ForeColor = Color.Red
27 'End If
28 Dim Post As New StringBuilder
29 Dim num As Integer = (New Random(DateAndTime.Now.Millisecond)).Next(111111, 1000000)
30 Post.AppendLine("--HAHAHAGAFSRF462" & num.ToString())
31 Post.AppendLine("Content-Disposition: form-data; name=""signed_body""")
32 Post.AppendLine(String.Empty)
33 Post.AppendLine(CheckJSON(TextBox1.Text))
34 Post.AppendLine("--HAHAHAGAFSRF462" & num.ToString())
35 Post.AppendLine("Content-Disposition: form-data; name=""ig_sig_key_version""")
36 Post.AppendLine(String.Empty)
37 Post.AppendLine("5")
38 Post.AppendLine("--HAHAHAGAFSRF462" & num.ToString() + "--")
39 MsgBox(Post.ToString)
40 Dim PostData As String = My.Resources.Service.ToString.Replace("S&S", Post.ToString).Replace("&Length&", Encoding.ASCII.GetBytes(Post.ToString).Length.ToString).Replace("#Rnd", num.ToString())
41 Dim flag As String = TcpSending(PostData)
42 MsgBox(flag)
43 End Sub
44 Public Function CheckJSON(user As String)
45 Dim uuid As String = guid.NewGuid.ToString.ToUpper
46 Dim Posting As String = "{""username"":""" & user & """,""guid"":""" & uuid & """,""_csrftoken"":""missing""}"
47 Dim sb As New StringBuilder
48 Try
49 Dim secretkey As String = "fc4720e1bf9d79463f62608c86fbddd374cc71bbfb98216b52e3f75333bd130d"
50 Dim sha As New HMACSHA256(System.Text.ASCIIEncoding.ASCII.GetBytes(secretkey))
51 Dim Hash() As Byte = sha.ComputeHash(System.Text.ASCIIEncoding.ASCII.GetBytes(Posting))
52 sb = New StringBuilder(Hash.Length * 2)
53 For Each B As Byte In Hash
54 sb.Append(Hex(B).PadLeft(2, "0"))
55 Next
56 Catch ex As Exception
57 ProjectData.SetProjectError(ex)
58 ProjectData.ClearProjectError()
59 End Try
60 Dim Data As String = sb.ToString.ToLower & "." & Posting
61 Return Data
62 End Function
63 Public Function TcpSending(PostData As String) As String
64 Try
65 Dim Host As String = "i.instagram.com"
66 Dim tcp As New TcpClient
67 tcp.SendTimeout = 1000
68 tcp.SendBufferSize = 5000
69 Try
70 tcp.Connect(Host, 443)
71 Catch ex As Exception
72 Return False
73 End Try
74 Dim ClientStream As New SslStream(tcp.GetStream, False, (Function(a As Object, b As X509Certificate, c As X509Chain, d As SslPolicyErrors) As Boolean
75 Return d = SslPolicyErrors.None
76 End Function), Nothing)
77 ClientStream.AuthenticateAsClient(Host)
78 For Each Headr In Split(PostData, vbCrLf, -1, CompareMethod.Binary)
79 Dim ByteWrite As Byte() = System.Text.Encoding.Default.GetBytes((Headr & ChrW(13) & ChrW(10)))
80 ClientStream.Write(ByteWrite, 0, ByteWrite.Length)
81 ClientStream.Flush()
82 Next
83 Dim inStream As Byte() = New Byte(20000) {}
84 ClientStream.Read(inStream, 0, inStream.Length)
85 Dim returndata As String = System.Text.Encoding.ASCII.GetString(inStream)
86 'ClientStream.Flush()
87 'ClientStream.Close()
88 Return returndata
89 'If returndata.Contains("HTTP/1.1 200 OK") Then
90 ' Return True
91 'End If
92 Catch ex As Exception
93 Return ex.Message & vbCrLf & ex.Source
94 End Try
95 Return "Error"
96 End Function
97-----------------
98The Service :
99POST /api/v1/accounts/create/ HTTP/1.1
100Host: i.instagram.com
101User-Agent: Instagram 9.4.0 Android (18/4.3; 320dpi; 720x1280; Xiaomi; HM 1SW; armani; qcom; en_US)
102Accept: */*
103Accept-Language: en;q=1, fr;q=0.9, de;q=0.8, zh-Hans;q=0.7, zh-Hant;q=0.6, ja;q=0.5
104Accept-Encoding: gzip, deflate
105Content-Type: multipart/form-data; boundary=HAHAHAGAFSRF462534233
106Content-Length: &Length&
107Connection: Keep-Alive
108
109S&S