Windows environments provide a group policy setting which allows a regular user to install a Microsoft Windows Installer Package (MSI) with system privileges. This can be discovered in environments where a standard user wants to install an application which requires system privileges and the administrator would  like to avoid to give temporary local administrator access to a user.

From the security point of view this can be abused by an attacker in order to escalate his privileges to the box to SYSTEM.

Identification

Lets assume that we have already compromised a host inside the network and we have a Meterpreter session.

Meterpreter Session – Normal user

The easiest method to determine if this issue exist on the host is to query the following registry keys:

reg query HKCU\SOFTWARE\Policies\Microsoft\Windows\Installer /v AlwaysInstallElevated
reg query HKLM\SOFTWARE\Policies\Microsoft\Windows\Installer /v AlwaysInstallElevated

Query the registry to identify the issue

Privilege Escalation with Metasploit

The easiest and the fastest way to escalate privileges is via the Metasploit Framework which contains a module that can generate an MSI package with a simple payload that it will be executed as SYSTEM on the target host and it will be removed automatically to prevent the installation of being registered with the operating system.

Exploitation of Always Install Elevated with Metasploit

Generate MSI Package with PowerSploit

PowerSploit framework contains a script that can discover whether this issue exist on the host by checking the registry entries and another one that can generate an MSI file that will add a user account into the local administrators group.

PowerSploit – Always Install Elevated

Adding an account into Administrators group

The verification that this user has been added into the local administrator group can be done by running the “net localgroup administrators” command from the command prompt.

Verification that the “backdoor user has been created

Conclusion

Metasploit Framework can be used as well to generate MSI files however the payload will be executed under the privileges of the user running it which in most of the cases it shouldn’t be the administrator. Therefore the PowerSploit script was the only reliable solution to escalate privileges properly.

In order to mitigate this issue the following settings should be disabled from the GPO:

Computer Configuration\Administrative Templates\Windows Components\Windows Installer
User Configuration\Administrative Templates\Windows Components\Windows Installer

GPO -Always Install With Elevated Privileges Setting

GPO – Always Install with Elevated Privileges Setting

通过系统自带的MSI安装包来提权账号的更多相关文章

  1. 找回MSI安装包Win7/Win8管理员身份功能

    找回MSI安装包Win7/Win8管理员身份功能 从Vista开始,系统引入了UAC用户控制功能,即普通用户运行exe软件安装程序,支持使用普通账户/管理员身份分别进行安装,但是msi安装包只支持默认 ...

  2. 绝对干货:自定义msi安装包的执行过程

    有时候我们需要在程序中执行另一个程序的安装,这就需要我们去自定义msi安装包的执行过程. 比如我要做一个安装管理程序,可以根据用户的选择安装不同的子产品.当用户选择了三个产品时,如果分别显示这三个产品 ...

  3. 自己定义msi安装包的运行过程

    有时候我们须要在程序中运行还有一个程序的安装.这就须要我们去自己定义msi安装包的运行过程. 比方我要做一个安装管理程序,能够依据用户的选择安装不同的子产品.当用户选择了三个产品时,假设分别显示这三个 ...

  4. 自定义msi安装包的执行过程

    有时候我们需要在程序中执行另一个程序的安装,这就需要我们去自定义msi安装包的执行过程. 比如我要做一个安装管理程序,可以根据用户的选择安装不同的子产品.当用户选择了三个产品时,如果分别显示这三个产品 ...

  5. 电脑运行msi安装包提示the error code is 2503/2502如何解决

    当在电脑中运行msi安装包时,出现the error code is 2503或者2502错误提示,其实是由于没有运行的权限导致的,但是又不能右击以管理员身份运行,那么应该如何操作呢?对于这样的问题, ...

  6. arcgis安装msi安装包提示"在未标记为正在运行时,调用了RunScript”解决办法

    安装msi安装包提示"在未标记为正在运行时,调用了RunScript”解决办法   windows/temp目录相关权限不对,右击temp文件夹,选择管理员获取所有权限.

  7. 在Win10中,在安装msi安装包的时候常常会出现代码为2502、2503的错误。

    前言:在Win10中,在安装msi安装包的时候常常会出现代码为2502.2503的错误.其实这种错误是由于安装权限不足造成的,可以这种msi的安装包不像其他exe的安装程序,在安装包上点击“右键”之后 ...

  8. Elasticsearch各版本的MSI安装包和Kibana各版本的zip包(Windows)

    elastic各产品下载列表页:https://www.elastic.co/cn/downloads/ 打开Elasticsearch的下载页后看到的是当前最新版本的安装界面,现在最新的版本是7.4 ...

  9. 【原创】DOTNET动态调试破解Spoon,及MSI安装包文件替换技术

    提到Spoon可能大家还会感到陌生,但是如果提及XenoCode那么研究过DOTNET的人应该都知道吧.Spoon的前身就是XenoCode,虽然没有了PostBuild这个混淆软件,但是虚拟化技术仍 ...

随机推荐

  1. XAF-如何修改内置的编辑器(Property Editor)

    本示例演示在web/win中给 日期选择控制显示出一个时钟及修改时间的控件.效果如下: 如果你装了XAF在这个路径中已经有了这个示例: %PUBLIC%\Documents\DevExpress De ...

  2. Angular7运行机制--根据腾讯课堂米斯特吴 《Angular4从入门到实战》学习笔记分析完成

  3. 《算法图解》——第十章 K最近邻算法

    第十章    K最近邻算法 1 K最近邻(k-nearest neighbours,KNN)——水果分类 2 创建推荐系统 利用相似的用户相距较近,但如何确定两位用户的相似程度呢? ①特征抽取 对水果 ...

  4. 宿主机ssh免密登录docker容器

    一.检查系统内核 二.安装docker 1.yum install docker  -y 2.docker version                    #查看docker版本 3.syste ...

  5. ViewPort <meta>标记

    ViewPort <meta>标记用于指定用户是否可以缩放Web页面,如果可以,那么缩放到的最大和最小缩放比例是什么.使用ViewPort <meta>标记还表示文档针对移动设 ...

  6. Amazon.com 购物 信用卡预售期

    I understand and thanks for confirming. In this case, the $1.00 is not a charge.  It is an authoriza ...

  7. 王者荣耀交流协会Beta发布文案美工展示博客

    logo: 我们的logo是蓝底白字,非常简洁大气的设计感,上面印有我们的软件名称,更好的直观的彰显了我们的主题.我们的软件就是要迎合使用者,给使用者更加方便快捷的工作体验,更好的衡量自己的时间分配. ...

  8. Thunder团队第七周 - Scrum会议1

    Scrum会议1 小组名称:Thunder 项目名称:i阅app Scrum Master:杨梓瑞 工作照片: 参会成员: 王航:http://www.cnblogs.com/wangh013/ 李传 ...

  9. 20172314 蓝墨云课堂实践ASL

    由于去跳啦啦操没有上课... 介绍 折半查找,又称作二分查找.这个查找的算法的特点,就是,要求数据要是有序的. 1 ,存储结构一定是顺序存储 2 ,关键字大小必须有序排列 然后,利用这组有序的数据之间 ...

  10. psp项目计划

    日期/任务 听课 编写程序 阅读书籍 查阅资料 日总计 周一 2h 0.5h     2.5 周二     1h   1 周三     1h     周四 2h 0.5h     2.5 周五   3 ...