Fix undefined method error in get_listening_services

GSoC/Meterpreter_Web_Console
Carter Brainerd 2018-04-21 11:10:01 -04:00 committed by GitHub
parent 4c6ae0f644
commit 035a6a72f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -113,7 +113,6 @@ module System
full = cmd_exec('netstat -tulpn').to_s
raise "You must be root to get listening ports" if full.include? '(No info could be read'
full = full.split("\n")[2..-1]
full.delete!(':') # Only happens when getting services
if portsonly
ports = []
@ -123,6 +122,7 @@ module System
return ports
else
full.each do |s|
s.delete!(':') # Only happens when getting services
split = s.split('/')
services[:"#{split[0]}"] = split[1]
end