如何使用PersistenceSniper搜索Windows系统中的持久化植入程序
关于PersistenceSniper
PersistenceSniper是一款功能强大的PowerShell模块,该工具专为蓝队研究人员、安全应急事件响应人员和系统管理员设计,旨在帮助大家寻找Windows系统中的持久化植入程序。
该工具目前正在积极开发中,可能随时会更新,请确保在使用该工具前已升级到了最新版本。
支持检测的持久化技术
Run Key RunOnce Key Image File Execution Options Natural Language Development Platform 6 DLL Override Path AEDebug Keys Windows Error Reporting Debugger Windows Error Reporting ReflectDebugger Command Prompt AutoRun Explorer Load Winlogon Userinit Winlogon Shell Windows Terminal startOnUserLogin AppCertDlls DLL Injection App Paths Hijacking ServiceDll Hijacking Group Policy Extensions DLLs Winlogon MPNotify CHM Helper DLL Hijacking of hhctrl.ocx Startup Folder User Init Mpr Logon Script AutodialDLL Winsock Injection LSA Extensions DLL ServerLevelPluginDll DNS Server DLL Hijacking LSA Authentication Packages DLL LSA Security Packages DLL Winlogon Notify Packages DLL Explorer Tools Hijacking .NET DbgManagedDebugger cmd Hijacking WMI Subscriptions Windows Services Terminal Services InitialProgram Accessibility Tools Backdoor
工具下载
广大研究人员可以使用下列命令将该项目源码克隆至本地:
git clone https://github.com/last-byte/PersistenceSniper.git
(向右滑动、查看更多)
工具使用
PersistenceSniper的使用非常简单,以管理员权限运行PowerShell,然后运行下列命令:
PS C:\> git clone https://github.com/last-byte/PersistenceSniper
PS C:\> Import-Module .\PersistenceSniper\PersistenceSniper\PersistenceSniper.psd1
PS C:\> Find-AllPersistence
(向右滑动、查看更多)
如果你想保持PersistenceSniper为PowerShell Galley中的最新版本,以管理员权限运行PowerShell,然后运行下列命令即可:
PS C:\> Install-Module PersistenceSniper
PS C:\> Import-Module PersistenceSniper
PS C:\> Find-AllPersistence
(向右滑动、查看更多)
如果你需要了解工具的所有参数和解释,可以在导入模块之后运行下列命令:
Get-Help -Name Find-AllPersistence -Full
如果你想检测单个持久化技术,可以使用Find-AllPersistence的PersistenceMethod参数。比如说,你想通过Run和RunOnce注册表键来检测持久化植入程序,可以运行下列命令:
PS C:\> Find-AllPersistence -PersistenceMethod RunAndRunOnce
(向右滑动、查看更多)
PersistenceSniper的Find-AllPersistence会返回一个包含了PSCustomObject对象的数组,其中包含下列属性:
$PersistenceObject = [PSCustomObject]@{
'ComputerName' = $ComputerName
'Technique' = $Technique
'Classification' = $Classification
'Path' = $Path
'Value' = $Value
'Access Gained' = $AccessGained
'Note' = $Note
'Reference' = $Reference
'Signature' = Find-CertificateInfo (Get-ExecutableFromCommandLine $Value)
'IsBuiltinBinary' = Get-IfBuiltinBinary (Get-ExecutableFromCommandLine $Value)
'IsLolbin' = Get-IfLolBin (Get-ExecutableFromCommandLine $Value)
}
(向右滑动、查看更多)
此时我们就可以对输出进行格式化和过滤了。如果你想查看允许攻击者获取NT AUTHORITY\SYSTEM权限的持久化技术,可以运行下列命令:
PS C:\> Find-AllPersistence | Where-Object "Access Gained" -EQ "System"
(向右滑动、查看更多)
当然了,由于PersistenceSniper是一款基于PowerShell的工具,我们还可以将其输出发送给Out-GridView来通过GUI界面进行交互:
处理假阳性
PersistenceSniper在搜索持久化技术的时候,可能会出现误报的情况,因为很多合法软件也会使用其中的部分技术。为此,我们可以通过创建一个包含已知误报的CSV文件来解决这个问题。
这里我们可以使用Find-AllPersistence,配合其他参数,我们可以直接将查找到的输出保存到一个CSV文件中(或作为输入以对结果分类):
PS C:\> Find-AllPersistence -DiffCSV false_positives.csv
许可证协议
本项目的开发与发布遵循CC0-1.0开源许可证协议。
项目地址
PersistenceSniper:
https://github.com/last-byte/PersistenceSniper
参考资料:
https://www.powershellgallery.com/packages/PersistenceSniper/1.0 https://docs.microsoft.com/en-us/sysinternals/downloads/autoruns https://www.hexacorn.com/blog/2017/01/28/beyond-good-ol-run-key-all-parts/ https://lolbas-project.github.io/ https://twitter.com/dottor_morte
相关文章
- w ndows无法连接到System,Windows无法连接到System Event Notification Service服务解决方法…[通俗易懂]
- windows启动tomcat闪退
- macos安装svn软件_windows安装svn服务器
- Windows编译ollvm_windows交叉编译linux
- windows server 2012r2安装iis_iis启动服务器
- 如何让Windows的命令行窗口CMD以及Powershell支持UTF8字符集(编码)
- Windows安装Python(图解)
- Windows下安装Redis的流程详解
- 使用Windows连接Linux:强大的工具(windows连接linux工具)
- Windows登录MySQL数据库的步骤指南(windows登录mysql)
- 如何在Windows上查看MySQL的版本?(windows查看mysql版本)
- 在Windows系统下安装MySQL数据库(windows下安装mysql)
- windows对比分析:Linux与Windows系统(linuxvss)
- windows三大操作系统:IE,Linux,Windows(ielinux)
- 的windows系统在Linux服务器上挂载Windows系统的操作步骤(linux挂载服务器上)
- Windows与Linux的区别 – 深入比较两个操作系统(windows和linux区别)
- [图]Windows端Office Insider新特性:可通过语音搜索命令/内容
- 和windows简单实用:同时装双系统Linux和Windows(电脑装双系统linux)
- Windows上安装MongoDB:一步一步分解(windows安装mongodb)
- 利用Windows操作远程Linux系统(windows远程linux)
- Linux优越于Windows:更安全、更稳定、更灵活(linux比windows的优势)
- Linux与Windows的异同:二者的对比分析(linux和windows的区别)
- 如何下载适用于Windows 8的MySQL数据库(mysql下载w8)