WEBVTT - This file was automatically generated by VIMEO

0
00:00:07.100 --> 00:00:10.700
In this video, you will learn how to create malicious shellcode for

1
00:00:10.700 --> 00:00:13.200
 root access. I hope you're excited.

2
00:00:13.200 --> 00:00:14.800
 So let's dive on in.

3
00:00:16.200 --> 00:00:19.700
Our previous video we will be able to discover the point

4
00:00:19.700 --> 00:00:22.800
 address that will allow us to jump to the EIP

5
00:00:22.800 --> 00:00:23.400
 register.

6
00:00:24.100 --> 00:00:27.200
So now let's test to see what this is working

7
00:00:27.200 --> 00:00:27.900
 for us.

8
00:00:29.100 --> 00:00:31.800
Let's run fall silver like so

9
00:00:32.600 --> 00:00:34.400
with administrative privileges

10
00:00:36.400 --> 00:00:39.800
next let's run immunity debugger with

11
00:00:39.800 --> 00:00:42.400
 administrator privileges and then

12
00:00:42.400 --> 00:00:45.600
 we will attach the valve application inside of

13
00:00:45.600 --> 00:00:46.300
 immunity.

14
00:00:47.400 --> 00:00:48.400
Let's click on file.

15
00:00:49.200 --> 00:00:50.400
attach

16
00:00:51.400 --> 00:00:55.100
select a valuable processo application and select

17
00:00:54.100 --> 00:00:55.400
 attach

18
00:00:56.500 --> 00:00:59.600
Before you click on Play click on this icon

19
00:00:59.600 --> 00:01:02.500
 like so and simply enter

20
00:01:02.500 --> 00:01:05.500
 the pointer address, which we have found in our previous

21
00:01:05.500 --> 00:01:08.200
 video like so and click on

22
00:01:08.200 --> 00:01:08.700
 Okie.

23
00:01:09.700 --> 00:01:12.900
As you can see the pointer dress followed

24
00:01:12.900 --> 00:01:16.300
 by the hexadecimal value specifies that

25
00:01:16.300 --> 00:01:19.300
 it will jump us to the ESP register.

26
00:01:20.100 --> 00:01:23.800
Simply press f2 to set a breakpoint

27
00:01:23.800 --> 00:01:24.600
 create.

28
00:01:27.600 --> 00:01:30.400
Now the breakpoint is set. Let's head over

29
00:01:30.400 --> 00:01:34.000
 back to our cardi lungs virtual machine to modify

30
00:01:33.600 --> 00:01:35.200
 our script.

31
00:01:40.500 --> 00:01:42.400
Let's click on the text editor.

32
00:01:43.400 --> 00:01:46.700
Let's click on file. Let's click

33
00:01:46.700 --> 00:01:47.400
 on open.

34
00:01:48.300 --> 00:01:51.500
And let's select fuzzle.py like

35
00:01:51.500 --> 00:01:53.100
 so click on one.

36
00:01:57.000 --> 00:01:57.400
Great.

37
00:01:58.500 --> 00:01:59.600
Let's click on file.

38
00:02:01.100 --> 00:02:05.200
Save us. Let's call this first 5.py.

39
00:02:06.400 --> 00:02:07.300
And save it.

40
00:02:08.400 --> 00:02:11.300
let's delete our bad character variable

41
00:02:11.300 --> 00:02:12.200
 like so

42
00:02:16.500 --> 00:02:19.300
I'll let some modify our Shell Code variable.

43
00:02:20.800 --> 00:02:23.300
We are keeping all of our ease like so

44
00:02:24.200 --> 00:02:26.700
however, we are going to insert.

45
00:02:27.500 --> 00:02:30.200
Our pointer dress. However, we need

46
00:02:30.200 --> 00:02:32.900
 to insert our pointer dress in the reverse order.

47
00:02:34.400 --> 00:02:37.600
To do this. We'll open and close quotation marks.

48
00:02:38.300 --> 00:02:41.300
between these quotation marks, we will simply

49
00:02:42.200 --> 00:02:43.000
insert

50
00:02:44.400 --> 00:02:45.300
slash X

51
00:02:46.300 --> 00:02:48.200
AF slash X

52
00:02:49.700 --> 00:02:51.700
1 1 / X

53
00:02:53.100 --> 00:02:55.400
50 / X

54
00:02:56.900 --> 00:02:57.500
62

55
00:02:59.700 --> 00:03:02.300
last one at least we will bite and code

56
00:03:02.300 --> 00:03:04.600
 our ease manually like so

57
00:03:05.900 --> 00:03:07.400
will also bite in code.

58
00:03:08.200 --> 00:03:09.400
our pointer dress

59
00:03:10.100 --> 00:03:12.400
will byte and code our payload.

60
00:03:13.600 --> 00:03:16.300
And we will remove the encoding feature from

61
00:03:16.300 --> 00:03:17.100
 line 13.

62
00:03:18.200 --> 00:03:18.500
like so

63
00:03:19.400 --> 00:03:20.600
simply click on file

64
00:03:21.500 --> 00:03:24.800
And click on Save great.

65
00:03:26.200 --> 00:03:28.000
Let's head over back to immunity.

66
00:03:28.900 --> 00:03:29.600
Let's close.

67
00:03:31.300 --> 00:03:32.900
Let's meet us on executable.

68
00:03:33.900 --> 00:03:34.700
We'll call this.

69
00:03:35.900 --> 00:03:37.500
files 5.py

70
00:03:38.300 --> 00:03:38.700
create

71
00:03:43.500 --> 00:03:46.000
back on immunity debugger. Let's click on play.

72
00:03:47.600 --> 00:03:49.400
Now our application is running.

73
00:03:52.100 --> 00:03:53.700
Let's open Kali Linux.

74
00:03:54.600 --> 00:03:57.900
And let's execute the fuzz 5.py script.

75
00:03:58.700 --> 00:03:59.800
We'll type python.

76
00:04:00.800 --> 00:04:03.500
fuzz5.py and hit

77
00:04:03.500 --> 00:04:03.600
 enter

78
00:04:04.800 --> 00:04:07.700
Oh, I forgot to click play on immunity debugger.

79
00:04:13.300 --> 00:04:15.600
Let me restart alsoever like so

80
00:04:19.500 --> 00:04:21.500
I'll reattach it to immunity debugger.

81
00:04:27.900 --> 00:04:29.700
I will set the breakpoint once more.

82
00:04:30.900 --> 00:04:32.200
And I'm going to click on play.

83
00:04:32.800 --> 00:04:33.100
create

84
00:04:36.400 --> 00:04:39.600
one Kali Lennox. I'm going to execute a false

85
00:04:39.600 --> 00:04:41.000
 5 python script once more.

86
00:04:42.300 --> 00:04:46.000
And notice the breakpoint has reached the

87
00:04:45.300 --> 00:04:47.100
 application has post.

88
00:04:47.900 --> 00:04:50.600
Looking closely at the

89
00:04:50.600 --> 00:04:53.200
 register we can see the pointer address

90
00:04:53.200 --> 00:04:56.500
 is now inserted within the EIP register.

91
00:04:57.200 --> 00:04:58.700
And it also indicated.

92
00:04:59.500 --> 00:05:01.900
the ESS funk

93
00:05:02.600 --> 00:05:03.100
Great.

94
00:05:04.200 --> 00:05:09.100
So this means that we are able to actually overwrite

95
00:05:07.100 --> 00:05:11.000
 to the EIP register.

96
00:05:11.900 --> 00:05:14.200
The next step is simply to generate a

97
00:05:14.200 --> 00:05:17.800
 shell code on takeover the Windows

98
00:05:17.800 --> 00:05:20.200
 operating system and gain root or

99
00:05:20.200 --> 00:05:21.400
 administrative privileges.

100
00:05:23.600 --> 00:05:26.700
So let's close immunity debugger. Let's head

101
00:05:26.700 --> 00:05:28.700
 over back to our Kali Lux virtual machine.

102
00:05:29.600 --> 00:05:30.200
like so

103
00:05:32.200 --> 00:05:35.500
and this time we are going to generate a Shell Code

104
00:05:35.500 --> 00:05:38.000
 using msf Venom.

105
00:05:39.200 --> 00:05:42.000
Let's type. Msf. Venom like so

106
00:05:46.500 --> 00:05:47.200
we'll type - p

107
00:05:47.900 --> 00:05:48.800
let's specify.

108
00:05:49.700 --> 00:05:52.900
the windows shell underscore reverse

109
00:05:52.900 --> 00:05:54.300
 underscore TCP

110
00:05:55.300 --> 00:05:58.400
will also specify our lhost IP address.

111
00:05:59.200 --> 00:05:59.600
like so

112
00:06:00.600 --> 00:06:03.100
followed by our port number that we listen

113
00:06:03.100 --> 00:06:04.300
 for an incoming connection.

114
00:06:05.600 --> 00:06:08.600
We will also specify the exit function which

115
00:06:08.600 --> 00:06:09.200
 is red.

116
00:06:10.500 --> 00:06:12.500
The output format I see.

117
00:06:13.400 --> 00:06:15.400
the architecture for x86

118
00:06:16.100 --> 00:06:19.600
and dash be will specify any bad characters.

119
00:06:22.300 --> 00:06:23.200
once you all set

120
00:06:25.100 --> 00:06:28.400
Simply hit enter. This will take a few seconds and

121
00:06:28.400 --> 00:06:30.400
 generate the shell good for us.

122
00:06:39.300 --> 00:06:43.000
Not a shell could generated simply copy all the

123
00:06:42.200 --> 00:06:44.100
 shell good like so.

124
00:06:48.200 --> 00:06:48.600
Great.

125
00:06:49.600 --> 00:06:51.300
Let's open our text editor.

126
00:06:52.100 --> 00:06:54.900
Let's open our most recent fuzz file.

127
00:06:55.400 --> 00:06:57.500
Which is fuzz 5.py.

128
00:06:58.700 --> 00:07:00.700
Let's create a new copy of it.

129
00:07:01.400 --> 00:07:03.000
Let's call this file 6.

130
00:07:04.200 --> 00:07:05.400
Let's click on save as

131
00:07:06.200 --> 00:07:08.700
let's call it file 6.pui.

132
00:07:10.100 --> 00:07:10.800
click on Save

133
00:07:11.400 --> 00:07:11.600
create

134
00:07:16.100 --> 00:07:17.000
with this grip

135
00:07:17.600 --> 00:07:20.400
Let's insert a new variable.

136
00:07:21.300 --> 00:07:23.500
Let's call this overflow like so.

137
00:07:24.500 --> 00:07:25.100
equals

138
00:07:26.600 --> 00:07:29.400
Let's Open brackets and close

139
00:07:29.400 --> 00:07:32.900
 brackets between these brackets will piece our

140
00:07:32.900 --> 00:07:34.200
 shell good like so

141
00:07:36.400 --> 00:07:38.900
then we'll manually byton code each line.

142
00:07:41.600 --> 00:07:44.300
Great. So now that each line of the

143
00:07:44.300 --> 00:07:47.600
 Overflow is actually manually byte encoded. Let's

144
00:07:47.600 --> 00:07:49.900
 modify our Shell Code variable.

145
00:07:50.900 --> 00:07:53.000
Our ears are still biting coded.

146
00:07:54.600 --> 00:07:56.900
The pointer dresses byte encoded as well.

147
00:07:57.600 --> 00:08:00.600
But let's add in some potting manually.

148
00:08:04.500 --> 00:08:08.400
Let's type slash X 90. Let's

149
00:08:07.400 --> 00:08:10.700
 ensued. Let's say about 16

150
00:08:10.700 --> 00:08:11.100
 of these.

151
00:08:12.200 --> 00:08:14.800
We'll also tighten code or padding.

152
00:08:15.700 --> 00:08:18.700
The padding is simply no operations. It's simply

153
00:08:18.700 --> 00:08:21.300
 adds on some space before we can

154
00:08:21.300 --> 00:08:23.200
 actually inject overflow.

155
00:08:24.200 --> 00:08:28.000
To specify all overflow. Let's put plus overflow

156
00:08:27.300 --> 00:08:28.900
 to call the variable.

157
00:08:29.700 --> 00:08:31.900
Once you're all set simply click on file.

158
00:08:32.900 --> 00:08:33.900
and see if

159
00:08:34.600 --> 00:08:35.400
let's close this.

160
00:08:36.300 --> 00:08:36.600
Great.

161
00:08:37.900 --> 00:08:40.700
Let's make five six executable. We'll

162
00:08:40.700 --> 00:08:41.600
 do chmod.

163
00:08:42.100 --> 00:08:45.700
Plus X Plus 6.py. Excellent

164
00:08:51.800 --> 00:08:54.100
One of the problems I had was every time

165
00:08:54.100 --> 00:08:57.800
 I generated a new set of Shell Code using the same

166
00:08:57.800 --> 00:08:59.000
 msf. And I'm command.

167
00:08:59.900 --> 00:09:02.200
The Shell Code the output was a bit

168
00:09:02.200 --> 00:09:05.400
 different for some reason. I was not able to actually get

169
00:09:05.400 --> 00:09:08.500
 the review shell. I'm not sure why but if

170
00:09:08.500 --> 00:09:09.900
 you regenerate

171
00:09:11.100 --> 00:09:14.400
The shell called multiple times you'll see that you are

172
00:09:14.400 --> 00:09:17.000
 getting different iterations of visions of it.

173
00:09:17.700 --> 00:09:20.500
However, after a few tries, I was

174
00:09:20.500 --> 00:09:22.900
 able to get a version that works very well for me.

175
00:09:24.900 --> 00:09:27.400
If I open the text editor

176
00:09:27.400 --> 00:09:30.600
 this is evolutional shell who that works

177
00:09:30.600 --> 00:09:31.800
 perfectly on my system.

178
00:09:32.500 --> 00:09:35.200
So if you don't get it on a first try you might have to

179
00:09:35.200 --> 00:09:38.400
 generate a Shell Code a few times and try different

180
00:09:38.400 --> 00:09:38.800
 versions.

181
00:09:39.800 --> 00:09:42.300
As you can see the Shell Code it

182
00:09:42.300 --> 00:09:43.800
 is still place within the Overflow.

183
00:09:44.500 --> 00:09:46.800
On each line is byte included.

184
00:09:47.900 --> 00:09:50.500
That's the only difference from the previous school that

185
00:09:50.500 --> 00:09:52.800
 I have executed just a few seconds ago.

186
00:09:53.600 --> 00:09:56.400
With a previous code we used the same syntax, but

187
00:09:56.400 --> 00:09:59.900
 it did not work. However, I regenerated a

188
00:09:59.900 --> 00:10:02.300
 few more and this one actually works for me.

189
00:10:03.200 --> 00:10:04.400
So I'm going to click on file.

190
00:10:05.500 --> 00:10:07.000
I'm gonna click on Save.

191
00:10:08.400 --> 00:10:08.700
next

192
00:10:09.900 --> 00:10:11.000
I'm going to start.

193
00:10:12.300 --> 00:10:13.800
the net cutlets now once more

194
00:10:18.400 --> 00:10:20.900
I'm gonna type NC -nlvp.

195
00:10:21.600 --> 00:10:22.500
for for

196
00:10:24.400 --> 00:10:25.000
Hit enter.

197
00:10:25.900 --> 00:10:27.800
I'm also going to open a new tab.

198
00:10:28.800 --> 00:10:31.800
So I can execute the python

199
00:10:31.800 --> 00:10:34.400
 6 fuzzgrip, but before

200
00:10:34.400 --> 00:10:37.600
 I do so, I'm gonna head over to my Windows machine.

201
00:10:39.100 --> 00:10:43.200
I'm going to launch the valve application. Azus.

202
00:10:44.200 --> 00:10:44.700
create

203
00:10:46.800 --> 00:10:49.000
gonna head over back to khalila Knox.

204
00:10:50.200 --> 00:10:50.600
and currently

205
00:10:53.300 --> 00:10:56.600
we can see the net cut listener is listening for

206
00:10:56.600 --> 00:10:57.500
 an incoming connection.

207
00:10:58.600 --> 00:11:02.400
and now I'm going to execute the Python 3

208
00:11:01.400 --> 00:11:05.200
 fuzz6.py command

209
00:11:04.200 --> 00:11:05.500
 like so

210
00:11:07.300 --> 00:11:08.500
the script executed

211
00:11:09.400 --> 00:11:12.600
and on a Windows machine it shows waiting for

212
00:11:12.600 --> 00:11:15.300
 client connection. Let's check our net

213
00:11:15.300 --> 00:11:15.900
 card listener.

214
00:11:17.500 --> 00:11:20.400
And look at this. We actually have a reverse connection

215
00:11:20.400 --> 00:11:23.800
 that is originating from our Windows

216
00:11:23.800 --> 00:11:26.100
 machine back on to Kali.

217
00:11:26.700 --> 00:11:29.200
And currently we have access to

218
00:11:29.200 --> 00:11:30.500
 the windows terminal.

219
00:11:34.400 --> 00:11:36.100
If I type who am I?

220
00:11:36.700 --> 00:11:37.300
We can see.

221
00:11:38.600 --> 00:11:40.900
I am running as the user.

222
00:11:42.200 --> 00:11:43.500
if I type dir

223
00:11:44.200 --> 00:11:47.300
I could view the directory listing for this

224
00:11:47.300 --> 00:11:47.900
 folder.

225
00:11:49.200 --> 00:11:52.700
So currently we have keen review shell

226
00:11:52.700 --> 00:11:53.700
 within the system

227
00:11:55.500 --> 00:11:58.900
During the course of this video you have little to generate militia

228
00:11:58.900 --> 00:12:01.600
 shulk Hood using msf. Venom and create

229
00:12:01.600 --> 00:12:04.700
 a p-lude to compromise a vulnerable application

230
00:12:04.700 --> 00:12:06.800
 that is running on a Target system.

231
00:12:08.200 --> 00:12:11.500
In the next video, we'll be starting the introduction of section

232
00:12:11.500 --> 00:12:14.400
 6. I hope this video has been informative

233
00:12:14.400 --> 00:12:15.800
 for you and thank you for watching.
