Skip to content

Commit 4315c2d

Browse files
committed
Land rapid7#8802, single-char args for terp scripts
2 parents bb5fffe + ed2286c commit 4315c2d

File tree

11 files changed

+44
-44
lines changed

11 files changed

+44
-44
lines changed

documentation/modules/post/windows/manage/priv_migrate.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ set PAYLOAD windows/meterpreter/reverse_https
5656
set LHOST 192.168.1.101
5757
set LPORT 13002
5858
set ExitOnSession false
59-
set AutoRunScript multi_console_command -rc /home/user/auto.rc
59+
set AutoRunScript multi_console_command -r /home/user/auto.rc
6060
exploit -j
6161
```
6262

scripts/meterpreter/getgui.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ def message
176176
print_status("Starting the port forwarding at local port #{lport}")
177177
client.run_cmd("portfwd add -L 0.0.0.0 -l #{lport} -p 3389 -r 127.0.0.1")
178178
end
179-
print_status("For cleanup use command: run multi_console_command -rc #{@dest}")
179+
print_status("For cleanup use command: run multi_console_command -r #{@dest}")
180180
else
181181
usage
182182
end

scripts/meterpreter/gettelnet.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ def unsupported
166166
if (usr!= nil && pass != nil)
167167
addrdpusr(usr, pass)
168168
end
169-
print_status("For cleanup use command: run multi_console_command -rc #{@dest}")
169+
print_status("For cleanup use command: run multi_console_command -r #{@dest}")
170170

171171
else
172172
usage

scripts/meterpreter/multi_console_command.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
# Setting Arguments
1818
@@exec_opts = Rex::Parser::Arguments.new(
1919
"-h" => [ false,"Help menu." ],
20-
"-sl" => [ false,"Hide commands output for work in background sessions"],
21-
"-cl" => [ true,"Commands to execute. The command must be enclosed in double quotes and separated by a comma."],
22-
"-rc" => [ true,"Text file with list of commands, one per line."]
20+
"-s" => [ false,"Hide commands output for work in background sessions"],
21+
"-c" => [ true,"Commands to execute. The command must be enclosed in double quotes and separated by a comma."],
22+
"-r" => [ true,"Text file with list of commands, one per line."]
2323
)
2424

2525
commands = nil
@@ -36,9 +36,9 @@ def usage
3636
@@exec_opts.parse(args) { |opt, idx, val|
3737
case opt
3838

39-
when "-cl"
39+
when "-c"
4040
commands = val.split(",")
41-
when "-rc"
41+
when "-r"
4242
script = val
4343
if not ::File.exist?(script)
4444
raise "Command List File does not exists!"
@@ -51,7 +51,7 @@ def usage
5151

5252
when "-h"
5353
help = true
54-
when "-sl"
54+
when "-s"
5555
silence = true
5656
end
5757
}

scripts/meterpreter/multi_meter_inject.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
"-h" => [ false, "Help menu." ],
2323
"-p" => [ true, "The port on the remote host where Metasploit is listening (default: 4444)."],
2424
"-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."]
25+
"-P" => [ true, "Specify reverse connection Meterpreter payload. Default: windows/meterpreter/reverse_tcp"],
26+
"-I" => [ true, "Provide multiple IP addresses for connections separated by comma."],
27+
"-d" => [ true, "Provide multiple PID for connections separated by comma one per IP."]
2828
)
2929
meter_type = client.platform
3030

@@ -112,11 +112,11 @@ def start_proc()
112112
lport = val.to_i
113113
when "-m"
114114
start_handler = true
115-
when "-pt"
115+
when "-P"
116116
payload_type = val
117-
when "-mr"
117+
when "-I"
118118
multi_ip = val.split(",")
119-
when "-mp"
119+
when "-d"
120120
multi_pid = val.split(",")
121121
end
122122
}

scripts/meterpreter/multicommand.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
# Setting Arguments
1717
@@exec_opts = Rex::Parser::Arguments.new(
1818
"-h" => [ false,"Help menu." ],
19-
"-cl" => [ true,"Commands to execute. The command must be enclosed in double quotes and separated by a comma."],
19+
"-c" => [ true,"Commands to execute. The command must be enclosed in double quotes and separated by a comma."],
2020
"-f" => [ true,"File where to saved output of command."],
21-
"-rc" => [ true,"Text file with list of commands, one per line."]
21+
"-r" => [ true,"Text file with list of commands, one per line."]
2222
)
2323
#Setting Argument variables
2424
commands = []
@@ -77,9 +77,9 @@ def usage
7777
@@exec_opts.parse(args) { |opt, idx, val|
7878
case opt
7979

80-
when "-cl"
80+
when "-c"
8181
commands = val.split(",")
82-
when "-rc"
82+
when "-r"
8383
script = val
8484
if not ::File.exist?(script)
8585
raise "Command List File does not exists!"

scripts/meterpreter/multiscript.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515

1616
@@exec_opts = Rex::Parser::Arguments.new(
1717
"-h" => [ false,"Help menu." ],
18-
"-cl" => [ true,"Collection of scripts to execute. Each script command must be enclosed in double quotes and separated by a semicolon."],
19-
"-rc" => [ true,"Text file with list of commands, one per line."]
18+
"-c" => [ true,"Collection of scripts to execute. Each script command must be enclosed in double quotes and separated by a semicolon."],
19+
"-r" => [ true,"Text file with list of commands, one per line."]
2020
)
2121
#Setting Argument variables
2222
commands = ""
@@ -53,9 +53,9 @@ def usage
5353
@@exec_opts.parse(args) do |opt, idx, val|
5454
case opt
5555

56-
when "-cl"
56+
when "-c"
5757
commands = val.gsub(/;/,"\n")
58-
when "-rc"
58+
when "-r"
5959
script = val
6060
if not ::File.exist?(script)
6161
raise "Script List File does not exists!"

scripts/meterpreter/netenum.rb

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@
1515
@@exec_opts = Rex::Parser::Arguments.new(
1616
"-h" => [ false, "Help menu." ],
1717
"-r" => [ true, "The target address range or CIDR identifier" ],
18-
"-ps" => [ false, "To Perform Ping Sweep on IP Range" ],
19-
"-rl" => [ false, "To Perform DNS Reverse Lookup on IP Range" ],
20-
"-fl" => [ false, "To Perform DNS Forward Lookup on host list and domain" ],
21-
"-hl" => [ true, "File with Host List for DNS Forward Lookup" ],
18+
"-p" => [ false, "To Perform Ping Sweep on IP Range" ],
19+
"-l" => [ false, "To Perform DNS Reverse Lookup on IP Range" ],
20+
"-f" => [ false, "To Perform DNS Forward Lookup on host list and domain" ],
21+
"-H" => [ true, "File with Host List for DNS Forward Lookup" ],
2222
"-d" => [ true, "Domain Name for DNS Forward Lookup" ],
23-
"-st" => [ false, "To Perform DNS lookup of MX and NS records for a domain" ],
24-
"-sr" => [ false, "To Perform Service Record DNS lookup for a domain" ]
23+
"-x" => [ false, "To Perform DNS lookup of MX and NS records for a domain" ],
24+
"-s" => [ false, "To Perform Service Record DNS lookup for a domain" ]
2525
)
2626
session = client
2727
host,port = session.session_host, session.session_port
@@ -285,19 +285,19 @@ def message(dest)
285285
# Parsing of Options
286286
@@exec_opts.parse(args) { |opt, idx, val|
287287
case opt
288-
when "-sr"
288+
when "-s"
289289
srvrc = 1
290-
when "-rl"
290+
when "-l"
291291
rvrslkp = 1
292-
when "-fl"
292+
when "-f"
293293
frdlkp = 1
294-
when "-ps"
294+
when "-p"
295295
pngsp = 1
296-
when "-st"
296+
when "-x"
297297
stdlkp = 1
298298
when "-d"
299299
dom = val
300-
when "-hl"
300+
when "-H"
301301
hostlist = val
302302
when "-r"
303303
range = val
@@ -354,9 +354,9 @@ def message(dest)
354354
else
355355
print("Network Enumerator Meterpreter Script\n" +
356356
"Usage:\n" +
357-
"\tnetenum -r <value> (-ps | -rl)\n" +
358-
"\tnetenum -d <value> (-st | -sr)\n" +
359-
"\tnetenum -d <value> -lh <value> -fl\n" +
357+
"\tnetenum -r <value> (-p | -l)\n" +
358+
"\tnetenum -d <value> (-x | -s)\n" +
359+
"\tnetenum -d <value> -H <value> -fl\n" +
360360
@@exec_opts.usage)
361361
end
362362
else

scripts/meterpreter/packetrecorder.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"-h" => [ false, "Help menu."],
2727
"-t" => [ true, "Time interval in seconds between recollection of packet, default 30 seconds."],
2828
"-i" => [ true, "Interface ID number where all packet capture will be done."],
29-
"-li" => [ false, "List interfaces that can be used for capture."],
29+
"-L" => [ false, "List interfaces that can be used for capture."],
3030
"-l" => [ true, "Specify and alternate folder to save PCAP file."]
3131
)
3232
meter_type = client.platform
@@ -192,7 +192,7 @@ def int_list()
192192
int_id = val.to_i
193193
when "-l"
194194
log_dest = val
195-
when "-li"
195+
when "-L"
196196
list_int = 1
197197
when "-t"
198198
rec_time = val

scripts/meterpreter/scheduleme.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"-h" => [ false,"Help menu." ],
2222
"-c" => [ true,"Command to execute at the given time. If options for execution needed use double quotes"],
2323
"-d" => [ false,"Daily." ],
24-
"-hr" => [ true,"Every specified hours 1-23."],
24+
"-H" => [ true,"Every specified hours 1-23."],
2525
"-m" => [ true, "Every specified amount of minutes 1-1439"],
2626
"-e" => [ true, "Executable or script to upload to target host, will not work with remote schedule"],
2727
"-l" => [ false,"When a user logs on."],
@@ -214,7 +214,7 @@ def upload(session,file)
214214
when "-d"
215215
tmmod = val
216216
schtype = "daily"
217-
when "-hr"
217+
when "-H"
218218
tmmod = val
219219
schtype = "hourly"
220220
when "-m"

0 commit comments

Comments
 (0)