File tree Expand file tree Collapse file tree 1 file changed +4
-26
lines changed
modules/exploits/windows/local Expand file tree Collapse file tree 1 file changed +4
-26
lines changed Original file line number Diff line number Diff line change @@ -83,11 +83,11 @@ def check
83
83
84
84
mscorlib_version = get_mscorlib_version
85
85
86
- if valid_mscorlib_version? ( net_version , mscorlib_version )
87
- return Exploit ::CheckCode ::Vulnerable
86
+ if Gem :: Version . new ( mscorlib_version ) >= Gem :: Version . new ( NET_VERSIONS [ net_version ] [ "mscorlib" ] )
87
+ return Exploit ::CheckCode ::Safe
88
88
end
89
89
90
- Exploit ::CheckCode ::Safe
90
+ Exploit ::CheckCode ::Vulnerable
91
91
end
92
92
93
93
def get_net_version
@@ -144,7 +144,7 @@ def exploit
144
144
145
145
mscorlib_version = get_mscorlib_version
146
146
147
- unless valid_mscorlib_version? ( net_version , mscorlib_version )
147
+ if Gem :: Version . new ( mscorlib_version ) >= Gem :: Version . new ( NET_VERSIONS [ net_version ] [ "mscorlib" ] )
148
148
fail_with ( Failure ::NotVulnerable , ".NET Installation not vulnerable" )
149
149
end
150
150
@@ -166,28 +166,6 @@ def exploit
166
166
)
167
167
end
168
168
169
- def valid_mscorlib_version? ( net_version , mscorlib_version )
170
- valid = false
171
-
172
- mscorlib = mscorlib_version . split ( "." )
173
- mscorlib . reverse!
174
-
175
- max_version = NET_VERSIONS [ net_version ] [ "mscorlib" ] . split ( "." )
176
- max_version . reverse!
177
-
178
- i = 0
179
- mscorlib . each do |v |
180
- if v . to_i < max_version [ i ] . to_i
181
- valid = true
182
- elsif v . to_i > max_version [ i ] . to_i
183
- valid = false
184
- end
185
- i = i + 1
186
- end
187
-
188
- valid
189
- end
190
-
191
169
def cleanup
192
170
session . railgun . kernel32 . SetEnvironmentVariableA ( "PSHCMD" , nil )
193
171
super
You can’t perform that action at this time.
0 commit comments