Rubocop and msftidy-ied :-)
parent
02a58d459b
commit
ee7c418ca8
|
@ -39,7 +39,6 @@ class Metasploit3 < Msf::Post
|
||||||
end
|
end
|
||||||
|
|
||||||
def run
|
def run
|
||||||
|
|
||||||
# Check to ensure that UNIX sockets are supported
|
# Check to ensure that UNIX sockets are supported
|
||||||
begin
|
begin
|
||||||
::UNIXServer
|
::UNIXServer
|
||||||
|
@ -88,9 +87,9 @@ class Metasploit3 < Msf::Post
|
||||||
response = client.pageantjacker.forward_to_pageant(socket_request_data.first, socket_request_data.first.size)
|
response = client.pageantjacker.forward_to_pageant(socket_request_data.first, socket_request_data.first.size)
|
||||||
if response[:success]
|
if response[:success]
|
||||||
begin
|
begin
|
||||||
s.send response[:blob], 0
|
s.send response[:blob], 0
|
||||||
rescue
|
rescue
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
vprint_status("PageantJacker: Response received (Success='#{response[:success]}' Size='#{response[:blob].size}' Error='#{translate_error(response[:error])}')")
|
vprint_status("PageantJacker: Response received (Success='#{response[:success]}' Size='#{response[:blob].size}' Error='#{translate_error(response[:error])}')")
|
||||||
else
|
else
|
||||||
|
@ -106,28 +105,28 @@ class Metasploit3 < Msf::Post
|
||||||
::File.delete(@sockpath) if ::File.exist?(@sockpath) if @sockpath
|
::File.delete(@sockpath) if ::File.exist?(@sockpath) if @sockpath
|
||||||
end
|
end
|
||||||
|
|
||||||
def translate_error(errnum)
|
def translate_error(errnum)
|
||||||
errstring = "#{errnum}: "
|
errstring = "#{errnum}: "
|
||||||
case errnum
|
case errnum
|
||||||
when 0
|
when 0
|
||||||
errstring += "No error"
|
errstring += "No error"
|
||||||
when 1
|
when 1
|
||||||
errstring += "The Pageant request was not processed."
|
errstring += "The Pageant request was not processed."
|
||||||
when 2
|
when 2
|
||||||
errstring += "Unable to obtain IPC memory address."
|
errstring += "Unable to obtain IPC memory address."
|
||||||
when 3
|
when 3
|
||||||
errstring += "Unable to allocate memory for Pageant<-->Meterpreter IPC."
|
errstring += "Unable to allocate memory for Pageant<-->Meterpreter IPC."
|
||||||
when 4
|
when 4
|
||||||
errstring += "Unable to allocate memory buffer."
|
errstring += "Unable to allocate memory buffer."
|
||||||
when 5
|
when 5
|
||||||
errstring += "Unable to build Pageant request string."
|
errstring += "Unable to build Pageant request string."
|
||||||
when 6
|
when 6
|
||||||
errstring += "Pageant not found."
|
errstring += "Pageant not found."
|
||||||
when 7
|
when 7
|
||||||
errstring += "Not forwarded."
|
errstring += "Not forwarded."
|
||||||
else
|
else
|
||||||
errstring += "Unknown."
|
errstring += "Unknown."
|
||||||
end
|
end
|
||||||
return errstring
|
errstring
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue