Remove get_listening_ports()

GSoC/Meterpreter_Web_Console
Carter Brainerd 2018-04-22 16:15:33 -04:00 committed by GitHub
parent 035a6a72f1
commit 055f9ee88b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 32 deletions

View File

@ -102,38 +102,6 @@ module System
return system_data
end
#
# Returns all listening services along with their ports
# @param portsonly Return the listening ports without their associated service
# @return [Hash]
#
def get_listening_services(portsonly = false)
services = {}
begin
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]
if portsonly
ports = []
full.each do |p|
ports << p.split('/')[1]
end
return ports
else
full.each do |s|
s.delete!(':') # Only happens when getting services
split = s.split('/')
services[:"#{split[0]}"] = split[1]
end
end
services
rescue
raise 'Could not gather listening ports'
end
end
#
# Gathers all SUID files on the filesystem.
# NOTE: This uses the Linux `find` command. It will most likely take a while to get all files.