Hello and welcome back to a brand new
video.
And the section of Darko Automation and
using python in this video, we will
access these dark web
links that we have generated in the onion link Automation
in the script the old
script now in the new script, we will access the
websites and get some credit card
leaks.
But you can use the logic that I will write and
anything you want. It's not necessary for
just credit cards. You can take some of the logic
and you can like customize it with the thing
that you want.
But in this scenario, it will be focused on
only to get credit card leaks from
these websites.
The I will create also a function that it
will do this not on only onion sites,
but only on the internet surface websites.
Okay, so let's start.
So here I have.
The everything necessary for the script.
I have the first four
libraries that I need again requests.
To able to communicate with the website and to
get data.
the CSV because I need to save every data we
will find and Excel file or a
for regular expression because when I need
to find credit cards on this websites,
I need to do a regular expression in order
to
get the credit card
number. So we will do regular expression for the credit card
numbers and based on that. We will find them.
As you can see you need to have Tor Browser is on.
And this is a website for like what you
buy clone cards PayPal stuff or City Union?
is also our website so we will automate the
process and we will try to find
from this catchy websites some exposed credit
cards.
So we will use the the file that we generate
from the old script in this script and we
will try to find some credit card statistics exposed.
But first in order to communicate with
dark websites, we need to have torch.
Yes, we have tour browsers on but when we
speak in the language of programming, we need
to have a tour session. We need to let python
use the tors session in order
to communicate with dark web.
Okay.
So this is the function I created Define and
get our session.
So we Define the session.
using the request Library request a session
We save the variable called session and we
Define the session to have a proxy which is a gateway
between us and the dark web and we set
the proxy to our local host
and the port of the tour which
is by default 950 9150
9151.
And then we return the session because we need this value whenever
you need something from the function, you say
return and the variable name you can
copy and paste this because it will be always like that. Nothing will
change.
Okay, so that's for I get to our session.
Let's start with the public test.
Which means the internet surface websites
in this example, it would be on pastebin. Okay,
let me show you.
So these basements as you know, when you
do some awesome stuff, it's also good to
check basement website or any Bates sites
that it can share suspicious information.
So the in this
space spins, we have visas Visa number,
so we will try to to know
if our
method is working. We will try a
small.
a small chunk of sights we will use
just to
so this website and this website, okay.
so we start by defining the
function
first I create the adjects for the credit cards.
This is how it looks like.
This means it will find the credit card numbers.
either Visa Mastercard any type of credit card
So we save it in the variable called pattern.
Then I defined as a list that your also
I need to test.
so I gave it to
then we need to look through them to find some
information.
so for URL and urls
so I Define a
environment and doesn't have any data.
So for you RL and URLs, we
are looping now through these.
We could find that response that I need response to
get the content.
from these websites
Okay. So now the content is rendered in this
variable. Now, we have everything it's the same concept as
the last script.
Okay, and we are matching.
It's the same logic, but here what's the
different?
Sometimes you will face a
decoding issues
Okay.
so in this case
You just type HTML content this data you
have since you're doing regular expression between
the pattern and the content data you have.
So HTML content dot decode we
use the decode function in order to
convert the data into something that
python will accept it. In this case. I use this format.
In other cases. It might be asking it might
be it might be something else. It might
be your tf8. It's a try and error issue.
There's no clear explanation for that to be honest.
And on the end we are outputting if we
find some matches matching numbers on URL.
For much and matches print match. This means it
will print all the matches at find and here we saved
it in an Excel file.
So we open with open.
And we can Define the name of the file mode as append.
Every time it will write new data.
As a file the reference name, so writer create
a variable that were right. So writer
equal and we call the library called
CSV so csv.writer and
the reference of the file.
Then what we will write for much and
matches.
Okay, a writer dot right now and the
match.
as the data and the loop
At saved in this variable. So we write it.
Using the right now function and that's it.
This is the logic will be the same as
when we need to do it on dark web, but the
thing is
What's the different
That we need to define a dark.
Session or a tour session in this case. I just name it
dark session, but you can name it anything you want.
So since we do access the dark web
we need tour and since we created a
function to access store.
So in the public test we use a
normal requests.
This is not a dark web or
session
And the onion web function what I did?
As I called the guitar session and
I saved a session in in a variable.
so
the difference between this function and this
function
We replaced request with dark
session. So dark session dot get the website.
Instead of request so now here it
will be. I'm calling Thor please store
access these websites that I will give you.
And other difference here that we're reading from from
a file since we generated a file
earlier in the last video. So here I
created a data variable that will
read all the data.
From the text file. So a line
let's strip.
we
stripped all the content and then we Loop through
it and read it.
Borderline and open sites the name
of the file as read.
That's the mode.
And then we saved all the data and
variable called urls.
Which is we have it here, but here we have
only a list of the websites but here we have
a much huge list.
This contains a list of all the
file of we generated in
the last video. So
for URL in urls
and the same concept as before, but here I
did some exception handling exception handling mean
You try the code, but if we got an error.
What you will do how you will handle it usually when you
do.
Communicate with our website you might face a connection error.
Okay, so I did try try. I
told python. Please try this.
If it doesn't work, if you have a connection
error, so you type accept the request dot
connection error, and I simply set continue if
you faced any error. Just continue continue to
the next website because sometimes
Not of all, the list of the websites will
work as I told you in the first of the course some
of the onion sites won't work.
So that's why I put this try.
Except exception handling.
logic
And that's it for the whole script. So
let's now test.
Okay, so I started by print connecting tutor
now we Define the session and
saved here.
This print I created the Sprint
to know our new IP address from the
dark session.
Okay.
So let's try the public test.
Let's remove this, okay.
so
Remove this also as a comment. Okay, so
we will run the public test.
So we will need to get all the credit cards
here and the credit cards here.
Let's try it run.
matching numbers
as you can see, we've pulled all the credit card
number and it's working.
Now let's run.
the onion one
Which we generate the links before?
so
But keep in mind this list is very very very long.
So I will only show the
first five or six.
To not make this video super long.
So let's run it.
Connecting the door. This is our new IP
address.
and now
that will try.
And connect to the onion links.
Keep in mind this things take some time.
especially that tour
isn't like the normal browser.
So it will take time to access each website.
So we have some credit cards from this onion website as you can
see a menu something like that.
We have some credit cards that are exposed.
Now it will check some matching numbers on the other website so
far nothing on this so it
found on the first one the second one more the third one. No.
fourth no
also know
Okay. So as I said, the list is
very long, but we do now we do know that
our script is working and that's what's matters
and you can use the logic as
I said and other things that you want, but it
will difference in another and and depends
on the scenario you're writing and the
scenario as I said that was for credit card. So there was a
pattern.
Or credit card numbers, but you can do keywords and
other type of keywords you just manipulate
some small stuff and this.
and this script
and I will see you in the next video where
we will do our
telegram board a small one.
So see you on the next video. Thank you.