· 9 years ago · Jan 29, 2017, 06:54 PM
1 Public Function Checking(username As String) As Boolean
2 ServicePointManager.DefaultConnectionLimit = 300
3 ServicePointManager.UseNagleAlgorithm = False
4 ServicePointManager.Expect100Continue = False
5 Dim RandomHach As New Random(DateAndTime.Now.Millisecond)
6 Dim str As String = Nothing
7 Dim Connection As New Connection
8 Dim RandomNumber As Integer = RandomHach.Next(111111, 1000000)
9 Dim Post As New StringBuilder
10 Try
11 Connection.UsedCookies = False
12 Connection.KeepAlive = True
13 Connection.SendCookies = False
14 Connection.StoreCookies = False
15 Connection.Useragent = "Instagram 9.3.0 Android (18/4.3; 320dpi; 720x1280; Xiaomi; HM 1SW; armani; qcom; en_US)"
16 Connection.Cookies = DefaultCookies
17 Connection.AcceptLanguage = "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"
18 Connection.Accept = "*/*"
19 Connection.AcceptCharset = Nothing
20 Connection.TimeOut = NumericUpDown2.Value
21 Connection.ContentType = ("multipart/form-data; boundary=HAHAHAGAFSRF462" + RandomNumber.ToString())
22 Post.AppendLine("--HAHAHAGAFSRF462" + RandomNumber.ToString())
23 Post.AppendLine("Content-Disposition: form-data; name=""signed_body""")
24 Post.AppendLine("")
25 Post.AppendLine(JSONCheck(username))
26 Post.AppendLine("--HAHAHAGAFSRF462" + RandomNumber.ToString())
27 Post.AppendLine("Content-Disposition: form-data; name=""ig_sig_key_version""")
28 Post.AppendLine("")
29 Post.AppendLine("5")
30 Post.AppendLine("--HAHAHAGAFSRF462" + RandomNumber.ToString() + "--")
31 Dim ResultofHttp As HttpResponse = Nothing
32 ResultofHttp = Connection.GetResponse(Nothing, Verb.POST, "https://i.instagram.com/api/v1/accounts/create/", Post.ToString)
33 If ResultofHttp.Html.ToLower.Contains("username".ToLower) Then
34 Return False
35 ElseIf ResultofHttp.Html = "" Then
36 Return False
37 ElseIf ResultofHttp.Html.ToLower.Contains("name".ToLower) Then
38 Return False
39 ElseIf ResultofHttp.Html.ToLower.Contains("user".ToLower) Then
40 Return False
41 Else
42 If Not username = "" Then
43 Return True
44 End If
45 End If
46 Catch ex As Exception
47 Return False
48 End Try
49 End Function
50------------------------
51 Public Function JSONCheck(username As String)
52 Dim uuid As String = Guid.NewGuid.ToString.ToUpper
53 Dim Posting As String = String.Concat(New String() {"{""_uuid"":""", uuid, """,""username"":""", username, """,""device_id"":""", uuid, """,""email"":"""",""_csrftoken"":""missing""}"})
54 Dim sb As New StringBuilder
55 Try
56 Dim secretkey As String = "26e29e57f4ea61a0ebb4ee0ec483e5efe7ca39093adcfa3689dadbfba139546b"
57 Dim sha As New HMACSHA256(System.Text.ASCIIEncoding.ASCII.GetBytes(secretkey))
58 Dim Hash() As Byte = sha.ComputeHash(System.Text.ASCIIEncoding.ASCII.GetBytes(Posting))
59 sb = New StringBuilder(Hash.Length * 2)
60 For Each B As Byte In Hash
61 sb.Append(Hex(B).PadLeft(2, "0"))
62 Next
63 Catch ex As Exception
64 ProjectData.SetProjectError(ex)
65 ProjectData.ClearProjectError()
66 End Try
67 Dim Data As String = sb.ToString.ToLower & "." & Posting
68 Return Data
69 End Function