from pymetasploit3.msfrpc import MsfRpcClient

client = MsfRpcClient("makemesecurity", ssl=True)

result = {}

# print([m for m in client.modules.exploits])

for exploit in client.modules.exploits:
    #print(exploit.split("/"))
    system, area, name  = exploit.split('/')
    if system in result.keys():
        if area in result[system].keys():
            result[system][area].append(name)
        else:
            result[system][area] = [name]
    else:
        result[system] = {area: []}

print(result)
