當前位置:
首頁 > 新聞 > 惡意程序分析利器PowerShellArsenal

惡意程序分析利器PowerShellArsenal

簡介


PowerShellArsenal是一個PowerShell模塊,它的功能是幫助逆向工程師來分析.NET惡意軟體,PowerShellArsenal的功能非常強大,它可以反彙編.NET惡意軟體、分析和抓取內存、解析文件格式和內存結構,獲取內部系統信息等。

Disassembly


反彙編代碼


Get-CSDisassembly


使用Capstone Engine反彙編引擎反彙編代碼


使用方法:


Get-CSDisassembly -Architecture {Arm | Arm64 | Mips | X86 | PPC | CS_ARCH_ALL} -Mode {LittleEndian | Arm | Mode16 |
Mode32 | Mode64 | Thumb | Micro | N64 | BigEndian} -Code [-Offset ] [-Count ] [-Syntax ] [-DetailOn] []


Get-ILDisassembly


MSIL(Microsoft Intermediate Language (MSIL)微軟中間語言。)反彙編器。


使用方法:



Get-ILDisassembly -AssemblyPath -MetadataToken []
Get-ILDisassembly -MethodInfo [] Get-ILDisassembly -MethodDef []


MalwareAnalysis


分析惡意軟體時需要用到的工具。


New-FunctionDelegate


提供了一個X86或x86_64功能的可執行包裝。


使用方法:



New-FunctionDelegate [[-Parameters] ] [[-ReturnType] ] [-FunctionBytes] [[-CallingConvention
] {Winapi | Cdecl | StdCall | ThisCall | FastCall}] [-DebugBreak] []


Invoke-LoadLibrary


主要調用kernel32!LoadLibrary用於惡意軟體分析,將DLL載入到當前的PowerShell進程中。


使用方法:



Invoke-LoadLibrary [-FileName] []


New-DllExportFunction


New-DllExportFunction接受一個模塊,然後導出procedure name,返回類型、參數類型。最後創建一個託管的委託,可用於執行非託管函數。


使用方法:



New-DllExportFunction [-Module] [-ProcedureName] [[-Parameters] ] [[-ReturnType] <
Type>] []


Get-HostsFile


解析HOSTS文件


使用方法:



Get-HostsFile [[-Path] ] [-Show] []


New-HostsFileEntry


替換或添加內容到HOSTS文件


使用方法:



New-HostsFileEntry [-IPAddress] [-Hostname] [[-Comment] ] [-Path ] [-PassThru]
[-Show] []


Remove-HostsFileEntry


從HOSTS文件中刪除內容


使用方法:



Remove-HostsFileEntry -IPAddress [-Path ] [-PassThru] [-Show] []
Remove-HostsFileEntry -Hostname [-Path ] [-PassThru] [-Show] [] Remove-HostsFileEntry [-Path ] [-PassThru] [-Show] [-HostsEntry ] []


Get-AssemblyStrings


輸出.NET可執行文件所有定義的字元串


使用方法:



Get-AssemblyStrings -AssemblyPath [-HeapType ] [-Raw] []
Get-AssemblyStrings -AssemblyBytes [-HeapType ] [-Raw] [] Get-AssemblyStrings -AssemblyInfo [-HeapType ] [-Raw] []


Get-AssemblyResources


提取程序中的資源



Get-AssemblyResources -AssemblyPath []
Get-AssemblyResources -AssemblyBytes [] Get-AssemblyResources -AssemblyInfo []


Remove-AssemblySuppressIldasmAttribute


從.NET程序集中刪除SuppressIldasmAttribute屬性。


使用方法:



Remove-AssemblySuppressIldasmAttribute -AssemblyPath -FilePath []
Remove-AssemblySuppressIldasmAttribute -AssemblyBytes -FilePath [] Remove-AssemblySuppressIldasmAttribute -AssemblyInfo -FilePath []


Get-AssemblyImplementedMethods


返回程序的所有方法。


使用方法:



Get-AssemblyImplementedMethods -AssemblyPath []
Get-AssemblyImplementedMethods -AssemblyBytes [] Get-AssemblyImplementedMethods -AssemblyInfo []


MemoryTools


檢查和分析進程內存


Get-ProcessStrings


輸出一個進程的用戶模式內存中所以可列印的字元串


使用方法:



Get-ProcessStrings [-ProcessID] [-MinimumLength ] [-Encoding ] [-IncludeImages] [ameters>]


Get-VirtualMemoryInfo


調用的kernel32!VirtualQueryEx


使用方法:



Get-VirtualMemoryInfo [-ProcessID] [-ModuleBaseAddress] [-PageSize ] []


Get-ProcessMemoryInfo


類似於!vadump WinDbg命令


使用方法:



Get-ProcessMemoryInfo [-ProcessID] []


Get-StructFromMemory


將數據從任意進程中的非託管內存塊調度到新分配的指定類型的託管對象。



Get-StructFromMemory [-Id] [-MemoryAddress] [-StructType] []


Parsers


解析文件格式和內存結構


Get-PE


分析內存和磁碟上文件的PE頭


使用方法: Get-PE [-FilePath] [-IgnoreMalformedPE] []



Get-PE [-ProcessID] [[-ModuleBaseAddress] ] [[-Module] ] [-DumpDirectory ]
[-IgnoreMalformedPE] [] Get-PE [-FileBytes] [-IgnoreMalformedPE] []


Find-ProcessPEs


在內存中查找可移植的可執行文件,而不管它們是否以合法方式載入


使用方法:



Find-ProcessPEs [-ProcessID] []


Get-LibSymbols


顯示來自Windows LIB文件的符號信息。


使用方法:



Get-LibSymbols [-Path] []


Get-ObjDump


顯示有關Windows對象(OBJ)文件的信息。


使用方法:



Get-ObjDump [-Path] []



WindowsInternals


獲取並分析低級別的Windows操作系統的信息。


Get-NtSystemInformation


一個實用的程序,調用ntdll!NtQuerySystemInformation函數,可用於查詢通常對用戶不可見的內部操作系統信息。


使用方法:



Get-NtSystemInformation [-PoolTagInformation] []
Get-NtSystemInformation [-ModuleInformation] [] Get-NtSystemInformation [-HandleInformation] [-ObjectType ] [] Get-NtSystemInformation [-ObjectInformation] [] Get-NtSystemInformation [-LockInformation] [] Get-NtSystemInformation [-CodeIntegrityInformation] [] Get-NtSystemInformation [-GlobalFlags] []


Get-PEB


返回一個進程的進程環境塊(PEB)。


使用方法:



Get-PEB [-Id] []


Register-ProcessModuleTrace


跟蹤載入進程的模塊


使用方法:



Register-ProcessModuleTrace []


Get-ProcessModuleTrace


顯示已載入自調用Register-ProcessModuleTrace流程模塊


使用方法:



Get-ProcessModuleTrace []


Unregister-ProcessModuleTrace


停止正在運行的進程模塊跟蹤


使用方法:



Unregister-ProcessModuleTrace []


Get-SystemInfo


調用kernel32!GetSystemInfo來獲取系統的一些信息。


使用方法:



Get-SystemInfo []



Misc


其他的輔助功能


Get-Member


用於擴展內置Get-Member cmdlet的代理函數


使用方法:



Get-Member [-InputObject ] [[-Name] ] [-MemberType {AliasProperty | CodeProperty | Property |
NoteProperty | ScriptProperty | Properties | PropertySet | Method | CodeMethod | ScriptMethod | Methods | Parameter izedProperty | MemberSet | Event | Dynamic | All}] [-View {Extended | Adapted | Base | All}] [-Static] [-Force] [] Get-Member [-InputObject ] [[-Name] ] [-PrivateMemberType {Constructor | Event | Field | Metho d | Property | TypeInfo | Custom | NestedType | All}] [-Static] [-Force] [-Private] []


Get-Strings


Get-Strings cmdlet從文件返回字元串(Unicode和/或Ascii)。 此cmdlet對轉儲字元串很有用。


使用方法:



Get-Strings [-Path] [-Encoding ] [-MinimumLength ] []


ConvertTo-String


ConvertTo-String執行二進位正則表達式非常有用。


使用方法:



ConvertTo-String [-Path] []


Get-Entropy


計算文件或位元組數組的熵。


使用方法:



Get-Entropy [-ByteArray] []
Get-Entropy [-FilePath] []


項目地址


https://github.com/mattifestation/PowerShellArsenal


*本文作者:zusheng,轉載請註明來自

FreeBuf.COM






請您繼續閱讀更多來自 FreeBuf 的精彩文章:

盤點2016年「最創新」的8種攻擊方式 | FreeBuf年終策劃
自動化、安全分析和人工智慧,從Gartner預測看網路安全新規則
一種被動的Tor網路去匿名化方法

TAG:FreeBuf |

您可能感興趣

CheerpJ將Java程序轉換為JavaScript
為非程序員打造的Unity遊戲框架:Playground Project
Visual Studio Code 現支持深度學習/AI 應用程序
Android O將允許通過Play Store更新圖形驅動程序
野生程序員對.NETFramework 4.0 ThreadPool的理解
神開發Android應用程序,把Android手機變成iPhone X
Chipotle點單應用程序將支持Apple Pay
Chipotle 點單應用程序將支持 Apple Pay
烏克蘭斷電由惡意程序 Crash Override 觸發
Python:使用Kivy將python程序打包為apk文件
一周年:程序員如何看Eclipse MicroProfile?
FireEye發布免費惡意程序分析軟體ToolBox
CIA泄露文檔第二彈「Dark Matter」:剛出廠的iPhone就感染惡意程序
數萬台 Android 設備被攻陷,首個Android DDoS惡意程序
.Net Core中使用ref和Span提高程序性能
程序員如何在Eclipse Orion中如何使用LSP?
Hello World 程序的起源與歷史
現已有超過 5 億台設備支持 Google 的「小程序」Android Instant Apps
快速切換hosts文件的開源程序SwitchHosts