WEBVTT - This file was automatically generated by VIMEO

0
00:00:07.400 --> 00:00:10.300
Hello and welcome back to a brand new

1
00:00:10.300 --> 00:00:10.500
 video.

2
00:00:11.300 --> 00:00:14.600
And the section of Darko Automation and

3
00:00:14.600 --> 00:00:17.200
 using python in this video, we will

4
00:00:17.200 --> 00:00:20.500
 access these dark web

5
00:00:20.500 --> 00:00:24.700
 links that we have generated in the onion link Automation

6
00:00:23.700 --> 00:00:26.600
 in the script the old

7
00:00:26.600 --> 00:00:29.700
 script now in the new script, we will access the

8
00:00:29.700 --> 00:00:32.500
 websites and get some credit card

9
00:00:32.500 --> 00:00:33.100
 leaks.

10
00:00:34.200 --> 00:00:37.600
But you can use the logic that I will write and

11
00:00:37.600 --> 00:00:40.900
 anything you want. It's not necessary for

12
00:00:40.900 --> 00:00:43.500
 just credit cards. You can take some of the logic

13
00:00:43.500 --> 00:00:46.300
 and you can like customize it with the thing

14
00:00:46.300 --> 00:00:46.700
 that you want.

15
00:00:47.900 --> 00:00:50.100
But in this scenario, it will be focused on

16
00:00:50.100 --> 00:00:54.300
 only to get credit card leaks from

17
00:00:54.300 --> 00:00:56.500
 these websites.

18
00:00:58.300 --> 00:01:01.600
The I will create also a function that it

19
00:01:01.600 --> 00:01:05.700
 will do this not on only onion sites,

20
00:01:05.700 --> 00:01:08.400
 but only on the internet surface websites.

21
00:01:09.700 --> 00:01:10.600
Okay, so let's start.

22
00:01:11.800 --> 00:01:13.000
So here I have.

23
00:01:14.600 --> 00:01:17.600
The everything necessary for the script.

24
00:01:17.600 --> 00:01:20.600
 I have the first four

25
00:01:20.600 --> 00:01:23.400
 libraries that I need again requests.

26
00:01:24.200 --> 00:01:27.400
To able to communicate with the website and to

27
00:01:27.400 --> 00:01:27.600
 get data.

28
00:01:28.400 --> 00:01:31.400
the CSV because I need to save every data we

29
00:01:31.400 --> 00:01:34.500
 will find and Excel file or a

30
00:01:34.500 --> 00:01:38.000
 for regular expression because when I need

31
00:01:37.600 --> 00:01:40.600
 to find credit cards on this websites,

32
00:01:40.600 --> 00:01:43.500
 I need to do a regular expression in order

33
00:01:43.500 --> 00:01:43.700
 to

34
00:01:44.900 --> 00:01:47.400
get the credit card

35
00:01:47.400 --> 00:01:50.300
 number. So we will do regular expression for the credit card

36
00:01:50.300 --> 00:01:52.300
 numbers and based on that. We will find them.

37
00:01:53.200 --> 00:01:56.500
As you can see you need to have Tor Browser is on.

38
00:01:57.700 --> 00:02:00.400
And this is a website for like what you

39
00:02:00.400 --> 00:02:03.300
 buy clone cards PayPal stuff or City Union?

40
00:02:04.500 --> 00:02:07.200
is also our website so we will automate the

41
00:02:07.200 --> 00:02:08.700
 process and we will try to find

42
00:02:09.700 --> 00:02:12.900
from this catchy websites some exposed credit

43
00:02:12.900 --> 00:02:13.300
 cards.

44
00:02:14.400 --> 00:02:17.500
So we will use the the file that we generate

45
00:02:17.500 --> 00:02:20.600
 from the old script in this script and we

46
00:02:20.600 --> 00:02:23.700
 will try to find some credit card statistics exposed.

47
00:02:25.500 --> 00:02:29.100
But first in order to communicate with

48
00:02:29.100 --> 00:02:32.200
 dark websites, we need to have torch.

49
00:02:33.100 --> 00:02:36.600
Yes, we have tour browsers on but when we

50
00:02:36.600 --> 00:02:39.300
 speak in the language of programming, we need

51
00:02:39.300 --> 00:02:43.400
 to have a tour session. We need to let python

52
00:02:42.400 --> 00:02:45.600
 use the tors session in order

53
00:02:45.600 --> 00:02:46.900
 to communicate with dark web.

54
00:02:48.000 --> 00:02:48.300
Okay.

55
00:02:49.600 --> 00:02:53.000
So this is the function I created Define and

56
00:02:52.200 --> 00:02:54.000
 get our session.

57
00:02:55.200 --> 00:02:56.600
So we Define the session.

58
00:02:58.400 --> 00:03:00.600
using the request Library request a session

59
00:03:02.400 --> 00:03:05.400
We save the variable called session and we

60
00:03:05.400 --> 00:03:08.700
 Define the session to have a proxy which is a gateway

61
00:03:08.700 --> 00:03:11.200
 between us and the dark web and we set

62
00:03:11.200 --> 00:03:14.700
 the proxy to our local host

63
00:03:14.700 --> 00:03:17.600
 and the port of the tour which

64
00:03:17.600 --> 00:03:21.700
 is by default 950 9150

65
00:03:20.700 --> 00:03:22.900
 9151.

66
00:03:25.200 --> 00:03:29.000
And then we return the session because we need this value whenever

67
00:03:28.300 --> 00:03:31.400
 you need something from the function, you say

68
00:03:31.400 --> 00:03:34.100
 return and the variable name you can

69
00:03:34.100 --> 00:03:37.700
 copy and paste this because it will be always like that. Nothing will

70
00:03:37.700 --> 00:03:38.000
 change.

71
00:03:40.100 --> 00:03:42.900
Okay, so that's for I get to our session.

72
00:03:43.900 --> 00:03:45.700
Let's start with the public test.

73
00:03:46.800 --> 00:03:49.800
Which means the internet surface websites

74
00:03:49.800 --> 00:03:53.100
 in this example, it would be on pastebin. Okay,

75
00:03:52.100 --> 00:03:53.700
 let me show you.

76
00:03:55.400 --> 00:03:58.600
So these basements as you know, when you

77
00:03:58.600 --> 00:04:01.300
 do some awesome stuff, it's also good to

78
00:04:01.300 --> 00:04:05.300
 check basement website or any Bates sites

79
00:04:04.300 --> 00:04:08.600
 that it can share suspicious information.

80
00:04:07.600 --> 00:04:10.400
 So the in this

81
00:04:10.400 --> 00:04:13.400
 space spins, we have visas Visa number,

82
00:04:13.400 --> 00:04:16.900
 so we will try to to know

83
00:04:16.900 --> 00:04:17.400
 if our

84
00:04:18.100 --> 00:04:21.900
method is working. We will try a

85
00:04:21.900 --> 00:04:22.200
 small.

86
00:04:23.500 --> 00:04:26.200
a small chunk of sights we will use

87
00:04:26.200 --> 00:04:26.900
 just to

88
00:04:28.400 --> 00:04:31.000
so this website and this website, okay.

89
00:04:32.400 --> 00:04:34.300
so we start by defining the

90
00:04:35.300 --> 00:04:36.000
function

91
00:04:37.500 --> 00:04:40.400
first I create the adjects for the credit cards.

92
00:04:40.400 --> 00:04:41.400
 This is how it looks like.

93
00:04:42.400 --> 00:04:44.700
This means it will find the credit card numbers.

94
00:04:46.300 --> 00:04:49.800
either Visa Mastercard any type of credit card

95
00:04:51.900 --> 00:04:54.200
So we save it in the variable called pattern.

96
00:04:55.100 --> 00:04:58.300
Then I defined as a list that your also

97
00:04:58.300 --> 00:04:58.700
 I need to test.

98
00:05:00.700 --> 00:05:01.800
so I gave it to

99
00:05:03.800 --> 00:05:06.300
then we need to look through them to find some

100
00:05:06.300 --> 00:05:06.600
 information.

101
00:05:07.600 --> 00:05:10.400
so for URL and urls

102
00:05:11.500 --> 00:05:12.600
so I Define a

103
00:05:15.400 --> 00:05:17.600
environment and doesn't have any data.

104
00:05:18.700 --> 00:05:22.200
So for you RL and URLs, we

105
00:05:21.200 --> 00:05:23.600
 are looping now through these.

106
00:05:25.800 --> 00:05:29.300
We could find that response that I need response to

107
00:05:28.300 --> 00:05:30.100
 get the content.

108
00:05:32.200 --> 00:05:33.400
from these websites

109
00:05:35.100 --> 00:05:38.200
Okay. So now the content is rendered in this

110
00:05:38.200 --> 00:05:41.700
 variable. Now, we have everything it's the same concept as

111
00:05:41.700 --> 00:05:42.600
 the last script.

112
00:05:43.700 --> 00:05:45.000
Okay, and we are matching.

113
00:05:46.200 --> 00:05:49.200
It's the same logic, but here what's the

114
00:05:49.200 --> 00:05:49.500
 different?

115
00:05:50.500 --> 00:05:52.600
Sometimes you will face a

116
00:05:53.800 --> 00:05:54.900
decoding issues

117
00:05:56.100 --> 00:05:56.400
Okay.

118
00:05:57.200 --> 00:05:59.100
so in this case

119
00:06:00.100 --> 00:06:03.300
You just type HTML content this data you

120
00:06:03.300 --> 00:06:06.600
 have since you're doing regular expression between

121
00:06:06.600 --> 00:06:08.900
 the pattern and the content data you have.

122
00:06:09.800 --> 00:06:13.000
So HTML content dot decode we

123
00:06:12.300 --> 00:06:15.200
 use the decode function in order to

124
00:06:15.200 --> 00:06:18.400
 convert the data into something that

125
00:06:18.400 --> 00:06:21.600
 python will accept it. In this case. I use this format.

126
00:06:21.600 --> 00:06:24.500
 In other cases. It might be asking it might

127
00:06:24.500 --> 00:06:27.500
 be it might be something else. It might

128
00:06:27.500 --> 00:06:30.200
 be your tf8. It's a try and error issue.

129
00:06:30.200 --> 00:06:32.600
 There's no clear explanation for that to be honest.

130
00:06:34.900 --> 00:06:37.600
And on the end we are outputting if we

131
00:06:37.600 --> 00:06:40.800
 find some matches matching numbers on URL.

132
00:06:42.300 --> 00:06:45.100
For much and matches print match. This means it

133
00:06:45.100 --> 00:06:48.600
 will print all the matches at find and here we saved

134
00:06:48.600 --> 00:06:49.900
 it in an Excel file.

135
00:06:50.600 --> 00:06:53.400
So we open with open.

136
00:06:54.200 --> 00:06:57.700
And we can Define the name of the file mode as append.

137
00:06:58.300 --> 00:07:01.500
Every time it will write new data.

138
00:07:02.200 --> 00:07:06.300
As a file the reference name, so writer create

139
00:07:05.300 --> 00:07:08.900
 a variable that were right. So writer

140
00:07:08.900 --> 00:07:11.400
 equal and we call the library called

141
00:07:11.400 --> 00:07:14.600
 CSV so csv.writer and

142
00:07:14.600 --> 00:07:15.800
 the reference of the file.

143
00:07:17.500 --> 00:07:20.500
Then what we will write for much and

144
00:07:20.500 --> 00:07:20.700
 matches.

145
00:07:22.700 --> 00:07:26.000
Okay, a writer dot right now and the

146
00:07:25.000 --> 00:07:26.200
 match.

147
00:07:27.600 --> 00:07:30.000
as the data and the loop

148
00:07:31.300 --> 00:07:34.200
At saved in this variable. So we write it.

149
00:07:35.200 --> 00:07:37.600
Using the right now function and that's it.

150
00:07:38.600 --> 00:07:40.800
This is the logic will be the same as

151
00:07:41.800 --> 00:07:44.600
when we need to do it on dark web, but the

152
00:07:44.600 --> 00:07:44.900
 thing is

153
00:07:45.900 --> 00:07:46.700
What's the different

154
00:07:48.800 --> 00:07:51.500
That we need to define a dark.

155
00:07:52.100 --> 00:07:55.200
Session or a tour session in this case. I just name it

156
00:07:55.200 --> 00:07:57.000
 dark session, but you can name it anything you want.

157
00:07:57.900 --> 00:08:00.300
So since we do access the dark web

158
00:08:00.300 --> 00:08:03.600
 we need tour and since we created a

159
00:08:03.600 --> 00:08:05.100
 function to access store.

160
00:08:06.400 --> 00:08:10.100
So in the public test we use a

161
00:08:09.100 --> 00:08:11.000
 normal requests.

162
00:08:11.600 --> 00:08:13.300
This is not a dark web or

163
00:08:14.400 --> 00:08:14.800
session

164
00:08:15.700 --> 00:08:18.400
And the onion web function what I did?

165
00:08:19.400 --> 00:08:22.400
As I called the guitar session and

166
00:08:22.400 --> 00:08:24.600
 I saved a session in in a variable.

167
00:08:25.600 --> 00:08:25.900
so

168
00:08:27.300 --> 00:08:30.500
the difference between this function and this

169
00:08:30.500 --> 00:08:30.600
 function

170
00:08:31.800 --> 00:08:34.400
We replaced request with dark

171
00:08:34.400 --> 00:08:36.900
 session. So dark session dot get the website.

172
00:08:37.500 --> 00:08:40.900
Instead of request so now here it

173
00:08:40.900 --> 00:08:44.000
 will be. I'm calling Thor please store

174
00:08:43.400 --> 00:08:46.000
 access these websites that I will give you.

175
00:08:47.100 --> 00:08:51.300
And other difference here that we're reading from from

176
00:08:50.300 --> 00:08:53.600
 a file since we generated a file

177
00:08:53.600 --> 00:08:56.200
 earlier in the last video. So here I

178
00:08:56.200 --> 00:08:59.200
 created a data variable that will

179
00:08:59.200 --> 00:09:01.200
 read all the data.

180
00:09:02.700 --> 00:09:05.100
From the text file. So a line

181
00:09:05.100 --> 00:09:05.600
 let's strip.

182
00:09:06.300 --> 00:09:06.500
we

183
00:09:08.100 --> 00:09:11.400
stripped all the content and then we Loop through

184
00:09:11.400 --> 00:09:12.700
 it and read it.

185
00:09:13.600 --> 00:09:16.100
Borderline and open sites the name

186
00:09:16.100 --> 00:09:17.100
 of the file as read.

187
00:09:18.300 --> 00:09:18.900
That's the mode.

188
00:09:20.600 --> 00:09:23.400
And then we saved all the data and

189
00:09:23.400 --> 00:09:25.100
 variable called urls.

190
00:09:25.900 --> 00:09:28.200
Which is we have it here, but here we have

191
00:09:28.200 --> 00:09:31.300
 only a list of the websites but here we have

192
00:09:31.300 --> 00:09:33.600
 a much huge list.

193
00:09:34.900 --> 00:09:37.800
This contains a list of all the

194
00:09:37.800 --> 00:09:40.700
 file of we generated in

195
00:09:40.700 --> 00:09:42.000
 the last video. So

196
00:09:42.900 --> 00:09:44.900
for URL in urls

197
00:09:46.300 --> 00:09:49.300
and the same concept as before, but here I

198
00:09:49.300 --> 00:09:52.300
 did some exception handling exception handling mean

199
00:09:54.200 --> 00:09:57.100
You try the code, but if we got an error.

200
00:09:58.300 --> 00:10:01.600
What you will do how you will handle it usually when you

201
00:10:01.600 --> 00:10:01.800
 do.

202
00:10:02.700 --> 00:10:05.700
Communicate with our website you might face a connection error.

203
00:10:06.500 --> 00:10:10.000
Okay, so I did try try. I

204
00:10:09.600 --> 00:10:11.800
 told python. Please try this.

205
00:10:12.600 --> 00:10:15.600
If it doesn't work, if you have a connection

206
00:10:15.600 --> 00:10:18.700
 error, so you type accept the request dot

207
00:10:18.700 --> 00:10:21.400
 connection error, and I simply set continue if

208
00:10:21.400 --> 00:10:24.700
 you faced any error. Just continue continue to

209
00:10:24.700 --> 00:10:26.200
 the next website because sometimes

210
00:10:26.900 --> 00:10:29.400
Not of all, the list of the websites will

211
00:10:29.400 --> 00:10:33.100
 work as I told you in the first of the course some

212
00:10:32.100 --> 00:10:34.500
 of the onion sites won't work.

213
00:10:35.700 --> 00:10:37.300
So that's why I put this try.

214
00:10:38.100 --> 00:10:40.300
Except exception handling.

215
00:10:42.900 --> 00:10:43.500
logic

216
00:10:44.900 --> 00:10:47.300
And that's it for the whole script. So

217
00:10:47.300 --> 00:10:48.100
 let's now test.

218
00:10:49.700 --> 00:10:52.800
Okay, so I started by print connecting tutor

219
00:10:52.800 --> 00:10:55.200
 now we Define the session and

220
00:10:55.200 --> 00:10:56.100
 saved here.

221
00:10:57.200 --> 00:11:00.400
This print I created the Sprint

222
00:11:00.400 --> 00:11:04.200
 to know our new IP address from the

223
00:11:03.200 --> 00:11:04.600
 dark session.

224
00:11:05.700 --> 00:11:06.100
Okay.

225
00:11:07.800 --> 00:11:10.200
So let's try the public test.

226
00:11:11.800 --> 00:11:13.700
Let's remove this, okay.

227
00:11:14.900 --> 00:11:15.100
so

228
00:11:16.400 --> 00:11:19.400
Remove this also as a comment. Okay, so

229
00:11:19.400 --> 00:11:20.900
 we will run the public test.

230
00:11:22.600 --> 00:11:25.500
So we will need to get all the credit cards

231
00:11:25.500 --> 00:11:26.900
 here and the credit cards here.

232
00:11:27.800 --> 00:11:29.300
Let's try it run.

233
00:11:31.500 --> 00:11:32.400
matching numbers

234
00:11:33.300 --> 00:11:36.300
as you can see, we've pulled all the credit card

235
00:11:36.300 --> 00:11:37.200
 number and it's working.

236
00:11:41.700 --> 00:11:43.000
Now let's run.

237
00:11:44.200 --> 00:11:45.800
the onion one

238
00:11:47.300 --> 00:11:48.900
Which we generate the links before?

239
00:11:56.500 --> 00:11:56.600
so

240
00:11:58.400 --> 00:12:01.600
But keep in mind this list is very very very long.

241
00:12:02.800 --> 00:12:05.500
So I will only show the

242
00:12:05.500 --> 00:12:06.700
 first five or six.

243
00:12:07.600 --> 00:12:10.300
To not make this video super long.

244
00:12:11.700 --> 00:12:12.900
So let's run it.

245
00:12:13.900 --> 00:12:16.600
Connecting the door. This is our new IP

246
00:12:16.600 --> 00:12:16.800
 address.

247
00:12:23.300 --> 00:12:23.900
and now

248
00:12:25.500 --> 00:12:26.100
that will try.

249
00:12:29.300 --> 00:12:32.200
And connect to the onion links.

250
00:12:33.600 --> 00:12:36.200
Keep in mind this things take some time.

251
00:12:37.500 --> 00:12:38.800
especially that tour

252
00:12:39.600 --> 00:12:43.100
isn't like the normal browser.

253
00:12:42.100 --> 00:12:45.300
 So it will take time to access each website.

254
00:12:47.200 --> 00:12:50.000
So we have some credit cards from this onion website as you can

255
00:12:50.200 --> 00:12:52.400
 see a menu something like that.

256
00:12:53.200 --> 00:12:55.500
We have some credit cards that are exposed.

257
00:12:57.100 --> 00:13:00.800
Now it will check some matching numbers on the other website so

258
00:13:00.800 --> 00:13:03.600
 far nothing on this so it

259
00:13:03.600 --> 00:13:06.300
 found on the first one the second one more the third one. No.

260
00:13:09.900 --> 00:13:10.700
fourth no

261
00:13:18.400 --> 00:13:19.000
also know

262
00:13:20.500 --> 00:13:23.200
Okay. So as I said, the list is

263
00:13:23.200 --> 00:13:26.500
 very long, but we do now we do know that

264
00:13:26.500 --> 00:13:29.400
 our script is working and that's what's matters

265
00:13:29.400 --> 00:13:32.300
 and you can use the logic as

266
00:13:32.300 --> 00:13:35.600
 I said and other things that you want, but it

267
00:13:35.600 --> 00:13:39.200
 will difference in another and and depends

268
00:13:38.200 --> 00:13:41.600
 on the scenario you're writing and the

269
00:13:41.600 --> 00:13:44.400
 scenario as I said that was for credit card. So there was a

270
00:13:44.400 --> 00:13:44.700
 pattern.

271
00:13:45.500 --> 00:13:48.800
Or credit card numbers, but you can do keywords and

272
00:13:48.800 --> 00:13:51.600
 other type of keywords you just manipulate

273
00:13:51.600 --> 00:13:53.300
 some small stuff and this.

274
00:13:54.800 --> 00:13:56.100
and this script

275
00:13:57.400 --> 00:14:00.700
and I will see you in the next video where

276
00:14:00.700 --> 00:14:02.100
 we will do our

277
00:14:04.700 --> 00:14:06.800
telegram board a small one.

278
00:14:08.300 --> 00:14:10.300
So see you on the next video. Thank you.
