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

.NET 

How to make a basic name leecher

Hi !
I just got the idea of making a little tutorial about "how to make a name leecher in VB.Net", so why not ?

In this tutorial, I'm gonna cover:
- How to download the source code of the page
- How to use RegEx to grab all the name
- How to use Threading (Obviously)
- How to export the names in a textfile

Note that this tutorial will be about #. For over tracker, you'll just need to adapt the RegEx code.

I: Making the design


We're gonna make something really simple:
[Image: 3281a91f6cc55fe6051ed6ea5df00b2e.png]

Make something like this.

II: Time to code


Create a new sub, call it something like "GetNames", and add a parameter "page", as Integer. We're gonna use a threadpool to make it faster, so we need to tell to the sub which page it have to grab !
First, let's import some DLL:
Code
System.Net
System.Text.RegularExpression
System.Threading

Now, in the "Grab" button code, we're gonna use launch the tasks, using a ThreadPool, so add this code:
Code
For i = 0 To NumericUpDown1.Value
  ThreadPool.QueueUserWorkItem(New WaitCallback(Sub() GetNames(i)))
Next
It's easy to understand, so I'm not gonna explain this. For more information about ThreadPool, go to MSDN.

Now, let's see our GetNames sub.
First of all, we need to get the source code of the page.
It's done pretty easily by using the "DownloadString" method of System.Net, so we got:
[Image: 9ad94de0d3ba872ca868a2748164fb31.png]
(Note that I'm not declaring a new Webclient "Dim w as new webclient", but just using "New WebClient()", because we won't have the use of it after, and it's faster than using "Using", (lolz))

Now, let's see the source code of the webpage, and more precisely the source behind the name of the torrent:
[Image: 054d9a45d7c88d8d7b46eedee31e4324.png]
So we see
Code
<a href="/torrent/8098367/ATK_Hairy_-_Babybell_bab004_-_4_-_251_pics_in_1_sets" class="detLink" title="Details for ATK Hairy - Babybell bab004 - 4 - 251 pics in 1 sets">ATK Hairy - Babybell bab004 - 4 - 251 pics in 1 sets</a>

We are gonna use RegEx and define a pattern according to this.

III: RegEx is so BADASS !


If you don't know what is RegEx, nor how it's work, search for some tutorial, because it's not the point of this tutorial.
Spoiler (Click to View)

We're gonna declare a new RegEx in our GetNames sub:
[Image: f16fb566f85948a8285e7e77fcdd5686.png]
The ".*" is used by RegEx to specify "Here, it can be everything, it'll still works". For more information, open a new tab, type Google, and enj0y !
Now, we're gonna look into each match of RegEx into the source.
Code
For Each m As Match In r.Matches(source)

  Next
Pretty simple, isn't it ?

IV: Get all that Names, bitch !


Now, we're gonna get all the names in the line that RegEx gave us !
For that, in the For loop, we're gonna use Split to get the fifth value, between the "". (Because the Fifth value is the name)
Code
Dim res As String = m.Value.Split("""")(5)
Almost finished ! But the returned string start by "Details of", so we're gonna use the Remove method:
Code
res = res.Remove(0, 12)
And then add the result in our listbox !

We're gonna need an Invoke, because we are in another thread:
Code
Invoke(New MethodInvoker(Sub() nameList.Items.Add(res)))

Enj0y !

Our sub looks like this now:
[Image: 0b9b9e99b920e87fc307574edec64bf7.png]

We're done with the grabber !!1!11!!11!1!
Spoiler (Click to View)

Now, we're gonna ...

V: Export them !!!1!


It's pretty easy to export them in a text file, and since I'm bored as fuck right now, here's the code:

Code
Dim savefile As New SaveFileDialog
  With savefile
    .Filter = "Text file|*.txt"
    .ShowDialog()
  End With
  If Not savefile.FileName = Nothing Then
    Dim [stream] As Stream = savefile.OpenFile
    For i = 0 To ListBox1.Items.Count - 1
    Dim sw As New StreamWriter([stream])
    sw.WriteLine(ListBox1.Items.Item(i).ToString)
    sw.Flush()
    Next
  End If

Put this in the Export button code.

Hope you liked my (long) tutorial !

Cheer,
PsyCh0TyK, French VB.Net h4xx0r.
30 per pages. Can't you search by yourself ?
Nice tutorial mon amis let me bookmark this :)
like the tutorial man great job :) :)
(Feb 5, 2013 03:04 AM)intecno Wrote:  nice but can you send me the download link its very nice


very nice can you send me the download link

It a tutorial, if you want it, do it by yourself ?

I hate people like you, please, leave this forum.
Great tutorial, will try this later, but seems like a very easy to follow guild.

Also, your English is great.
i like your name, and also I think this might be a really nice tut thanks for the share
Awesome tutorial, thanks a lot. :) Very useful.
Looks Legitmate!
Thanks alot, Nice tut btw ;)
(Feb 6, 2013 09:52 AM)Ryusaki Wrote:  Great work OP :)

Btw what would you use it for, exactly? (Eg any relevant practical purpose?)

Hum, you can use it for ... Urgh ... Spread your malware, by taking a list of name and copy your virus with all the names, and then spread it on some sharing platform, like Apex ?

Or in a more legitimate way, use it to learn how RegEx works 🤝

Thanks for the feedbacks everyone !


(Feb 5, 2013 10:52 PM)Daring Wrote:  This only gets a single page from TPB, but adding multiple page features isn't hard.

Nah, it uses a NumericUpDown to grab multiple pages 👍
Thank you for this great tutorial !
Hey bro, thank you so much for your tuto. I've never done programming and I managed to make my first program thanks to you (enjoy the copy past :D )

I managed to do the program with sites like http://pirateproxy.net/
But for some other website I have enough trouble with the href. Torren411 example, the code is
Code
<a href="//www.t411.me/torrents/la-bataille-des-plantes-complet-59-pisodes" title="La bataille des planètes (Complet)(59 épisodes)">La bataille des planètes (Complet)(59 épisodes)&nbsp;<span class="down">(N)</span></a>

i try alot solution but i have an error in the code, either grabbing generates nothing, or I have a generation but it lacks the beginning of EVERY names.

Please for http://www.t411.me what should be put in Dim r As New Regex .... and Dim res As String = m.Value.Split ("" "") (3) ?

Thanks you very much.
Yui Asuna is a scammer he ask me 60$ for make me a program and after I paid he ignore me.
(Jan 19, 2014 03:34 PM)Frøzen Wrote:  It's not a bad tutorial, but that's a very lazy Regex Match pattern, using .* is a very hungry pattern and you can get a lot of undesired responses on pages with a large number of similary matched items.

This is an old tutorial, yeah, the RegEx sucks.

(Jan 20, 2014 01:11 PM)LethalNET Wrote:  Nice and detailed tutorial, Good work psy c:
- Lethal :3

Thanks I guess ? Stop stalking me :c..
Yui Asuna asked me 60$ for build me an custom nameleecher to a site that I decided. Since one week He told me it would do for tomorrows after payment. I sent 60$ and since he does not answer me.
Please, what can I do to make for him is ban for scam? An admin can easily check the mp as evidence.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[.NET] by mnjxOct 16, 2023 04:37 PM 14 2,699 Oct 16, 2023 04:37 PM
Last Post: Local Celeb
[.NET] by fillobottoDec 22, 2021 03:10 AM 32 3,164 Dec 22, 2021 03:10 AM
Last Post: SIM-1729678
[Python] by irenicus09May 13, 2018 05:38 AM 2 452 May 13, 2018 05:38 AM
Last Post: CaloBM