This sample PowerShell script compares the files in two different paths by calculating and comparing hashes for each file. I use it to compare my backup to the source data, after the backup is complete. 复制 $SourcePath = "D:\" $BackupPath = "F:\Backup 2018-05-27\" Wr...
@{ a = @{ b = @{ c = @{ d ="e"}}} |ConvertTo-Json{"a": {"b": {"c":"System.Collections.Hashtable"} } } 使用Depth參數,以確保您已展開所有巢狀哈希表。 PowerShell @{ a = @{ b = @{ c = @{ d ="e"}}} |ConvertTo-Json-Depth3{"a": {"b": {"c": {"d":"e...
Check-LocalAdminHash是一款基于PowerShell开发的工具,它可以尝试通过WMI或SMB来对多台主机进行身份验证,并通过密码哈希来判断用户提供的凭证是否属于本地管理员账户。
最近单位在做等保测评,由本人从事安全运维方面的工作(PS:曾经做过等保等方面的安全服务),所以自然而然的与信安的测评人员一起对接相关业务系统的检查,在做主机系统测评检查时发现了系统中某些配置不符合等保要求,需要对不满足要求的主机做进一步整改,好在我们众多的系统基本都是运行在虚拟机上搭建的kubernetes集群中,这...
The 'Foo' environment variable is set to: An example An example! 在PowerShell 中,环境变量不能设置为空字符串。 将环境变量设置为$null或空字符串会将其从当前会话中删除。 例如: PowerShell复制 $Env:Foo=''$Env:Foo|Get-Member-MemberTypeProperties ...
Check-LocalAdminHash is a PowerShell tool that attempts to authenticate to multiple hosts over either WMI or SMB using a password hash to determine if the provided credential is a local administrator. It's useful if you obtain a password hash for a user and want to see where they are loca...
Invoke-TheHash项目是一个基于.Net TCPClient,通过把NTLM hash传递给NTLMv2身份验证协议来进行身份验证的攻击套件,且执行时客户端不需要本地管理员权限。 安装环境 PowerShell 2.0及以上。 导入 Import-Module ./Invoke-TheHash.psd1 或 . ./Invoke-WMIExec.ps1 . ./Invoke-SMBExec.ps1 . ./Invoke-SMBEnum....
PS> Check-VM 测试 Copy-VSS 这个脚本利用Volume Shadow Copy 服务来复制出SAM文件。如果这个脚本运行在了DC机上ntds.dit和SYSTEM hive也能被拷贝出来。 执行方式: PS > Copy-VSS//将会直接把文件保存在当前路径下PS > Copy-VSS -DestinationDir C:temp//指定保存文件的路径(必须是已经存在的路径) ...
API 通常需要传递的标头来进行身份验证或验证等操作。 此示例演示了如何将多个标头从 hash-table 传递到 REST API。 PowerShell 复制 $headers = @{ 'userId' = 'UserIDValue' 'token' = 'TokenValue' } Invoke-RestMethod -Uri $uri -Method Post -Headers $headers -Body $body...
Command to check for user logged into which server in a domain environment. Command to extract pager attribute from Active Directory Command to fetch a list of particular job title Command to find out office bit version for remote computers Command to goto start of script Command to retrieve res...