diff --git a/lib/msf/core/post/linux/system.rb b/lib/msf/core/post/linux/system.rb index aca05c8391..4b9fdc2627 100644 --- a/lib/msf/core/post/linux/system.rb +++ b/lib/msf/core/post/linux/system.rb @@ -112,7 +112,7 @@ module System 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[2..-1] + full = full.split("\n")[2..-1] full.delete!(':') # Only happens when getting services if portsonly