rapid7 / metasploit-framework

Metasploit Framework
https://www.metasploit.com/
Other
32.92k stars 13.72k forks source link

Delete hosts without services msf_db #19155

Open Danny-Cap opened 2 weeks ago

Danny-Cap commented 2 weeks ago

Hi guys, similar to this question: https://github.com/rapid7/metasploit-framework/issues/11114

I'm looking for a way to delete all the hosts from my workspace database that have no services.

Normally you would just filter on the "0" service_count column and delete them.

However, by trying this.. hosts -c address,service_count -S 0

The "0" also matches on the IP addresses and thus also show hosts WITH services..

How can i filter this so that only hosts without services show up and can simply add the "-d" parameter to delete them.


Note, hosts -c service_count -S 0 still matches the 0 on IP addresses, even though they dont show up