本文讲的是
PowerShell安全专题之 PS5 安全增强功能,
PowerShell v5 是一个 RTM版本。(截至 2015/12/18)。在此之前的八月起,有一个"生产预览版"可用,这意味着它不是最后的版本。随着 PowerShell v5 最终版的正式发布,我强烈建议你
下载 PowerShell v5
并开始测试准备生产部署。
1.开发 Windows PowerShell 的类 2.足够的管理功能 (JEA) 3.提取和解析字符串内容中的结构化对象 4.为 Windows PowerShell 远程调试提供了更多的控制 5.PowerShell 信息流 6.一些新的和已更新的以及基于社区的反馈的 cmdlet 7.ODataUtils 生成基于 OData 端点的 Windows PowerShell cmdlet 8.通过新的 cmdlet 管理 ZIP 文档 9.使用改进的cmdlet 与符号链接进行交互 10.在 Windows PowerShell ISE 中改进了 DSC 创作 11.DSC 配置关键字支持 32 位 12.通过转录和日志记录的方式审计 Windows PowerShell 使用 13.可以用元配置属性配置 DSC 的本地配置管理器 14.用 DSC 的部分配置进行其他配置 15.管理 DSC 中跨计算机的依赖项 16.在 DSC 中有了更多的控制权配置 17.在 DSC 中可以找到有关配置状态的更多详细信息 18.在 DSC 配置编译过程中支持 -? 19.支持 DSC RunAsCredential 20.丰富了DSC LCM 状态信息 21.DSC 资源和 PowerShell 模块的安装同步 22.PSDesiredStateConfiguration 模块版本更新到 1.1 23.DSC 的报告配置状态集中到了同一个位置 24.可以使用 PackageManagement 发现并安装软件 25.可以使用 PowerShellGet 发现 PowerShell 模块、 PowerShell 脚本和 DSC 资源 26.可以使用 Windows PowerShell管理网络交换机 27.软件清单记录 (SIL)
脚本块日志记录 完整的脚本副本记录 约束模式 反恶意软件集成也叫 AMSI(Windows 10)
## Malware function SuperDecrypt { param($script) $bytes = [Convert]::FromBase64String($script) ## XOR “encryption” $xorKey = 0x42 for($counter = 0; $counter -lt $bytes.Length; $counter++) { $bytes[$counter] = $bytes[$counter] -bxor $xorKey } [System.Text.Encoding]::Unicode.GetString($bytes) } $decrypted = SuperDecrypt “FUIwQitCNkInQm9CCkItQjFCNkJiQmVCEkI1QixCJkJlQg==” Invoke-Expression $decrypted
Start time User Name RunAs User Machine (Operating System) Host Application Process ID
IncludeInvocationHeader —— 包括每个运行的命令的开始时间。 OutputDirectory —— 把副本文件写到一个中心位置上,例如网络共享。
md c:Transcripts ## Kill all inherited permissions $acl = Get-Acl c:Transcripts $acl.SetAccessRuleProtection($true, $false) ## Grant Administrators full control $administrators = [System.Security.Principal.NTAccount] “Administrators” $permission = $administrators,”FullControl”,”ObjectInherit,ContainerInherit”,”None”,”Allow” $accessRule = New-Object System.Security.AccessControl.FileSystemAccessRule $permission $acl.AddAccessRule($accessRule) ## Grant everyone else Write and ReadAttributes. This prevents users from listing ## transcripts from other machines on the domain. $everyone = [System.Security.Principal.NTAccount] “Everyone” $permission = $everyone,”Write,ReadAttributes”,”ObjectInherit,ContainerInherit”,”None”,”Allow” $accessRule = New-Object System.Security.AccessControl.FileSystemAccessRule $permission $acl.AddAccessRule($accessRule) ## Deny “Creator Owner” everything. This prevents users from ## viewing the content of previously written files. $creatorOwner = [System.Security.Principal.NTAccount] “Creator Owner” $permission = $creatorOwner,”FullControl”,”ObjectInherit,ContainerInherit”,”InheritOnly”,”Deny” $accessRule = New-Object System.Security.AccessControl.FileSystemAccessRule $permission $acl.AddAccessRule($accessRule) ## Set the ACL $acl | Set-Acl c:Transcripts ## Create the SMB Share, granting Everyone the right to read and write files. Specific ## actions will actually be enforced by the ACL on the file folder. New-SmbShare -Name Transcripts -Path c:Transcripts -ChangeAccess Everyone
Windows Components(Windows 组件) -> Administrative Templates (管理模板) -> Windows PowerShell -> Turn on PowerShell Transcription
HKLM:SoftwarePoliciesMicrosoftWindowsPowerShellTranscription
原文发布时间为:2017年2月7日
本文作者:丝绸之路
本文来自云栖社区合作伙伴嘶吼,了解相关信息可以关注嘶吼网站。