Skip to content

Commit fdd5775

Browse files
committed
Land rapid7#2095, go_pro fix for Kali
2 parents 94f8b1d + a4d96d3 commit fdd5775

File tree

1 file changed

+21
-19
lines changed
  • lib/msf/ui/console/command_dispatcher

1 file changed

+21
-19
lines changed

lib/msf/ui/console/command_dispatcher/core.rb

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class Core
3434

3535
# Session command options
3636
@@sessions_opts = Rex::Parser::Arguments.new(
37-
"-c" => [ true, "Run a command on the session given with -i, or all" ],
37+
"-c" => [ true, "Run a command on the session given with -i, or all"],
3838
"-h" => [ false, "Help banner" ],
3939
"-i" => [ true, "Interact with the supplied session ID" ],
4040
"-l" => [ false, "List all active sessions" ],
@@ -43,23 +43,23 @@ class Core
4343
"-d" => [ true, "Detach an interactive session" ],
4444
"-k" => [ true, "Terminate session" ],
4545
"-K" => [ false, "Terminate all sessions" ],
46-
"-s" => [ true, "Run a script on the session given with -i, or all" ],
46+
"-s" => [ true, "Run a script on the session given with -i, or all"],
4747
"-r" => [ false, "Reset the ring buffer for the session given with -i, or all"],
4848
"-u" => [ true, "Upgrade a win32 shell to a meterpreter session" ])
4949

5050
@@jobs_opts = Rex::Parser::Arguments.new(
5151
"-h" => [ false, "Help banner." ],
5252
"-k" => [ true, "Terminate the specified job name." ],
5353
"-K" => [ false, "Terminate all running jobs." ],
54-
"-i" => [ true, "Lists detailed information about a running job." ],
54+
"-i" => [ true, "Lists detailed information about a running job."],
5555
"-l" => [ false, "List all running jobs." ],
5656
"-v" => [ false, "Print more detailed info. Use with -i and -l" ])
5757

5858
@@threads_opts = Rex::Parser::Arguments.new(
5959
"-h" => [ false, "Help banner." ],
6060
"-k" => [ true, "Terminate the specified thread ID." ],
6161
"-K" => [ false, "Terminate all non-critical threads." ],
62-
"-i" => [ true, "Lists detailed information about a thread." ],
62+
"-i" => [ true, "Lists detailed information about a thread." ],
6363
"-l" => [ false, "List all background threads." ],
6464
"-v" => [ false, "Print more detailed info. Use with -i and -l" ])
6565

@@ -81,10 +81,10 @@ class Core
8181
"-i" => [ false, "Ignore case." ],
8282
"-m" => [ true, "Stop after arg matches." ],
8383
"-v" => [ false, "Invert match." ],
84-
"-A" => [ true, "Show arg lines of output After a match." ],
85-
"-B" => [ true, "Show arg lines of output Before a match." ],
86-
"-s" => [ true, "Skip arg lines of output before attempting match."],
87-
"-k" => [ true, "Keep (include) arg lines at start of output." ],
84+
"-A" => [ true, "Show arg lines of output After a match." ],
85+
"-B" => [ true, "Show arg lines of output Before a match." ],
86+
"-s" => [ true, "Skip arg lines of output before attempting match."],
87+
"-k" => [ true, "Keep (include) arg lines at start of output." ],
8888
"-c" => [ false, "Only print a count of matching lines." ])
8989

9090
@@search_opts = Rex::Parser::Arguments.new(
@@ -388,9 +388,9 @@ def cmd_banner(*args)
388388
"Large pentest? List, sort, group, tag and search your hosts and services\nin Metasploit Pro -- type 'go_pro' to launch it now.",
389389
"Frustrated with proxy pivoting? Upgrade to layer-2 VPN pivoting with\nMetasploit Pro -- type 'go_pro' to launch it now.",
390390
"Save your shells from AV! Upgrade to advanced AV evasion using dynamic\nexe templates with Metasploit Pro -- type 'go_pro' to launch it now.",
391-
"Easy phishing: Set up email templates, landing pages and listeners\nin Metasploit Pros wizard -- type 'go_pro' to launch it now.",
391+
"Easy phishing: Set up email templates, landing pages and listeners\nin Metasploit Pro's wizard -- type 'go_pro' to launch it now.",
392392
"Using notepad to track pentests? Have Metasploit Pro report on hosts,\nservices, sessions and evidence -- type 'go_pro' to launch it now.",
393-
"Tired of typing set RHOSTS? Click & pwn with Metasploit Pro\n-- type 'go_pro' to launch it now."
393+
"Tired of typing 'set RHOSTS'? Click & pwn with Metasploit Pro\n-- type 'go_pro' to launch it now."
394394
]
395395
banner << content.sample # Ruby 1.9-ism!
396396
banner << "\n\n"
@@ -1455,10 +1455,10 @@ def cmd_search(*args)
14551455

14561456
end
14571457

1458-
# Prints table of modules matching the search_string.
1459-
#
1460-
# @param (see Msf::DBManager#search_modules)
1461-
# @return [void]
1458+
# Prints table of modules matching the search_string.
1459+
#
1460+
# @param (see Msf::DBManager#search_modules)
1461+
# @return [void]
14621462
def search_modules_sql(search_string)
14631463
tbl = generate_module_table("Matching Modules")
14641464
framework.db.search_modules(search_string).each do |o|
@@ -2889,8 +2889,7 @@ def cmd_go_pro(*args)
28892889
end
28902890
end
28912891
unless is_apt
2892-
print_line " This command is only available on deb package installations,"
2893-
print_line " such as Kali Linux."
2892+
print_warning "This command is only available on deb package installations, such as Kali Linux."
28942893
return false
28952894
end
28962895
unless is_metasploit_debian_package_installed
@@ -2932,15 +2931,18 @@ def launch_metasploit_browser
29322931
return false
29332932
end
29342933
svc_log = File.expand_path(File.join(msfbase_dir, ".." , "engine", "prosvc_stdout.log"))
2935-
return unless ::File.readable_real? svc_log
2934+
unless ::File.readable_real? svc_log
2935+
print_error "Unable to access log file: #{svc_log}"
2936+
return false
2937+
end
29362938
really_started = false
29372939
# This method is a little lame but it's a short enough file that it
29382940
# shouldn't really matter that we open and close it a few times.
29392941
timeout = 0
29402942
until really_started
29412943
select(nil,nil,nil,3)
29422944
log_data = ::File.open(svc_log, "rb") {|f| f.read f.stat.size}
2943-
really_started = log_data =~ /^\[\*\] Ready/ # This is webserver ready
2945+
really_started = log_data =~ /Ready/ # This is webserver ready
29442946
if really_started
29452947
print_line
29462948
print_good "Metasploit Community / Pro is up and running, connecting now."
@@ -2953,7 +2955,7 @@ def launch_metasploit_browser
29532955
print_line
29542956
print_warning "For some reason, Community / Pro didn't start in a timely fashion."
29552957
print_warning "You might want to restart the Metasploit services by typing"
2956-
print_warning "'service metasploit restart' . Sorry it didn't work out."
2958+
print_warning "'service metasploit restart'. Sorry it didn't work out."
29572959
return false
29582960
else
29592961
print "."

0 commit comments

Comments
 (0)