当前位置:网站首页>[note] the environment for setting up get injectedthread script supplemented by shellcode in Windows Security III and its use
[note] the environment for setting up get injectedthread script supplemented by shellcode in Windows Security III and its use
2022-06-10 13:47:00 【Quadratic monster】
Get-InjectedThread Script source address
List of articles
Preface
How to detect malware in memory
Get-InjectedThread.ps1 Is a script that can scan the suspicious starting address of active threads on the system . Users can use it to scan hosts in their network , And quickly identify many memory resident malware technologies . The script uses NtQueryInformationThread Function queries each active thread to retrieve its starting address . then , Use VirtualQueryEx Function to query the starting address , To determine the relevant node attributes . If the memory area started by the thread is not called back and is executable , That is, it is not an image type and has an execution bit setting , Then the thread is considered injected .
Get-InjectedThread principle
Defenders are also thinking about Visualization ( One )
- Use ProcessId by 0( All processes ) And will Flag Parameter set to 4(TH32CS_SNAPTHREAD) call Create Toolhelp Snapshot. This will return a snapshot of all currently running threads .
- Use Thread32First and Thread32Next Process all threads in the snapshot .
Each of the following steps will be performed on each thread :
- call OpenThread To receive... In the kernel Thread Object handle .
- Use Thread Handle , by ThreadInformationClass The specified value of the parameter is 9(ThreadQuerySetWin32StartAddress) Of NtQueryInformationThread. This will return the memory starting address of the thread .
- call OpenProcess To receive the handle of the process owned by the current thread .
- Pass the process handle and thread start address to VirtualQueryEx To query the target memory page . This will return to a MEMORY_BASIC_INFORMATION structure .
- Check the... In the return structure State and Type Field .
- The status of all threads should be MEM_COMMIT
- All threads should be of type MEM_IMAGE
- If Type It's not equal to MEM_IMAGE, So you have a thread running code , This thread will not be used by files on the disk ( Also known as injection ) Supported by the .
Environment building
win10 1903
powershell 5.1
powershell PackageManagement
PowershellGet
PowershellGet install
Installing PowerShellGet on Windows
PowershellGet Installation of is very important Otherwise, the following script will throw exceptions :
Set script running permission
Set-ExecutionPolicy RemoteSigned
PowerShellGet and NuGet install
Install-Module PowerShellGet -AllowClobber -Force
Install-PackageProvider -Name NuGet -Force
PSReflect-Functions Module installation
Install-Module PowerShellGet -AllowClobber -Force
Install-Module -Name PSReflect-Functions
TLS Version settings
[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12
Set up PSGallery The warehouse can be trusted
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
Script Download
https://gist.github.com/jaredcatkinson/23905d34537ce4b5b1818c3e6405c1d2

Set up Powershell jurisdiction
Set-ExecutionPolicy RemoteSigned
The import module
Import-Module .\Get-InjectedThread.ps1
Import-Module .\Get-MemorySectionContent.ps1
Import-Module .\New-InjectedThread.ps1
Import-Module .\Stop-Thread.ps1
Create an injected thread -New-InjectedThread
Ps>New-InjectedThread

Ps>.\New-InjectedThread.ps1
Be careful : This execution script needs to be executed in ps Add The execution content is Add a line at the end of the file Executed function
Perform the test -Get-InjectedThread
Ps>Get-InjectedThread

Be careful : This execution script needs to be executed in ps Add The execution content is Add a line at the end of the file Executed function
边栏推荐
- 五角大楼首次承认资助46个乌生物设施 俄方曾曝只有3个安全
- 《软件体系结构原理、方法与实践》第二版期末考试复习总结
- Tablayout usage details (modify text size, underline style, etc.)
- MarkDown 标题居中
- 3. web page development tool vs Code
- Recyclerview multi layout writing method, "my" and "personal center" page classic writing method demonstration
- Solve the problem of cross sea high concurrent crash? so easy
- What needs to be done for mobile app performance testing? How much is the performance test report charged?
- Notes - simple but adequate series_ The Yapi return parameter data should be an object type problem solving record
- 【云计算】多云管理平台和公有云两者之间是啥关系?
猜你喜欢

im即时通讯开发:进程被杀底层原理、APP应对被杀技巧

智慧校园安全通道及视频监控解决方案
![[FAQ] summary of common problems and solutions during the use of rest API interface of sports health service](/img/ff/96a0a77795b271bef3a8ade2d646c3.png)
[FAQ] summary of common problems and solutions during the use of rest API interface of sports health service

Qualcomm has finally begun to develop its own core architecture after learning from the difficulties of assembling chips to maintain its competitive advantage
![[deep learning 05] cross entropy loss function](/img/00/7bf13cb86324f1e9942ce45d5cc13c.png)
[deep learning 05] cross entropy loss function
![[untitled]](/img/40/8ce6b9fc0050c9ed5b8b1d05dc3c51.png)
[untitled]

32. Simple test of raspberry pie serial port communication and ultrasonic module ranging
![[FAQ] résumé des problèmes courants et des solutions lors de l'utilisation de l'interface API rest du Service de santé sportive](/img/ff/96a0a77795b271bef3a8ade2d646c3.png)
[FAQ] résumé des problèmes courants et des solutions lors de l'utilisation de l'interface API rest du Service de santé sportive
![buuctf [PHP]inclusion](/img/02/d328ed84e4641c09c5b1eba3ac6ea9.png)
buuctf [PHP]inclusion

Meetup review how Devops & mlops solve the machine learning dilemma in enterprises?
随机推荐
十款好用跨浏览器测试工具分享,好物值得收藏
No spitting
buuctf [PHP]inclusion
让资源在云端和本地自由流动
Buuctf [glassfish] arbitrary file reading
大四应届毕业生,想自学软件测试,如何应对面试?
Typescript introductory notes (personal)
移动app性能测试有哪些需要进行?性能测试报告如何收费?
net core天马行空系列-可用于依赖注入的,数据库表和c#实体类互相转换的接口实现
Pycharm安装详细教程
Student status management system
Use of 5.8G microwave radar module, working principle and introduction of 5.8G microwave radar module
5.8G微波雷达模块使用,5.8G微波雷达模块工作原理和介绍
Im instant messaging development: the underlying principle of process killed and app skills to deal with killed
[Huang ah code] Why is php7 twice as fast as PHP5?
Google Earth Engine(GEE)——利用MODIS 的叶面积指数影像掩膜dem批量下载
新功能|Mail GPU Counter模块新增GPU图元处理和GPU Shader Cycles
Google Earth engine (GEE) -- batch download of DEM using MODIS leaf area index image mask
Leetcode 829. Sum of continuous integers
[yellow code] SVN version control tutorial