Exemplo n.º 1
0
    def __init__(self):
        """Instanciate the phpsploit session, it handles configuration
        settings, environment variables, command aliases, http response
        cache and readline history (if readline is available).

        """
        # process parent class init
        super().__init__()

        # session objects declaration
        self.Conf = settings.Settings()
        self.Env = {}
        self.Alias = objects.VarContainer(title="Command Aliases")
        self.Cache = objects.VarContainer(title="HTTP Response Cache")
        self.Hist = history.History()
        self.Compat = {}
        self.File = None
Exemplo n.º 2
0
        print(environ['LDAP'])
        sys.exit(0)
    if len(plugin.argv) < 4:
        print('Missing parameter\n> ldap set VAR value')
        sys.exit(0)
    if plugin.argv[2].upper() in environ['LDAP']:
        environ['LDAP'][plugin.argv[2].upper()] = plugin.argv[3]
    else:
        sys.exit('This setting doesn\'t exist')
    sys.exit(0)

# Connecting to service
if plugin.argv[1].lower() == "connect":
    if 3 < len(plugin.argv) < 5:
        sys.exit("Missing parameter")
    environ['LDAP'] = objects.VarContainer(title="LDAP settings")

    environ['LDAP']['HOST'] = plugin.argv[2]
    environ['LDAP']['LOGIN'] = plugin.argv[3] if len(plugin.argv) > 3 else " "
    environ['LDAP']['PASS'] = plugin.argv[4] if len(plugin.argv) > 4 else " "
    environ['LDAP']['VERSION'] = 3
    sys.exit(0)
# check and load MYSQL_CRED environment variable
if "LDAP" not in environ:
    sys.exit("Not connected to any server, use `ldap connect` before")

# List node
if plugin.argv[1].lower() == "list":
    if len(plugin.argv) < 3:
        sys.exit("Missing parameter")
    payload = server.payload.Payload("list.php")