加入收藏 | 设为首页 | 会员中心 | 我要投稿 河北网 (https://www.hebeiwang.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 业界 > 正文

渗出能力——Windows Token九种权限的操作

发布时间:2018-09-19 08:56:35 所属栏目:业界 来源:嘶吼
导读:【新品产上线啦】51CTO播客,随时随地,碎片化进修 0x00 媒介 平凡用户(可能LocalService用户)的非凡Token有哪些可操作要领呢?可否提权?怎样判定? 本文将要团结本身的履历,参考多个开源器材和资料,实行对这个能力做总结,分享进修心得。 参考的开源器材和
副问题[/!--empirenews.page--] 【新品产上线啦】51CTO播客,随时随地,碎片化进修

0x00 媒介

平凡用户(可能LocalService用户)的非凡Token有哪些可操作要领呢?可否提权?怎样判定?

本文将要团结本身的履历,参考多个开源器材和资料,实行对这个能力做总结,分享进修心得。

参考的开源器材和资料:

  • Hot Potato: https://github.com/foxglovesec/Potato
  • powershell版本Hot Potato: https://github.com/Kevin-Robertson/Tater
  • Rotten Potato: https://github.com/breenmachine/RottenPotatoNG
  • lonelypotato: https://github.com/decoder-it/lonelypotato
  • Juicy Potato: https://github.com/ohpe/juicy-potato
  • https://github.com/hatRiot/token-priv
  • https://foxglovesecurity.com/2017/08/25/abusing-token-privileges-for-windows-local-privilege-escalation/
  • https://foxglovesecurity.com/2016/01/16/hot-potato/
  • https://foxglovesecurity.com/2016/09/26/rotten-potato-privilege-escalation-from-service-accounts-to-system/
  • https://foxglovesecurity.com/2017/08/25/abusing-token-privileges-for-windows-local-privilege-escalation/

0x01 简介

本文将要先容以下内容:

  • 扼要操作思绪
  • SeImpersonatePrivilege权限对应的操作思绪和开源代码
  • SeAssignPrimaryPrivilege权限对应的操作思绪和开源代码
  • SeTcbPrivilege权限对应的操作思绪和开源代码
  • SeBackupPrivilege权限对应的操作思绪和开源代码
  • SeRestorePrivilege权限对应的操作思绪和开源代码
  • SeCreateTokenPrivilege权限对应的操作思绪和开源代码
  • SeLoadDriverPrivilege权限对应的操作思绪和开源代码
  • SeTakeOwnershipPrivilege权限对应的操作思绪和开源代码
  • SeDebugPrivilege权限对应的操作思绪和开源代码

渗出能力——Windows Token九种权限的操作

0x02 扼要操作思绪

1、取得了方针的会见权限后,查察可用权限

whoami /priv

譬喻,平凡用户具有的权限如下图。

渗出能力——Windows Token九种权限的操作

打点员用户具有的权限如下图。

渗出能力——Windows Token九种权限的操作

iis用户具有的权限如下图。

渗出能力——Windows Token九种权限的操作

Privilege Name项暗示具有的权限,State暗示权限的状态,我们可以通过WinAPI AdjustTokenPrivileges将权限配置为Disabled可能Enabled

可供参考的实当代码:

https://github.com/3gstudent/Homework-of-C-Language/blob/master/EnablePrivilegeandGetTokenInformation.cpp

代码实现了开启指定权限(SeDebugPrivilege),而且查察当前用户名称和具有的权限

2、假如包括以下九个权限,我们就可以对其进一步操作

  • SeImpersonatePrivilege
  • SeAssignPrimaryPrivilege
  • SeTcbPrivilege
  • SeBackupPrivilege
  • SeRestorePrivilege
  • SeCreateTokenPrivilege
  • SeLoadDriverPrivilege
  • SeTakeOwnershipPrivilege
  • SeDebugPrivilege

注:

  • iis可能sqlserver的用户凡是具有SeImpersonatePrivilege和SeAssignPrimaryPrivilege权限
  • Backup service用户凡是具有SeBackupPrivilege和SeRestorePrivilege权限

0x03 SeImpersonatePrivilege权限的操作思绪

参考资料:

https://github.com/hatRiot/token-priv/blob/master/abusing_token_eop_1.0.txt#L327

SeImpersonatePrivilege

身份验证后模仿客户端(Impersonatea client after authentication)

拥有该权限的历程可以或许模仿已有的token,但不能建设新的token

以下用户具有该权限:

  • 当地打点员构成员和当地处事帐户
  • 由处事节制打点器启动的处事
  • 由组件工具模子 (COM) 基本布局启动的并设置为在特定帐户下运行的COM处事器

凡是,iis可能sqlserver用户具有该权限

操作思绪

  • 操作NTLM Relay to Local Negotiation得到System用户的Token 可行使开源器材Rotten Potato、lonelypotato可能Juicy Potato
  • 通过WinAPI CreateProcessWithToken建设新历程,传入System用户的Token 具有SeImpersonatePrivilege权限才气建设乐成
  • 该Token具有System权限

可供参考的测试代码:

https://github.com/3gstudent/Homework-of-C-Language/blob/master/EnableSeImpersonatePrivilege.cpp

代码实现了开启当前历程的SeImpersonatePrivilege权限,挪用CreateProcessWithToken,传入当前历程的Token,建设一个历程,共同RottenPotato,可用来从LocalService提权至System权限。

0x04 SeAssignPrimaryPrivilege权限的操作思绪

参考资料:

https://github.com/hatRiot/token-priv/blob/master/abusing_token_eop_1.0.txt#L359

SeAssignPrimaryPrivilege

向历程(新建设可能挂起的历程)分派token

凡是,iis可能sqlserver用户具有该权限

操作思绪1

· 操作NTLM Relay to Local Negotiation得到System用户的Token

· 通过WinAPI CreateProcessAsUser建设新历程,传入System用户的Token

· 该Token具有System权限

可供参考的测试代码:

https://github.com/3gstudent/Homework-of-C-Language/blob/master/EnableSeAssignPrimaryTokenPrivilege.cpp

(编辑:河北网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

热点阅读