Skip to content

Types of MSSQL Users โ€‹

Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)!

Table taken from the docs.

Column nameData typeDescription
namesysnameName of principal, unique within the database.
principal_idintID of principal, unique within the database.
typechar(1)<p>Principal type:

A = Application role

C = User mapped to a certificate

E = External user from Azure Active Directory

G = Windows group

K = User mapped to an asymmetric key

R = Database role

S = SQL user

U = Windows user

X = External group from Azure Active Directory group or applications</p>
type_descnvarchar(60)<p>Description of principal type.

APPLICATION_ROLE

CERTIFICATE_MAPPED_USER

EXTERNAL_USER

WINDOWS_GROUP

ASYMMETRIC_KEY_MAPPED_USER

DATABASE_ROLE

SQL_USER

WINDOWS_USER

EXTERNAL_GROUPS</p>
default_schema_namesysnameName to be used when SQL name does not specify a schema. Null for principals not of type S, U, or A.
create_datedatetimeTime at which the principal was created.
modify_datedatetimeTime at which the principal was last modified.
owning_principal_idintID of the principal that owns this principal. All fixed Database Roles are owned by dbo by default.
sidvarbinary(85)SID (Security Identifier) of the principal. NULL for SYS and INFORMATION SCHEMAS.
is_fixed_rolebitIf 1, this row represents an entry for one of the fixed database roles: db_owner, db_accessadmin, db_datareader, db_datawriter, db_ddladmin, db_securityadmin, db_backupoperator, db_denydatareader, db_denydatawriter.
authentication_typeint<p><strong>Applies to</strong>: SQL Server 2012 (11.x) and later.

Signifies authentication type. The following are the possible values and their descriptions.

0 : No authentication
1 : Instance authentication
2 : Database authentication
3 : Windows authentication
4 : Azure Active Directory authentication</p>
authentication_type_descnvarchar(60)<p><strong>Applies to</strong>: SQL Server 2012 (11.x) and later.

Description of the authentication type. The following are the possible values and their descriptions.

<code>NONE</code> : No authentication
<code>INSTANCE</code> : Instance authentication
<code>DATABASE</code> : Database authentication
<code>WINDOWS</code> : Windows authentication
<code>EXTERNAL</code>: Azure Active Directory authentication</p>
default_language_namesysname<p><strong>Applies to</strong>: SQL Server 2012 (11.x) and later.

Signifies the default language for this principal.</p>
default_language_lcidint<p><strong>Applies to</strong>: SQL Server 2012 (11.x) and later.

Signifies the default LCID for this principal.</p>
allow_encrypted_value_modificationsbit<p><strong>Applies to</strong>: SQL Server 2016 (13.x) and later, SQL Database.

Suppresses cryptographic metadata checks on the server in bulk copy operations. This enables the user to bulk copy data encrypted using Always Encrypted, between tables or databases, without decrypting the data. The default is OFF.</p>
Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)!