Introduction¶
Before we start, we need to understand exactly what we are looking for:
-
Local Address 0.0.0.0: The service is listening on all interfaces and will be visible locally, internally, and externally.
If we find a service listening on 0.0.0.0 that was not visible externally during our Nmap scan, it means the firewall is blocking inbound connections to this port. This is a port forwarding opportunity! -
Local Address 127.0.0.1: The service is only listening for connections locally from this host (localhost), not from anywhere else. This is a port forwarding opportunity!
-
Local Address 172.16.1.150: The service is only listening for connections from the local network (internally).Only hosts on the local network can connect to this service. This is a port forwarding opportunity!
Enumerating Open Ports – Manual Method¶
- To enumerate open ports on a Linux host, we can use the following command:
Tips & Tricks
To investigate an internal port, use:
This will display the process details.
Enumerating Open Ports – Automated Method (LinPEAS)¶
- If you don’t already have LinPEAS, download it with the following command:
- Host the LinPEAS script using Python:
- Transfer the script to the target machine using
wget
:
- On the target machine, download and execute LinPEAS:
NOTE
Scrolling down to the Network Information > Active Ports, we can see that it’s the same as the output from netstat, which is actually what LinPEAS uses to pull this info for us.