Skip to content

Commit e4165d3

Browse files
author
Brent Cook
committed
whitespace fixes
from @sempervictus
1 parent 66bd881 commit e4165d3

File tree

3 files changed

+61
-61
lines changed

3 files changed

+61
-61
lines changed

lib/rex/post/meterpreter/ui/console/command_dispatcher/stdapi/fs.rb

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -235,19 +235,19 @@ def cmd_rm(*args)
235235

236236
alias :cmd_del :cmd_rm
237237

238-
#
239-
# Move source to destination
240-
#
241-
def cmd_mv(*args)
242-
if (args.length < 2)
243-
print_line("Usage: mv oldfile newfile")
244-
return true
245-
end
246-
client.fs.file.mv(args[0],args[1])
247-
return true
248-
end
238+
#
239+
# Move source to destination
240+
#
241+
def cmd_mv(*args)
242+
if (args.length < 2)
243+
print_line("Usage: mv oldfile newfile")
244+
return true
245+
end
246+
client.fs.file.mv(args[0],args[1])
247+
return true
248+
end
249249

250-
alias :cmd_move :cmd_mv
250+
alias :cmd_move :cmd_mv
251251
alias :cmd_rename :cmd_mv
252252

253253
#

lib/rex/post/meterpreter/ui/console/command_dispatcher/stdapi/sys.rb

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -21,61 +21,61 @@ class Console::CommandDispatcher::Stdapi::Sys
2121
# Options used by the 'execute' command.
2222
#
2323
@@execute_opts = Rex::Parser::Arguments.new(
24-
"-a" => [ true, "The arguments to pass to the command." ],
25-
"-c" => [ false, "Channelized I/O (required for interaction)." ],
26-
"-f" => [ true, "The executable command to run." ],
27-
"-h" => [ false, "Help menu." ],
28-
"-H" => [ false, "Create the process hidden from view." ],
29-
"-i" => [ false, "Interact with the process after creating it." ],
30-
"-m" => [ false, "Execute from memory." ],
31-
"-d" => [ true, "The 'dummy' executable to launch when using -m." ],
24+
"-a" => [ true, "The arguments to pass to the command." ],
25+
"-c" => [ false, "Channelized I/O (required for interaction)." ],
26+
"-f" => [ true, "The executable command to run." ],
27+
"-h" => [ false, "Help menu." ],
28+
"-H" => [ false, "Create the process hidden from view." ],
29+
"-i" => [ false, "Interact with the process after creating it." ],
30+
"-m" => [ false, "Execute from memory." ],
31+
"-d" => [ true, "The 'dummy' executable to launch when using -m." ],
3232
"-t" => [ false, "Execute process with currently impersonated thread token"],
33-
"-k" => [ false, "Execute process on the meterpreters current desktop" ],
33+
"-k" => [ false, "Execute process on the meterpreters current desktop" ],
3434
"-s" => [ true, "Execute process in a given session as the session user" ])
3535

3636
#
3737
# Options used by the 'reboot' command.
3838
#
3939
@@reboot_opts = Rex::Parser::Arguments.new(
40-
"-h" => [ false, "Help menu." ],
41-
"-f" => [ true, "Force a reboot, valid values [1|2]" ])
40+
"-h" => [ false, "Help menu." ],
41+
"-f" => [ true, "Force a reboot, valid values [1|2]" ])
4242

4343
#
4444
# Options used by the 'shutdown' command.
4545
#
4646
@@shutdown_opts = Rex::Parser::Arguments.new(
47-
"-h" => [ false, "Help menu." ],
48-
"-f" => [ true, "Force a shutdown, valid values [1|2]" ])
47+
"-h" => [ false, "Help menu." ],
48+
"-f" => [ true, "Force a shutdown, valid values [1|2]" ])
4949

5050
#
5151
# Options used by the 'reg' command.
5252
#
5353
@@reg_opts = Rex::Parser::Arguments.new(
54-
"-d" => [ true, "The data to store in the registry value." ],
55-
"-h" => [ false, "Help menu." ],
56-
"-k" => [ true, "The registry key path (E.g. HKLM\\Software\\Foo)." ],
57-
"-t" => [ true, "The registry value type (E.g. REG_SZ)." ],
58-
"-v" => [ true, "The registry value name (E.g. Stuff)." ],
54+
"-d" => [ true, "The data to store in the registry value." ],
55+
"-h" => [ false, "Help menu." ],
56+
"-k" => [ true, "The registry key path (E.g. HKLM\\Software\\Foo)." ],
57+
"-t" => [ true, "The registry value type (E.g. REG_SZ)." ],
58+
"-v" => [ true, "The registry value name (E.g. Stuff)." ],
5959
"-r" => [ true, "The remote machine name to connect to (with current process credentials" ],
60-
"-w" => [ false, "Set KEY_WOW64 flag, valid values [32|64]." ])
60+
"-w" => [ false, "Set KEY_WOW64 flag, valid values [32|64]." ])
6161

6262
#
6363
# Options for the 'ps' command.
6464
#
6565
@@ps_opts = Rex::Parser::Arguments.new(
6666
"-S" => [ true, "String to search for (converts to regex)" ],
6767
"-h" => [ false, "Help menu." ],
68-
"-A" => [ true, "Filters processes on architecture (x86 or x86_64)" ],
69-
"-s" => [ false, "Show only SYSTEM processes" ],
68+
"-A" => [ true, "Filters processes on architecture (x86 or x86_64)" ],
69+
"-s" => [ false, "Show only SYSTEM processes" ],
7070
"-U" => [ true, "Filters processes on the user using the supplied RegEx" ])
7171

7272
#
7373
# Options for the 'suspend' command.
7474
#
7575
@@suspend_opts = Rex::Parser::Arguments.new(
76-
"-h" => [ false, "Help menu." ],
76+
"-h" => [ false, "Help menu." ],
7777
"-c" => [ false, "Continues suspending or resuming even if an error is encountered"],
78-
"-r" => [ false, "Resumes the target processes instead of suspending" ])
78+
"-r" => [ false, "Resumes the target processes instead of suspending" ])
7979

8080
#
8181
# List of supported commands.
@@ -93,7 +93,7 @@ def commands
9393
"kill" => "Terminate a process",
9494
"ps" => "List running processes",
9595
"reboot" => "Reboots the remote computer",
96-
"reg" => "Modify and interact with the remote registry",
96+
"reg" => "Modify and interact with the remote registry",
9797
"rev2self" => "Calls RevertToSelf() on the remote machine",
9898
"shell" => "Drop into a system command shell",
9999
"shutdown" => "Shuts down the remote computer",
@@ -105,15 +105,15 @@ def commands
105105
"clearev" => [ "stdapi_sys_eventlog_open", "stdapi_sys_eventlog_clear" ],
106106
"drop_token" => [ "stdapi_sys_config_drop_token" ],
107107
"execute" => [ "stdapi_sys_process_execute" ],
108-
"getpid" => [ "stdapi_sys_process_getpid" ],
108+
"getpid" => [ "stdapi_sys_process_getpid" ],
109109
"getprivs" => [ "stdapi_sys_config_getprivs" ],
110110
"getuid" => [ "stdapi_sys_config_getuid" ],
111111
"getsid" => [ "stdapi_sys_config_getsid" ],
112112
"getenv" => [ "stdapi_sys_config_getenv" ],
113113
"kill" => [ "stdapi_sys_process_kill" ],
114114
"ps" => [ "stdapi_sys_process_get_processes" ],
115115
"reboot" => [ "stdapi_sys_power_exitwindows" ],
116-
"reg" => [
116+
"reg" => [
117117
"stdapi_registry_load_key",
118118
"stdapi_registry_unload_key",
119119
"stdapi_registry_open_key",
@@ -169,7 +169,7 @@ def cmd_execute(*args)
169169
interact = false
170170
desktop = false
171171
channelized = nil
172-
hidden = nil
172+
hidden = nil
173173
from_mem = false
174174
dummy_exec = "cmd"
175175
cmd_args = nil
@@ -433,7 +433,7 @@ def cmd_ps(*args)
433433
search_term = val
434434
if search_term.nil?
435435
print_error("Enter a search term")
436-
return true
436+
return true
437437
end
438438
when '-h'
439439
print_line "Usage: ps [ options ]"
@@ -452,14 +452,14 @@ def cmd_ps(*args)
452452
print_line "You must select either x86 or x86_64"
453453
return false
454454
end
455-
searched_procs << proc if proc["arch"] == val
455+
searched_procs << proc if proc["arch"] == val
456456
end
457457
processes = searched_procs
458458
when "-s"
459459
print_line "Filtering on SYSTEM processes..."
460460
searched_procs = Rex::Post::Meterpreter::Extensions::Stdapi::Sys::ProcessList.new
461461
processes.each do |proc|
462-
searched_procs << proc if proc["user"] == "NT AUTHORITY\\SYSTEM"
462+
searched_procs << proc if proc["user"] == "NT AUTHORITY\\SYSTEM"
463463
end
464464
processes = searched_procs
465465
when "-U"
@@ -470,7 +470,7 @@ def cmd_ps(*args)
470470
print_line "You must supply a search term!"
471471
return false
472472
end
473-
searched_procs << proc if proc["user"].match(/#{val}/)
473+
searched_procs << proc if proc["user"].match(/#{val}/)
474474
end
475475
processes = searched_procs
476476
end
@@ -498,7 +498,7 @@ def cmd_ps(*args)
498498
# for display and consistency with payload naming we switch the internal 'x86_64' value to display 'x64'
499499
if( arch == ARCH_X86_64 )
500500
arch = "x64"
501-
end
501+
end
502502

503503
row = [ ent['pid'].to_s, ent['name'], arch, session, ent['user'], ent['path'] ]
504504

@@ -565,12 +565,12 @@ def cmd_reg(*args)
565565
end
566566

567567
# Initiailze vars
568-
key = nil
569-
value = nil
570-
data = nil
571-
type = nil
568+
key = nil
569+
value = nil
570+
data = nil
571+
type = nil
572572
wowflag = 0x0000
573-
rem = nil
573+
rem = nil
574574

575575
@@reg_opts.parse(args) { |opt, idx, val|
576576
case opt
@@ -580,13 +580,13 @@ def cmd_reg(*args)
580580
"Interact with the target machine's registry.\n" +
581581
@@reg_opts.usage +
582582
"COMMANDS:\n\n" +
583-
" enumkey Enumerate the supplied registry key [-k <key>]\n" +
584-
" createkey Create the supplied registry key [-k <key>]\n" +
585-
" deletekey Delete the supplied registry key [-k <key>]\n" +
583+
" enumkey Enumerate the supplied registry key [-k <key>]\n" +
584+
" createkey Create the supplied registry key [-k <key>]\n" +
585+
" deletekey Delete the supplied registry key [-k <key>]\n" +
586586
" queryclass Queries the class of the supplied key [-k <key>]\n" +
587-
" setval Set a registry value [-k <key> -v <val> -d <data>]\n" +
588-
" deleteval Delete the supplied registry value [-k <key> -v <val>]\n" +
589-
" queryval Queries the data contents of a value [-k <key> -v <val>]\n\n")
587+
" setval Set a registry value [-k <key> -v <val> -d <data>]\n" +
588+
" deleteval Delete the supplied registry value [-k <key> -v <val>]\n" +
589+
" queryval Queries the data contents of a value [-k <key> -v <val>]\n\n")
590590
return false
591591
when "-k"
592592
key = val
@@ -895,11 +895,11 @@ def cmd_suspend(*args)
895895
args.uniq!
896896
diff = args - valid_pids.map {|e| e.to_s}
897897
if not diff.empty? # then we had an invalid pid
898-
print_error("The following pids are not valid: #{diff.join(", ").to_s}.")
898+
print_error("The following pids are not valid: #{diff.join(", ").to_s}.")
899899
if continue
900900
print_status("Continuing. Invalid args have been removed from the list.")
901901
else
902-
print_error("Quitting. Use -c to continue using only the valid pids.")
902+
print_error("Quitting. Use -c to continue using only the valid pids.")
903903
return false
904904
end
905905
end

lib/rex/ui/text/table.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -328,9 +328,9 @@ def columns_to_s # :nodoc:
328328
padding = pad(' ', last_col, last_idx)
329329
nameline << padding
330330
remainder = padding.length - cellpad
331-
if (remainder < 0)
332-
remainder = 0
333-
end
331+
if (remainder < 0)
332+
remainder = 0
333+
end
334334
barline << (' ' * (cellpad + remainder))
335335
end
336336

@@ -391,7 +391,7 @@ def pad(chr, buf, colidx, use_cell_pad = true) # :nodoc:
391391
if (use_cell_pad)
392392
val << ' ' * cellpad
393393
end
394-
394+
395395
return val
396396
end
397397

0 commit comments

Comments
 (0)