> For the complete documentation index, see [llms.txt](https://hacktricks.xsx.tw/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hacktricks.xsx.tw/network-services-pentesting/pentesting-mssql-microsoft-sql-server/types-of-mssql-users.md).

# Types of MSSQL Users

<details>

<summary><strong>从零开始学习AWS黑客技术，成为专家</strong> <a href="https://training.hacktricks.xyz/courses/arte"><strong>htARTE（HackTricks AWS红队专家）</strong></a><strong>！</strong></summary>

* 您在**网络安全公司**工作吗？ 想要在HackTricks中看到您的**公司广告**？ 或者想要访问**PEASS的最新版本或下载HackTricks的PDF**？ 请查看[**订阅计划**](https://github.com/sponsors/carlospolop)！
* 探索[**PEASS家族**](https://opensea.io/collection/the-peass-family)，我们的独家[NFT收藏品](https://opensea.io/collection/the-peass-family)
* 获取[**官方PEASS和HackTricks周边产品**](https://peass.creator-spring.com)
* **加入** [**💬**](https://emojipedia.org/speech-balloon/) [**Discord群**](https://discord.gg/hRep4RUj7f) 或 [**电报群**](https://t.me/peass) 或在**Twitter**上关注我 🐦[**@carlospolopm**](https://twitter.com/hacktricks_live)**。**
* 通过向[hacktricks repo](https://github.com/carlospolop/hacktricks)和[hacktricks-cloud repo](https://github.com/carlospolop/hacktricks-cloud)提交PR来分享您的黑客技巧。

</details>

表格摘自[**文档**](https://learn.microsoft.com/en-us/sql/relational-databases/system-catalog-views/sys-database-principals-transact-sql?view=sql-server-ver16)。

| 列名                                         | 数据类型              | 描述                                                                                                                                                                                                                                                   |
| ------------------------------------------ | ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **name**                                   | **sysname**       | 数据库内唯一的主体名称。                                                                                                                                                                                                                                         |
| **principal\_id**                          | **int**           | 数据库内唯一的主体ID。                                                                                                                                                                                                                                         |
| **type**                                   | **char(1)**       | <p>主体类型：<br><br>A = 应用程序角色<br><br>C = 映射到证书的用户<br><br>E = 来自Azure活动目录的外部用户<br><br>G = Windows组<br><br>K = 映射到非对称密钥的用户<br><br>R = 数据库角色<br><br>S = SQL用户<br><br>U = Windows用户<br><br>X = 来自Azure活动目录组或应用程序的外部组</p>                                    |
| **type\_desc**                             | **nvarchar(60)**  | <p>主体类型的描述。<br><br>APPLICATION\_ROLE<br><br>CERTIFICATE\_MAPPED\_USER<br><br>EXTERNAL\_USER<br><br>WINDOWS\_GROUP<br><br>ASYMMETRIC\_KEY\_MAPPED\_USER<br><br>DATABASE\_ROLE<br><br>SQL\_USER<br><br>WINDOWS\_USER<br><br>EXTERNAL\_GROUPS</p>       |
| **default\_schema\_name**                  | **sysname**       | 当SQL名称未指定模式时要使用的名称。对于不是S、U或A类型的主体，为空。                                                                                                                                                                                                                |
| **create\_date**                           | **datetime**      | 创建主体的时间。                                                                                                                                                                                                                                             |
| **modify\_date**                           | **datetime**      | 上次修改主体的时间。                                                                                                                                                                                                                                           |
| **owning\_principal\_id**                  | **int**           | 拥有此主体的主体ID。所有固定数据库角色默认由**dbo**拥有。                                                                                                                                                                                                                    |
| **sid**                                    | **varbinary(85)** | 主体的SID（安全标识符）。对于SYS和INFORMATION SCHEMAS为NULL。                                                                                                                                                                                                        |
| **is\_fixed\_role**                        | **bit**           | 如果为1，则此行表示固定数据库角色之一的条目：db\_owner、db\_accessadmin、db\_datareader、db\_datawriter、db\_ddladmin、db\_securityadmin、db\_backupoperator、db\_denydatareader、db\_denydatawriter。                                                                              |
| **authentication\_type**                   | **int**           | <p><strong>适用于</strong>：SQL Server 2012（11.x）及更高版本。<br><br>表示认证类型。以下是可能的值及其描述。<br><br>0：无认证<br>1：实例认证<br>2：数据库认证<br>3：Windows认证<br>4：Azure活动目录认证</p>                                                                                                 |
| **authentication\_type\_desc**             | **nvarchar(60)**  | <p><strong>适用于</strong>：SQL Server 2012（11.x）及更高版本。<br><br>认证类型的描述。以下是可能的值及其描述。<br><br><code>NONE</code>：无认证<br><code>INSTANCE</code>：实例认证<br><code>DATABASE</code>：数据库认证<br><code>WINDOWS</code>：Windows认证<br><code>EXTERNAL</code>：Azure活动目录认证</p> |
| **default\_language\_name**                | **sysname**       | <p><strong>适用于</strong>：SQL Server 2012（11.x）及更高版本。<br><br>表示此主体的默认语言。</p>                                                                                                                                                                           |
| **default\_language\_lcid**                | **int**           | <p><strong>适用于</strong>：SQL Server 2012（11.x）及更高版本。<br><br>表示此主体的默认LCID。</p>                                                                                                                                                                         |
| **allow\_encrypted\_value\_modifications** | **bit**           | <p><strong>适用于</strong>：SQL Server 2016（13.x）及更高版本，SQL数据库。<br><br>在批量复制操作中抑制服务器上的加密元数据检查。这使用户可以在不解密数据的情况下，在表或数据库之间批量复制使用Always Encrypted加密的数据。默认为OFF。</p>                                                                                            |

<details>

<summary><strong>从零开始学习AWS黑客技术，成为专家</strong> <a href="https://training.hacktricks.xyz/courses/arte"><strong>htARTE（HackTricks AWS红队专家）</strong></a><strong>！</strong></summary>

* 您在**网络安全公司**工作吗？ 想要在HackTricks中看到您的**公司广告**？ 或者想要访问**PEASS的最新版本或下载HackTricks的PDF**？ 请查看[**订阅计划**](https://github.com/sponsors/carlospolop)！
* 探索[**PEASS家族**](https://opensea.io/collection/the-peass-family)，我们的独家[NFT收藏品](https://opensea.io/collection/the-peass-family)
* 获取[**官方PEASS和HackTricks周边产品**](https://peass.creator-spring.com)
* **加入** [**💬**](https://emojipedia.org/speech-balloon/) [**Discord群**](https://discord.gg/hRep4RUj7f) 或 [**电报群**](https://t.me/peass) 或在**Twitter**上关注我 🐦[**@carlospolopm**](https://twitter.com/hacktricks_live)**。**
* 通过向[hacktricks repo](https://github.com/carlospolop/hacktricks)和[hacktricks-cloud repo](https://github.com/carlospolop/hacktricks-cloud)提交PR来分享您的黑客技巧。

</details>
