Improve output when setting tank names
parent
0762b9fa9b
commit
de570a1550
|
@ -199,17 +199,31 @@ class Metasploit3 < Msf::Auxiliary
|
||||||
connect
|
connect
|
||||||
case action.name
|
case action.name
|
||||||
when 'SET_TANK_NAME'
|
when 'SET_TANK_NAME'
|
||||||
vprint_status("#{peer} -- setting tank ##{tank_number} to #{tank_name}")
|
# send the set tank name command to change the tank name(s)
|
||||||
request = action.opts[protocol + '_CMD'] + "#{format('%02d', tank_number)}#{tank_name}\n"
|
if tank_number == 0
|
||||||
|
vprint_status("#{peer} -- setting all tank names to #{tank_name}")
|
||||||
|
else
|
||||||
|
vprint_status("#{peer} -- setting tank ##{tank_number}'s name to #{tank_name}")
|
||||||
|
end
|
||||||
|
request = "#{action.opts[protocol + '_CMD']}#{format('%02d', tank_number)}#{tank_name}\n"
|
||||||
sock.put(request)
|
sock.put(request)
|
||||||
|
# reconnect
|
||||||
disconnect
|
disconnect
|
||||||
connect
|
connect
|
||||||
sock.put(actions.find { |a| a.name == 'INVENTORY' }.opts[protocol + '_CMD'] + "\n")
|
# send an inventory probe to show that it succeeded
|
||||||
print_status("#{peer} #{datastore['PROTOCOL']} #{action.opts['Description']}:\n#{sock.get_once}")
|
inventory_probe = "#{actions.find { |a| a.name == 'INVENTORY' }.opts[protocol + '_CMD']}\n"
|
||||||
|
sock.put(inventory_probe)
|
||||||
|
inventory_response = sock.get_once # XXX: timeout?
|
||||||
|
message = "#{peer} #{protocol} #{action.opts['Description']}:\n#{inventory_response}"
|
||||||
|
if inventory_response.include?(tank_name)
|
||||||
|
print_good message
|
||||||
|
else
|
||||||
|
print_warning message
|
||||||
|
end
|
||||||
else
|
else
|
||||||
request = action.opts[datastore['PROTOCOL'] + '_CMD'] + "\n"
|
request = "#{action.opts[protocol + '_CMD']}\n"
|
||||||
sock.put(request)
|
sock.put(request)
|
||||||
print_status("#{peer} #{datastore['PROTOCOL']} #{action.opts['Description']}:\n#{sock.get_once}")
|
print_status("#{peer} #{protocol} #{action.opts['Description']}:\n#{sock.get_once}")
|
||||||
end
|
end
|
||||||
ensure
|
ensure
|
||||||
disconnect
|
disconnect
|
||||||
|
|
Loading…
Reference in New Issue