Skip to content
RCE Write-up Beginner

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.

_Y000_ Follow

Published on infosecwriteups.com

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.

_Y000_, on infosecwriteups.com

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

  1. Start the msfd service on the Kali machine.
  2. From another device running Metasploit, scan with nmap to confirm msfd is reachable.
  3. Run the msfd_rce_remote exploit with the target host set to the Kali machine.
  4. 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.

More by _Y000_

View all

3 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.