Hacking Metasploit With Metasploit
The msfd service, which exposes an msfconsole instance to remote clients, can be reached over the network and exploited with a Metasploit module to gain a session on the host running it. The author demonstrates this by running msfd on one machine and using Metasploit on another to obtain a shell.
Msfd allows us to connect to a metasploit session no matter what machine we are on, just by having the service running on the main machine.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the msfd service was bound to a network-reachable address without restricting which hosts may connect, exposing the console to untrusted clients.
Impact
An attacker who can reach the msfd service could obtain a session on the host running it, giving control of that machine.
What the attacker needed
Msfd reachable over the network; attacker has Metasploit installed
The fix
The service should be bound to loopback or restricted to trusted hosts, and only exposed deliberately.
How it was found
- Start the msfd service on the Kali machine.
- From another device running Metasploit, scan with nmap to confirm msfd is reachable.
- Run the msfd_rce_remote exploit with the target host set to the Kali machine.
- Execute the exploit to obtain a session on the target.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
Metasploit is a tool used to test and break into systems. One of its parts, msfd, lets another computer connect to a Metasploit console over the network. If that service is reachable and not locked down, someone else can use Metasploit itself to break into the machine running it, which is what this post shows.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.