Resubmitting @jlee-r7's #2505 with fixes

Since msfcli blew up.