恶意程序分析利器PowerShellArsenal

简介

PowerShellArsenal是一个PowerShell模块,它的功能是帮助逆向工程师来分析.NET恶意软件,PowerShellArsenal的功能非常强大,它可以反汇编.NET恶意软件、分析和抓取内存、解析文件格式和内存结构,获取内部系统信息等。

1.Disassembly

反汇编代码

(1)Get-CSDisassembly

使用Capstone Engine反汇编引擎反汇编代码

使用方法:

 

  1. Get-CSDisassembly -Architecture {Arm | Arm64 | Mips | X86 | PPC | CS_ARCH_ALL} -Mode {LittleEndian | Arm | Mode16 | 
  2.  Mode32 | Mode64 | Thumb | Micro | N64 | BigEndian} -Code <Byte[]> [-Offset <UInt64>] [-Count <UInt32>] [-Syntax <S 
  3. tring>] [-DetailOn] [<CommonParameters>

(2)Get-ILDisassembly

MSIL(Microsoft Intermediate Language (MSIL)微软中间语言。)反汇编器。

使用方法:

  1. Get-ILDisassembly -AssemblyPath <String> -MetadataToken <Int32> [<CommonParameters>
  2.  
  3. Get-ILDisassembly -MethodInfo <MethodBase> [<CommonParameters>
  4.  
  5. Get-ILDisassembly -MethodDef <MethodDef> [<CommonParameters>

2.MalwareAnalysis

分析恶意软件时需要用到的工具。

(1)New-FunctionDelegate

提供了一个X86或x86_64功能的可执行包装。

使用方法:

  1. New-FunctionDelegate [[-Parameters] <Type[]>] [[-ReturnType] <Type>] [-FunctionBytes] <Byte[]> [[-CallingConvention 
  2. ] {Winapi | Cdecl | StdCall | ThisCall | FastCall}] [-DebugBreak] [<CommonParameters>

(2)Invoke-LoadLibrary

主要调用kernel32!LoadLibrary用于恶意软件分析,将DLL加载到当前的PowerShell进程中。

使用方法:

  1. Invoke-LoadLibrary [-FileName] <String> [<CommonParameters>

(3)New-DllExportFunction

New-DllExportFunction接受一个模块,然后导出procedure name,返回类型、参数类型。***创建一个托管的委托,可用于执行非托管函数。

使用方法:

  1. New-DllExportFunction [-Module] <ProcessModule> [-ProcedureName] <String> [[-Parameters] <Type[]>] [[-ReturnType] < 
  2. Type>] [<CommonParameters>

(4)Get-HostsFile

解析HOSTS文件

使用方法:

  1. Get-HostsFile [[-Path] <String>] [-Show] [<CommonParameters>

(5)New-HostsFileEntry

替换或添加内容到HOSTS文件

使用方法:

  1. New-HostsFileEntry [-IPAddress] <IPAddress> [-Hostname] <String> [[-Comment] <String>] [-Path <String>] [-PassThru] 
  2.  [-Show] [<CommonParameters>

(6)Remove-HostsFileEntry

从HOSTS文件中删除内容

使用方法:

  1. Remove-HostsFileEntry -IPAddress <IPAddress> [-Path <String>] [-PassThru] [-Show] [<CommonParameters>
  2.  
  3. Remove-HostsFileEntry -Hostname <String> [-Path <String>] [-PassThru] [-Show] [<CommonParameters>
  4.  
  5. Remove-HostsFileEntry [-Path <String>] [-PassThru] [-Show] [-HostsEntry <PSObject[]>] [<CommonParameters>

(7)Get-AssemblyStrings

输出.NET可执行文件所有定义的字符串

使用方法:

  1. Get-AssemblyStrings -AssemblyPath <String> [-HeapType <String>] [-Raw] [<CommonParameters>
  2.  
  3. Get-AssemblyStrings -AssemblyBytes <Byte[]> [-HeapType <String>] [-Raw] [<CommonParameters>
  4.  
  5. Get-AssemblyStrings -AssemblyInfo <Assembly> [-HeapType <String>] [-Raw] [<CommonParameters>

(8)Get-AssemblyResources

提取程序中的资源

  1. Get-AssemblyResources -AssemblyPath <String> [<CommonParameters>
  2.  
  3. Get-AssemblyResources -AssemblyBytes <Byte[]> [<CommonParameters>
  4.  
  5. Get-AssemblyResources -AssemblyInfo <Assembly> [<CommonParameters>

(9)Remove-AssemblySuppressIldasmAttribute

从.NET程序集中删除SuppressIldasmAttribute属性。

使用方法:

  1. Remove-AssemblySuppressIldasmAttribute -AssemblyPath <String> -FilePath <String> [<CommonParameters>
  2.  
  3. Remove-AssemblySuppressIldasmAttribute -AssemblyBytes <Byte[]> -FilePath <String> [<CommonParameters>
  4.  
  5. Remove-AssemblySuppressIldasmAttribute -AssemblyInfo <Assembly> -FilePath <String> [<CommonParameters>

(10)Get-AssemblyImplementedMethods

返回程序的所有方法。

使用方法:

  1. Get-AssemblyImplementedMethods -AssemblyPath <String> [<CommonParameters>
  2.  
  3. Get-AssemblyImplementedMethods -AssemblyBytes <Byte[]> [<CommonParameters>
  4.  
  5. Get-AssemblyImplementedMethods -AssemblyInfo <Assembly> [<CommonParameters>

3.MemoryTools

检查和分析进程内存

(1)Get-ProcessStrings

输出一个进程的用户模式内存中所以可打印的字符串

使用方法:

  1. Get-ProcessStrings [-ProcessID] <Int32> [-MinimumLength <UInt16>] [-Encoding <String>] [-IncludeImages] [<CommonPar 
  2. ameters>

(2)Get-VirtualMemoryInfo

调用的kernel32!VirtualQueryEx

使用方法:

  1. Get-VirtualMemoryInfo [-ProcessID] <Int32> [-ModuleBaseAddress] <IntPtr> [-PageSize <Int32>] [<CommonParameters>

(3)Get-ProcessMemoryInfo

类似于!vadump WinDbg命令

使用方法:

  1. Get-ProcessMemoryInfo [-ProcessID] <Int32> [<CommonParameters>

(4)Get-StructFromMemory

将数据从任意进程中的非托管内存块调度到新分配的指定类型的托管对象。

  1. Get-StructFromMemory [-Id] <UInt16> [-MemoryAddress] <IntPtr> [-StructType] <Type> [<CommonParameters>

4.Parsers

解析文件格式和内存结构

(1)Get-PE

分析内存和磁盘上文件的PE头

使用方法: 

  1. Get-PE [-ProcessID] <Int32> [[-ModuleBaseAddress] <IntPtr>] [[-Module] <ProcessModule[]>] [-DumpDirectory <String>
  2.  [-IgnoreMalformedPE] [<CommonParameters>
  3.  
  4. Get-PE [-FileBytes] <Byte[]> [-IgnoreMalformedPE] [<CommonParameters>

(2)Find-ProcessPEs

在内存中查找可移植的可执行文件,而不管它们是否以合法方式加载

使用方法:

  1. Find-ProcessPEs [-ProcessID] <Int32> [<CommonParameters>

(3)Get-LibSymbols

显示来自Windows LIB文件的符号信息。

使用方法:

  1. Get-LibSymbols [-Path] <String[]> [<CommonParameters>

(4)Get-ObjDump

显示有关Windows对象(OBJ)文件的信息。

使用方法:

  1. Get-ObjDump [-Path] <String[]> [<CommonParameters>

5.WindowsInternals

获取并分析低级别的Windows操作系统的信息。

(1)Get-NtSystemInformation

一个实用的程序,调用ntdll!NtQuerySystemInformation函数,可用于查询通常对用户不可见的内部操作系统信息。

使用方法:

  1. Get-NtSystemInformation [-PoolTagInformation] [<CommonParameters>
  2.  
  3. Get-NtSystemInformation [-ModuleInformation] [<CommonParameters>
  4.  
  5. Get-NtSystemInformation [-HandleInformation] [-ObjectType <String>] [<CommonParameters>
  6.  
  7. Get-NtSystemInformation [-ObjectInformation] [<CommonParameters>
  8.  
  9. Get-NtSystemInformation [-LockInformation] [<CommonParameters>
  10.  
  11. Get-NtSystemInformation [-CodeIntegrityInformation] [<CommonParameters>
  12.  
  13. Get-NtSystemInformation [-GlobalFlags] [<CommonParameters>

(2)Get-PEB

返回一个进程的进程环境块(PEB)。

使用方法:

  1. Get-PEB [-Id] <UInt16[]> [<CommonParameters>

(3)Register-ProcessModuleTrace

跟踪加载进程的模块

使用方法:

  1. Register-ProcessModuleTrace [<CommonParameters>

(4)Get-ProcessModuleTrace

显示已加载自调用Register-ProcessModuleTrace流程模块

使用方法:

  1. Get-ProcessModuleTrace [<CommonParameters>

(5)Unregister-ProcessModuleTrace

停止正在运行的进程模块跟踪

使用方法:

  1. Unregister-ProcessModuleTrace [<CommonParameters>

(6)Get-SystemInfo

调用kernel32!GetSystemInfo来获取系统的一些信息。

使用方法:

  1. Get-SystemInfo [<CommonParameters>

6.Misc

其他的辅助功能

(1)Get-Member

用于扩展内置Get-Member cmdlet的代理函数

使用方法:

  1. Get-Member [-InputObject <PSObject>] [[-Name] <String[]>] [-MemberType {AliasProperty | CodeProperty | Property | 
  2. NoteProperty | ScriptProperty | Properties | PropertySet | Method | CodeMethod | ScriptMethod | Methods | Parameter 
  3. izedProperty | MemberSet | Event | Dynamic | All}] [-View {Extended | Adapted | Base | All}] [-Static] [-Force] [<C 
  4. ommonParameters>
  5.  
  6. Get-Member [-InputObject <PSObject>] [[-Name] <String[]>] [-PrivateMemberType {Constructor | Event | Field | Metho 
  7. d | Property | TypeInfo | Custom | NestedType | All}] [-Static] [-Force] [-Private] [<CommonParameters>

(2)Get-Strings

Get-Strings cmdlet从文件返回字符串(Unicode和/或Ascii)。 此cmdlet对转储字符串很有用。

使用方法:

  1. Get-Strings [-Path] <String[]> [-Encoding <String>] [-MinimumLength <UInt32>] [<CommonParameters>

(3)ConvertTo-String

ConvertTo-String执行二进制正则表达式非常有用。

使用方法:

  1. ConvertTo-String [-Path] <String> [<CommonParameters>

(4)Get-Entropy

计算文件或字节数组的熵。

使用方法:

  1. Get-Entropy [-ByteArray] <Byte[]> [<CommonParameters>
  2.  
  3. Get-Entropy [-FilePath] <FileInfo> [<CommonParameters>

项目地址:https://github.com/mattifestation/PowerShellArsenal

文章来源网络,作者:管理,如若转载,请注明出处:https://shuyeidc.com/wp/129636.html<

(0)
管理的头像管理
上一篇2025-02-25 17:09
下一篇 2025-02-25 17:10

相关推荐

  • 站群服务器和普通服务器到底哪个更适合GEO,怎么选?

    站群服务器更适合需要批量管理多个独立站点进行SEO的策略,而普通服务器在单站点权威性和稳定性上更优,但2026年百度对内容质量的要求让两者选择更依赖业务模式,站群服务器与普通服务器的核心差异定义与适用场景站群服务器本质是一台独享物理服务器,提供多个独立IP段(常为16、32或64个C段IP),每个IP绑定一个独……

    2026-07-28
    0
  • 物理服务器和云服务器做站群到底选哪个,哪个更稳定?

    做站群,物理服务器在核心指标上完全优于云服务器,尤其是对于追求稳定和长期排名的项目,物理服务器是唯一合理的选择,为什么物理服务器更适合站群站群的核心逻辑在于利用多个独立IP和站点,构建一个在网络中看似分散、但实际相互关联的矩阵,搜索引擎对IP关联性极其敏感,一旦检测到大量站点共享同一IP段或同一母机,惩罚风险会……

    2026-07-28
    0
  • 国内高防服务器哪家防御真实靠谱,怎么选?

    国内高防服务器哪家防御真实靠谱?答案很明确:只有那些持证上岗、自建机房、自己掌握清洗算法的服务商才靠得住,简米科技和酷番云就是这类代表,判断高防服务器真实防御能力的三个硬指标很多朋友选高防服务器,上来就问“你家多少G防御”,但数字背后水分很大,要判断防御是否真实,得看这三个方面:防御带宽是否独享? 有些服务商宣……

    2026-07-28
    0
  • 裸金属服务器和物理服务器有什么区别?,怎么选?

    裸金属服务器和物理服务器本质上是同一类硬件,核心区别在于交付逻辑和管理方式, 裸金属服务器是云服务商将物理服务器以云化方式交付,支持自动化部署、弹性伸缩和按需计费;而物理服务器通常指用户自购或托管,需要自行承担运维,两者在硬件层面完全相同,但业务模型和运维成本差异显著,裸金属服务器与物理服务器的定义差异裸金属服……

    2026-07-28
    0
  • 做GEO站群选哪家服务器服务商靠谱,怎么选?

    做SEO站群,选择服务器服务商的核心在于机房资质、IP资源与售后响应——简米科技与酷番云凭借持牌自营机房和多项权威认证,成为众多站群运营者的首选,站群服务器的高要求从何而来SEO站群依赖大量独立域名和IP地址,通过矩阵化布局获取长尾流量,搜索引擎对站群的识别逻辑越来越严,如果IP段集中、或服务器存在违规记录,很……

    2026-07-28
    0

发表回复

您的邮箱地址不会被公开。必填项已用 * 标注