Powershell UAC绕过计划任务失败

问题描述 投票:0回答:1

当运行脚本(在附带的Hak5视频上概述)时,它在schtasks部分失败

尝试按命令运行脚本并在powershell调试器失败,错误“schtasks.exe:错误:文件名,目录名称....不正确”我添加了一个“?”到文件的末尾然后提示以下内容:“提供以下参数的值:FilterScript:”但是根据视频(如下所示),脚本仍然不会创建c:\ Windows \ uacbypass目录

视频:https://www.youtube.com/watch?v=C9GfMfFjhYI

代码:https://forums.hak5.org/topic/45439-powershell-real-uac-bypass/

powershell exploit
1个回答
1
投票

并非所有操作系统和/或PowerShell版本都提供了所有cmdlet。

Get-ItemPropertyValue在Win10上运行PSv5,

(Get-CimInstance -ClassName CIM_OperatingSystem).Caption
$PSVersionTable
Get-Command -Name 'Get-ItemPropertyValue' | Format-Table -AutoSize

# Results

Microsoft Windows 10 Pro

Name                           Value
----                           -----
PSVersion                      5.1.17763.316
PSEdition                      Desktop      
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0, 5.0, 5.1.17763.316}
BuildVersion                   10.0.17763.316
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1


CommandType Name                  Version Source                         
----------- ----                  ------- ------                         
Cmdlet      Get-ItemPropertyValue 3.1.0.0 Microsoft.PowerShell.Management

但是如果你在运行PSv4的WS2012R2上尝试过这个,那么它就不存在了

(Get-CimInstance -ClassName CIM_OperatingSystem).Caption
$PSVersionTable
Get-Command -Name 'Get-ItemPropertyValue' | Format-Table -AutoSize

# Results

Microsoft Windows Server 2012 R2 Standard

Name                           Value
----                           -----
PSVersion                      4.0
WSManStackVersion              3.0
SerializationVersion           1.1.0.1
CLRVersion                     4.0.30319.42000
BuildVersion                   6.3.9600.19170
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0}
PSRemotingProtocolVersion      2.2    

Get-Command : The term 'Get-ItemPropertyValue' is not recognized as the name of a cmdlet, ...

其次,根据您所使用的操作系统,对于windir来说,需要考虑的事项。请参阅下面的问答。

WINDIR environment variable resolves to %SystemRoot% and not C:\windows

即使有了上述内容,您仍然必须成为管理员才能使用此功能。

© www.soinside.com 2019 - 2024. All rights reserved.