WEBVTT - This file was automatically generated by VIMEO

0
00:00:07.400 --> 00:00:11.000
In this video, you will learn how to use immunity debugger

1
00:00:10.500 --> 00:00:13.900
 with the monoscript to find Bad characters

2
00:00:13.900 --> 00:00:14.900
 in your code.

3
00:00:15.900 --> 00:00:18.500
Before we generate shell cool to exploit

4
00:00:18.500 --> 00:00:21.800
 the vulnerable application or the software. It's important

5
00:00:21.800 --> 00:00:24.500
 to discover if there are any bad characters

6
00:00:24.500 --> 00:00:27.400
 simply because one generating

7
00:00:27.400 --> 00:00:30.400
 Shell Code good and bad characters are created

8
00:00:30.400 --> 00:00:34.100
 automatically. However, we can use the immunity

9
00:00:33.100 --> 00:00:36.500
 Boggle with the monoscript to help

10
00:00:36.500 --> 00:00:38.400
 us find Bad characters.

11
00:00:39.400 --> 00:00:42.300
firstly let's head over to this PC like so

12
00:00:43.200 --> 00:00:47.300
let's open the local disk and create a monofolder

13
00:00:46.300 --> 00:00:49.200
 as shown here with this

14
00:00:49.200 --> 00:00:51.000
 monofolder. It's currently empty.

15
00:00:52.600 --> 00:00:55.900
next let's execute the wall

16
00:00:55.900 --> 00:00:58.400
 server application like so

17
00:01:02.000 --> 00:01:02.300
great.

18
00:01:03.800 --> 00:01:06.200
Now, let's run immunity debugger.

19
00:01:12.100 --> 00:01:16.000
And let's attach the valve process onto immunity

20
00:01:15.000 --> 00:01:16.400
 debugger.

21
00:01:21.400 --> 00:01:24.500
Great this time. We are not going to click on Play. We

22
00:01:24.500 --> 00:01:26.400
 are simply leaving the application on pause.

23
00:01:29.500 --> 00:01:32.800
Now we can use the monoscript to help us generate

24
00:01:32.800 --> 00:01:35.500
 or find Bad characters within this

25
00:01:35.500 --> 00:01:36.500
 particular application.

26
00:01:37.900 --> 00:01:38.400
to do this

27
00:01:41.100 --> 00:01:44.500
Let's type. Our commands in this column on the

28
00:01:44.500 --> 00:01:47.800
 bottom left hand corner of immunity debugger.

29
00:01:48.600 --> 00:01:50.600
Let's put exclamation mark like so

30
00:01:51.400 --> 00:01:52.200
Mona

31
00:01:53.000 --> 00:01:53.500
space

32
00:01:54.200 --> 00:01:57.600
followed by the command called config like so

33
00:01:58.600 --> 00:02:00.100
Dash SED

34
00:02:01.700 --> 00:02:03.800
space working Fuller

35
00:02:07.800 --> 00:02:08.400
space

36
00:02:09.500 --> 00:02:09.900
c

37
00:02:10.900 --> 00:02:11.500
colon

38
00:02:13.400 --> 00:02:14.100
slash

39
00:02:14.800 --> 00:02:16.200
Mona like so

40
00:02:16.900 --> 00:02:17.500
hit enter.

41
00:02:19.200 --> 00:02:19.500
Great.

42
00:02:21.900 --> 00:02:25.300
This command simply says any configurations

43
00:02:24.300 --> 00:02:27.400
 that we are going to do. Let's store it

44
00:02:27.400 --> 00:02:30.100
 within the monofolder within our C drive.

45
00:02:31.700 --> 00:02:35.100
Next to generate all bad characters. Let's delete

46
00:02:34.100 --> 00:02:36.900
 this command like so

47
00:02:38.300 --> 00:02:41.500
let's use a new set. Let's do exclamation Mona.

48
00:02:42.400 --> 00:02:44.500
Let's specify byte re

49
00:02:45.800 --> 00:02:46.400
like so

50
00:02:47.300 --> 00:02:50.000
followed by a space with -

51
00:02:50.800 --> 00:02:52.700
 common c p b

52
00:02:54.300 --> 00:02:57.600
then we'll tell Mona to exclude all

53
00:02:57.600 --> 00:03:00.600
 the zeros Force simply because

54
00:03:00.600 --> 00:03:04.500
 zeros are bad characters. Well specifically zero

55
00:03:03.500 --> 00:03:07.100
 zero to do this. We'll specify

56
00:03:06.100 --> 00:03:10.200
 open quotations like so slash

57
00:03:09.200 --> 00:03:12.800
 x 0 0

58
00:03:14.100 --> 00:03:16.400
close quotations unident

59
00:03:17.400 --> 00:03:21.200
and as you can see, it has generated or bad

60
00:03:20.200 --> 00:03:22.300
 character code for us.

61
00:03:27.600 --> 00:03:30.000
To change our view let's click on see.

62
00:03:31.300 --> 00:03:31.600
Great.

63
00:03:32.500 --> 00:03:35.300
Let's verify if all bad characters are created.

64
00:03:36.100 --> 00:03:37.300
Let's settle back to our

65
00:03:37.900 --> 00:03:39.300
File Explorer

66
00:03:40.200 --> 00:03:41.500
let's click on this PC.

67
00:03:42.400 --> 00:03:45.700
Let's click on our C drive and let's

68
00:03:45.700 --> 00:03:48.200
 click on Mona and greet. Now. We

69
00:03:48.200 --> 00:03:51.500
 have a text file called battery. Let's open it.

70
00:03:52.400 --> 00:03:55.600
And here you can see our list of Bad characters

71
00:03:55.600 --> 00:03:59.000
 is generated already for us. Excellent.

72
00:04:05.200 --> 00:04:07.900
Now let us close immunity debugger.

73
00:04:08.300 --> 00:04:08.900
like so

74
00:04:10.700 --> 00:04:13.700
let us rerun all silver application.

75
00:04:22.500 --> 00:04:25.700
Next let us run immunity debugger and

76
00:04:25.700 --> 00:04:28.600
 reattach all silver obligation on

77
00:04:28.600 --> 00:04:29.600
 to immunity.

78
00:04:39.400 --> 00:04:40.700
Let's click on play.

79
00:04:41.300 --> 00:04:41.600
Great.

80
00:04:43.500 --> 00:04:46.400
Before we head over to our Kali Lennox virtual machine,

81
00:04:46.400 --> 00:04:49.400
 let us copy or barred characters.

82
00:04:50.500 --> 00:04:53.000
simply highlight all of these like so

83
00:04:53.700 --> 00:04:56.300
right click and copy create

84
00:04:57.100 --> 00:04:58.600
Let's head over now to Kali.

85
00:05:01.800 --> 00:05:04.600
On Kali Lennox. Let us modify

86
00:05:04.600 --> 00:05:07.300
 our previous python script.

87
00:05:08.500 --> 00:05:11.500
To do this. Let's click on the text

88
00:05:11.500 --> 00:05:11.800
 editor.

89
00:05:12.500 --> 00:05:13.500
Let's click on file.

90
00:05:14.400 --> 00:05:15.500
Let's click on ubon.

91
00:05:16.300 --> 00:05:19.400
and let's select fuzz3.py like so

92
00:05:19.900 --> 00:05:21.000
I'll click on ubon.

93
00:05:22.300 --> 00:05:22.600
Great.

94
00:05:25.600 --> 00:05:26.800
Firstly let's click on file.

95
00:05:27.800 --> 00:05:30.300
Save us. Let's call this

96
00:05:30.300 --> 00:05:32.500
 fuzz4.py.

97
00:05:33.800 --> 00:05:34.600
and see if

98
00:05:35.600 --> 00:05:36.800
now let's modify.

99
00:05:37.500 --> 00:05:38.900
Let's delete line 5.

100
00:05:39.800 --> 00:05:43.000
and let's call a new variable but

101
00:05:43.700 --> 00:05:46.000
character Bob Char for short

102
00:05:47.500 --> 00:05:48.600
let's put an equal sign.

103
00:05:49.600 --> 00:05:50.500
Open Rockets.

104
00:05:52.200 --> 00:05:53.300
And let's piece.

105
00:05:54.100 --> 00:05:56.100
Our bad characters that we have copied.

106
00:05:57.200 --> 00:05:58.300
from the monoscript

107
00:06:02.400 --> 00:06:03.200
That's right. Click.

108
00:06:04.500 --> 00:06:04.900
and select piece

109
00:06:08.100 --> 00:06:10.100
Lastly let's close brackets.

110
00:06:11.200 --> 00:06:11.800
excellent

111
00:06:12.700 --> 00:06:15.400
So currently we can see all our Bad characters

112
00:06:16.900 --> 00:06:17.900
Are being specified?

113
00:06:19.400 --> 00:06:21.900
With a new variable called bad char.

114
00:06:22.700 --> 00:06:23.300
excellent

115
00:06:27.100 --> 00:06:30.400
Let's rewrite a new variable called shell

116
00:06:30.400 --> 00:06:31.600
 good like so.

117
00:06:32.800 --> 00:06:33.800
Let's specify.

118
00:06:37.100 --> 00:06:38.500
2003 is

119
00:06:40.600 --> 00:06:43.200
which is our offset value like so

120
00:06:44.900 --> 00:06:47.100
let's also add Four B's.

121
00:06:52.400 --> 00:06:52.800
like so

122
00:06:54.300 --> 00:06:58.100
let's add our bar chart

123
00:06:57.100 --> 00:06:59.800
 variable at the end.

124
00:07:05.900 --> 00:07:06.200
Great.

125
00:07:09.100 --> 00:07:10.400
So the purpose of the script?

126
00:07:11.300 --> 00:07:14.900
Is it will make a connection to the application

127
00:07:14.900 --> 00:07:17.300
 that is running on our Target Windows

128
00:07:17.300 --> 00:07:19.500
 machine on Port 9999.

129
00:07:20.800 --> 00:07:23.000
The payload will execute Tron.

130
00:07:23.600 --> 00:07:26.600
Followed by these special characters followed by

131
00:07:26.600 --> 00:07:29.400
 or shalcode. Our shellcode will

132
00:07:29.400 --> 00:07:31.800
 consist of 2000 and 3 is

133
00:07:32.500 --> 00:07:35.300
Followed by four bees and all

134
00:07:35.300 --> 00:07:38.600
 bad characters which are these across here?

135
00:07:40.300 --> 00:07:41.300
Let's click on file.

136
00:07:42.300 --> 00:07:45.400
Let's click on Save and we can close this window.

137
00:07:46.000 --> 00:07:46.700
excellent

138
00:07:50.100 --> 00:07:50.900
now let's make

139
00:07:52.400 --> 00:07:54.800
fuzz4.py executable

140
00:07:55.600 --> 00:07:57.000
Let's do chmod.

141
00:07:58.100 --> 00:07:59.900
Let's specify plus X.

142
00:08:01.300 --> 00:08:04.000
fuzz for the py and hit enter

143
00:08:05.900 --> 00:08:07.900
Let's head over back to all Windows machine.

144
00:08:10.400 --> 00:08:14.300
And currently we can see that immediately buggers

145
00:08:13.300 --> 00:08:17.200
 running and wall silver.exe application

146
00:08:16.200 --> 00:08:18.100
 is running as well.

147
00:08:22.800 --> 00:08:25.300
When you're ready, let's execute our new

148
00:08:25.300 --> 00:08:25.400
 script.

149
00:08:26.200 --> 00:08:27.700
Let's say Python 3.

150
00:08:28.700 --> 00:08:31.400
First 4.py and hit enter.

151
00:08:32.600 --> 00:08:36.100
And notice with any second or two. The application

152
00:08:35.100 --> 00:08:37.100
 has crashed.

153
00:08:38.300 --> 00:08:41.300
As shown on the bottom left hand corner the access

154
00:08:41.300 --> 00:08:41.800
 violation.

155
00:08:42.700 --> 00:08:44.000
message occurred

156
00:08:45.800 --> 00:08:49.100
Let's be a little more closer tension to the

157
00:08:48.100 --> 00:08:50.800
 actual registers.

158
00:08:51.700 --> 00:08:54.300
Once again, we can see the eex register.

159
00:08:54.900 --> 00:08:56.300
Is written with ease?

160
00:08:58.700 --> 00:09:01.500
the EBP register is also

161
00:09:01.500 --> 00:09:02.700
 written with four is

162
00:09:04.300 --> 00:09:08.300
The EIP register it is written with Four

163
00:09:07.300 --> 00:09:08.700
 B's.

164
00:09:10.500 --> 00:09:13.400
To find a bad characters within our

165
00:09:13.400 --> 00:09:15.100
 code or return our script.

166
00:09:16.200 --> 00:09:19.800
We can simply select the hex dump or

167
00:09:19.800 --> 00:09:22.000
 we could observe the values in the hex dump.

168
00:09:23.200 --> 00:09:26.900
To be specific. Let's select the ESP register

169
00:09:26.900 --> 00:09:27.400
 like so

170
00:09:28.200 --> 00:09:30.000
let's right click on it.

171
00:09:30.800 --> 00:09:34.000
And now let us select follow in dump.

172
00:09:35.800 --> 00:09:38.700
Currently if we look at a hex dumb values

173
00:09:38.700 --> 00:09:42.000
 for the ESP register. We

174
00:09:41.100 --> 00:09:45.000
 can look for any sort of characters. That

175
00:09:44.700 --> 00:09:47.200
 seems to be out of

176
00:09:47.200 --> 00:09:47.300
 place.

177
00:09:48.300 --> 00:09:51.300
For example good characters have a

178
00:09:51.300 --> 00:09:54.900
 proper sequence such as 0 1 0 2

179
00:09:54.900 --> 00:09:57.700
 0 3 0 4 0

180
00:09:57.700 --> 00:09:58.200
 5.

181
00:09:59.100 --> 00:10:02.400
A bad character is simply character that does not

182
00:10:02.400 --> 00:10:05.900
 fill or does not belong in sequence. If you

183
00:10:05.900 --> 00:10:08.500
 recall we have excluded the

184
00:10:08.500 --> 00:10:11.500
 zero zero characters, so we will not see those.

185
00:10:12.500 --> 00:10:15.800
This process is sometime a bit time-consuming.

186
00:10:16.600 --> 00:10:19.500
Simply because we have to manually go through the

187
00:10:19.500 --> 00:10:22.700
 hex dump section of immunity debugger

188
00:10:22.700 --> 00:10:25.200
 and check for any sort of Bad characters.

189
00:10:26.200 --> 00:10:29.900
Simply because you need to identify each and every

190
00:10:29.900 --> 00:10:32.500
 and all bad characters within the

191
00:10:32.500 --> 00:10:35.100
 hex dump whenever performing any sort of

192
00:10:35.100 --> 00:10:37.500
 buffer overflow. So any application

193
00:10:38.300 --> 00:10:41.600
once you have identified them you will then need to write down

194
00:10:41.600 --> 00:10:44.500
 all of these bad characters simply because

195
00:10:44.500 --> 00:10:47.600
 we need to take note of it when creating our

196
00:10:47.600 --> 00:10:48.100
 Shell Code.

197
00:10:51.300 --> 00:10:54.500
So now that you have learned how to find Bad characters the next

198
00:10:54.500 --> 00:10:56.400
 step is to find the right module.

199
00:10:56.900 --> 00:10:59.300
Order I component within our

200
00:10:59.300 --> 00:11:01.200
 vulnerable application to be exploited.

201
00:11:02.200 --> 00:11:05.600
During the course of this video you have learned how to find Bad characters

202
00:11:05.600 --> 00:11:08.900
 so that you can exclude them when generating your

203
00:11:08.900 --> 00:11:09.400
 shellcode.

204
00:11:10.100 --> 00:11:13.500
In the next video, you will learn how to find the right module or

205
00:11:13.500 --> 00:11:16.500
 the right component within the vulnerable application

206
00:11:16.500 --> 00:11:19.200
 that could be exploited. I hope

207
00:11:19.200 --> 00:11:22.400
 this video has been informative for you and I will see you in the

208
00:11:22.400 --> 00:11:22.700
 next one.
