Hacking metasploit with metasploit

msfd — Provides an instance of msfconsole that remote clients can connect to
root@kali:~# msfd -h
Usage: msfd <options>
OPTIONS:
-A <opt> Specify list of hosts allowed to connect
-D <opt> Specify list of hosts not allowed to connect
-a <opt> Bind to this IP address instead of loopback
-f Run the daemon in the foreground
-h Help banner
-p <opt> Bind to this port instead of 55554
-q Do not print the banner on startup
-s Use SSLhttps://tools.kali.org/exploitation-tools/metasploit-framework
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.
But how are we going to hack metasploit with metasploit?
for that you need 2 things:
1-identify a network with the msfd service running
2-a system with metasploit to “attack” the metasploit system that is running
In kali I run the msfd service
On my android I run metasploit and do a scan in nmap to validate that the msfd service is running on my kali
using the exploit:
msfd_rce_remote
we are going to configure the rhost with the vulnerable machine (kali linux) and voila, when executing the exploit it gives us a session inside the vulnerable machine. so we are hacking metasploit with metasploit!
Metasploit is a very powerful framework! but if it is configured in an incorrect way it can leave us vulnerable.
Did you already know this method?