Skip to content
Snippets Groups Projects
Commit f18a5c74 authored by Tibo's avatar Tibo
Browse files

filter out ports bound to 127.0.0.1 or ::1

parent 81d480e6
No related branches found
No related tags found
No related merge requests found
Pipeline #12941 failed
......@@ -63,9 +63,15 @@ class ListeningPorts implements Sensor
$ports = [];
$count = count($values[1]);
for ($i = 0; $i < $count; $i++) {
// bind address
$bind = trim($values[2][$i]);
if ($bind == "127.0.0.1" || $bind == "::1") {
continue;
}
$port = new ListeningPort();
$port->proto = $values[1][$i];
$port->bind = $values[2][$i];
$port->bind = $bind;
$port->port = $values[3][$i];
$port->process = $values[4][$i];
$ports[] = $port;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment