Credentials are stored in the hosts_creds table, associated with specific hosts. Each credential entry contains type, domain, username, and password fields.
CREATE TABLE hosts_creds( id INTEGER primary key autoincrement not null, host_id integer, type TEXT DEFAULT 'password', domain TEXT DEFAULT '', username TEXT DEFAULT '', password TEXT DEFAULT '')
Each host can have multiple credential sets, enabling you to store different user accounts, hash types, or SSH keys for the same target.
When launching a tool, QtRecon automatically detects if credentials are needed and available:
core/controller.py
# Check if creds are needed and available for this host and commandcreds_from_database = []creds_types = [row['type'] for row in Database.request("SELECT DISTINCT type FROM hosts_creds").fetchall()]for creds_type in creds_types: if f"%%%{creds_type.upper()}%%%" in ' '.join(program['args']): creds_from_database += Database.request( "SELECT DISTINCT hosts_creds.type, hosts_creds.domain, " "hosts_creds.username, hosts_creds.password " "FROM hosts_creds, hosts " "WHERE (host_id = ? AND type = ?) OR " "(hosts.id = hosts_creds.host_id AND " "(lower(domain) != 'localhost' and lower(domain) != lower(hosts.hostname)) " "AND type = ?)", (host_dst['id'], creds_type, creds_type) ).fetchall()if creds_from_database: reply = QMessageBox.question( self.ui, 'Valid credentials are available', f"Valid credentials are available to use against this target. " f"Do you want to use them ?" )
QtRecon prompts you to select which credentials to use when multiple valid options are available for the target.