Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

[HELP] Getting IP's from HideMyAss [Please?]

Before the bitching begins, i have used the search feature but all links are down for any sources.

I am in the process of making an AdFly clicker but would like to integrate a way of getting proxies automatically (IP:PORT).

Can anybody help me with a snippet at least on scraping proxies from HMA?.

I have no experience with regex etc..

Thanks in advance.

P.S: if you help, i will give you credits where due, on the GUI and within the source.

EDIT: I found a source but it isn't working,
Code
Imports System.Text.RegularExpressions
Public Class scraper
    Dim Thread1 As System.Threading.Thread
    Private Sub GrabProxies()
  CheckForIllegalCrossThreadCalls = False
  Dim i As Integer = 1
  Do Until i = NumericUpDown1.Value + 1
    Dim request As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create("http://hidemyass.com/proxy-list/" + i.ToString)
    Dim response As System.Net.HttpWebResponse = request.GetResponse
    Dim sr As System.IO.StreamReader = New System.IO.StreamReader(response.GetResponseStream())
    Dim rssourcecode As String = sr.ReadToEnd
    Dim r As New System.Text.RegularExpressions.Regex("(\d{1,4}\.\d{1,4}\.\d{1,4}\.\d{1,4})</span></td>\D+(\d{1,5})</td>\D+<img src=""\S+""\D+""flag"" /> (\w+)\D+\S+\D+(\d+%)\D+\S+\D+(\d+%)""\D+<td>(\w+)\D+"">(\w+)")
    Dim matches As MatchCollection = r.Matches(rssourcecode)
    For Each itemcode As Match In matches
    With ListView1.Items.Add("")
    .SubItems.Add(itemcode.Groups(1).Value)
    .SubItems.Add(itemcode.Groups(2).Value)
    .SubItems.Add(itemcode.Groups(3).Value)
    .SubItems.Add(itemcode.Groups(4).Value)
    .SubItems.Add(itemcode.Groups(5).Value)
    .SubItems.Add(itemcode.Groups(6).Value)
    .SubItems.Add(itemcode.Groups(7).Value)
    End With
    Next
    i = i + 1
  Loop

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  Thread1 = New System.Threading.Thread(AddressOf GrabProxies)
  Thread1.Start()
    End Sub
commonly proxies can be parsed using regex
Code
[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}:[0-9]{1,4}
but in case of HMA its not tht simple u hav to take a look at the source code and create ur own regex anyways the above regex would work with most of the sites
(Jul 5, 2012 09:46 AM)ytlayol Wrote:  commonly proxies can be parsed using regex
Code
[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}:[0-9]{1,4}
but in case of HMA its not tht simple u hav to take a look at the source code and create ur own regex anyways the above regex would work with most of the sites

I don't know how to do it, I've looked up a few tuts, even had a source but it won't work.
(Jul 5, 2012 10:19 AM)Gold Lion Wrote:  I don't know how to do it, I've looked up a few tuts, even had a source but it won't work.

In the website's source "118.96.8.138:3128" is showed like this
PHP Code

<?php 
<td><span><span class="244">118</span><div style="display:none">38</div>.96<span style="display:none">126</span><div style="display:none">83</div>.<span style="display: inline">8</span>.138</span></td>    
  <
td>
3128</td> 
Well it took a while because HMA likes to obfuscate their IP's, but this works:

[Image: M2LvN.png]

Code
#Region "GetProxies Function"
    Shared Sub Get50Proxies()
  Dim ts As String = String.Empty
  Dim t As String = String.Empty
  ProxyList.Clear()
  Dim s As String = wc.DownloadString("http://hidemyass.com/proxy-list/").Replace("<td rel", "ʘ")
  For i As Integer = 1 To 50
    ts = Split(s, "class=""updatets")(i).Split("ʘ")(0)
    t = String.Empty
    For ip As Integer = 1 To (System.Text.RegularExpressions.Regex.Matches(ts, "<div").Count + System.Text.RegularExpressions.Regex.Matches(ts, "<span").Count + System.Text.RegularExpressions.Regex.Matches(ts, "<td").Count) * 2 + 1
    If Not Split(ts.Replace(" ", ""), "<")(ip).Split(">")(0).Contains(":none") And Not String.IsNullOrEmpty(Split(ts.Replace(" ", ""), ">")(ip + 1).Split("<")(0).Replace(".", String.Empty).Replace(Chr(10), String.Empty).Replace(Chr(9), String.Empty)) Then
    t &= Split(ts.Replace(" ", ""), ">")(ip + 1).Split("<")(0).Replace(".", "").TrimStart(Chr(10)) & "."
    End If
    Next
    t = t.TrimEnd(".")
    t = t.Insert(t.LastIndexOf(".") + 1, ":")
    t = t.Remove(t.LastIndexOf("."), 1)
    MsgBox(t)
    ProxyList.Add(t)
  Next
    End Sub
#End Region

I left the Msgbox in for debugging and so you guys can check it out.
Cody, thanks for awesome source. Ma grabbing class always only grabbed 40 or so, thats why i used other sites :)
I wrote the snippet for this yesterday when i saw this but my net got disconnected due to some strange reason so can't post, here's the one i did in c# (converted with online converters)

PHP Code

<?php 
Public Function grabProxy(ByVal source As String) As String()
  
' Credits: Soft2050
  Dim proxies = New List(Of String)()
  For Each m As Match In Regex.Matches(source, "<td><span>([\s\S]*?)(\d+)</td>")
    Dim port As String = m.Groups(2).Value
    Dim ip As String = m.Groups(1).Value
    ip = Regex.Replace(ip, "(<(div|span) style=""display:none"">\d+.*?>|<.*?>)", "").Trim()
    proxies.Add(String.Concat(ip, ":", port))
  Next
  Return proxies.ToArray()
    End Function 

Usage:
PHP Code

<?php 
Dim wc 
As New WebClient()

  
Dim proxyList As String() = grabProxy(wc.DownloadString("http://hidemyass.com/proxy-list/"))

  Array.ForEach(
proxyList, Sub(s)
     
Console.WriteLine(s)
     
End Sub)

  
Console.ReadKey() 
Thanks for searching bro.

[img]http://i.upme.us/EFfsf.png[/img]
(Jul 6, 2012 02:15 AM)Coleak Wrote:  Thanks for searching bro.

[img]http://i.upme.us/EFfsf.png[/img]

I posted my thread in response to his, a while after he posted.
(Jul 6, 2012 08:17 AM)Cody8295 Wrote:  I posted my thread in response to his, a while after he posted.

Regardless, i'm sure you aren't the only one who has made something like this.
(Jul 6, 2012 11:29 AM)Coleak Wrote:  Regardless, i'm sure you aren't the only one who has made something like this.

I think I am for the updated site. I found some other sources but they weren't working because HMA changes the source of their page often.
(Jul 6, 2012 11:29 AM)Coleak Wrote:  Regardless, i'm sure you aren't the only one who has made something like this.

He actually is though haha, if people don't see what they need in the source when they press Ctrl+U they give up. 🤣
(Jul 6, 2012 12:00 PM)iRtehLeet™ Wrote:  He actually is though haha, if people don't see what they need in the source when they press Ctrl+U they give up. 🤣

I actually just searched, and all the ones I found weren't working, so my bad OP and Cody.
Huge thanks for the help guys, got it working!.

Much appreciated.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[.NET] by ~xXx~Jun 25, 2014 01:49 PM 23 673 Jun 25, 2014 01:49 PM
Last Post: SIM-1676753
[.NET] by ctnTRJun 12, 2014 02:52 PM 16 2,131 Jun 12, 2014 02:52 PM
Last Post: Hopsin
[Python] by K-On!Jan 29, 2014 05:44 AM 5 345 Jan 29, 2014 05:44 AM
Last Post: K-On!