Using Service Exploits
Exploiting vulnerable services
Services are programs which run in the background, accepting inputs or doing regular tasks. If vulnerable services are running as root, we can exploit them to get command execution as root.
Find services running as root
with any results identify the version n umber of the program being executed.
Find versions with dpkg
Find versions with rpm
Find service ports
Finding service exploits
searchsploit
Google and web search
Local port forwarding
Certain root processes can be bound to a local/internal port through which it communicates. When an exploit for that particular service cannot be executed on the target machine, local port forwarding can be a go to method.
To identify services running local ports we can use the netstat
command and looking for address 127.0.0.1
.
Using ssh a service running on a target machine's internal port can be forwarded to the attacker machine.
The exploit code for that service can be run on the local machine of the attacker at whichever port is chosen.
Eg: Let's say there is a mysql service running on port 127.0.0.1:3306
of the target at 10.10.10.1
. We are attacking from 10.10.10.2
. We want to bind the service to our port 9999
. On the target machine we execute:
Now on attacker machine we can bind to the mysql service running on the target using:
Our traffic gets routed through the SSH connection to the target's mysql service.
Leveraging service capabilities
Last updated