Browse Source

Touchups to msfconsole command parsing

Move from -s to -x and use a semicolon.
Tod Beardsley 7 years ago
parent
commit
1f90130475
2 changed files with 5 additions and 5 deletions
  1. 2
    2
      lib/msf/ui/console/driver.rb
  2. 3
    3
      msfconsole

+ 2
- 2
lib/msf/ui/console/driver.rb View File

@@ -251,8 +251,8 @@ class Driver < Msf::Ui::Driver
251 251
 		end
252 252
 
253 253
 		# Process any additional startup commands
254
-		if opts['SCommands'] and opts['SCommands'].kind_of? Array
255
-			opts['SCommands'].each { |c|
254
+		if opts['XCommands'] and opts['XCommands'].kind_of? Array
255
+			opts['XCommands'].each { |c|
256 256
 				run_single(c)
257 257
 			}
258 258
 		end

+ 3
- 3
msfconsole View File

@@ -101,9 +101,9 @@ class OptsConsole
101 101
 				options['DisableBanner'] = true
102 102
 			end
103 103
 
104
-			opts.on("-s", "-s <string>", "Execute the specified string as console commands") do |s|
105
-				options['SCommands'] ||= []
106
-				options['SCommands'] += s.split('\n')
104
+			opts.on("-x", "-x <command>", "Execute the specified string as console commands (use ; for multiples)") do |s|
105
+				options['XCommands'] ||= []
106
+				options['XCommands'] += s.split(/\s*;\s*/)
107 107
 			end
108 108
 
109 109
 			opts.separator ""

Loading…
Cancel
Save