abc1230940/malware-scanner

GitHub: abc1230940/malware-scanner

一款基于 Python 的本地恶意软件威胁狩猎工具,通过输入文件 SHA-256 哈希值在全盘范围内定位恶意文件路径,辅助事件响应人员快速排查和处置。

Stars: 0 | Forks: 0

LinkedIn Gmail Instagram Old Discord Reddit


Malware Scanner

malware

A python threat-hunting malware scanning tool by inputting SHA256 file hash


🔎 目录
  1. 关于本项目
  2. 快速开始
  3. 使用方法
  4. 致谢

(返回顶部)

About the Project

1

This tool is designed to hunt for specific malware dropped by an attacker or spawned by a malicious payload. These threats often attempt to establish persistence on a system to reconnect to the attacker's Command and Control (C2) server upon reboot. By inputting the target malware's SHA-256 hash value, the script scans the entire file system to locate the file. Once a match is found, the script outputs the exact file path so the incident responder can take immediate remediation action.

(Back to Top)

Built With

Language

(Back to Top)

快速开始

该恶意软件扫描程序在 unix 系统上使用,请确保系统已更新并安装了带有虚拟环境的 Python。

前置条件

1. 系统更新及 Python 安装

  sudo apt update && sudo apt install -y python3.12-venv  

安装说明

1. 克隆仓库

 git clone https://github.com/abc1230940/malware-scanner.git  

2. 进入文件夹

 cd malware_scanner  

3. 设置虚拟环境

 python3 -m venv env 

4. 激活虚拟环境

 source env/bin/activate  

5. 完成后停用虚拟环境

 deactivate  

(返回顶部)

Usage

1. Edit the python script and then save

2

The script was designed to scan the root directory ("/"), and we need to exclude the scanner from searching the directories /proc, /sys, /dev, /snap and /run because they contain virtual, dynamic kernel processes and hardware streams that do not exist on the physical disk, which would otherwise cause the program to hang, freeze, or crash.

You can also scan the targeted directories which attacker may drop the malware:

  • /tmp
  • /var/tmp
  • /dev/shm
  • /etc/cron.*
  • /etc/bin

2. Launch the malware scanner script

 python3 malware_scanner.py 

3. Input SHA-256 hash value and press Enter

3

I inputted the SHA-256 of "Malware": a948904f2f0f479b8f8197694b30184b0d2ed1c1cd2a1ec0fb85d299a192a447

4. Result

1

The targeted "malware" was found! The path is "/tmp/malware/real_malware/hello_world.txt"

(Back to Top)

Acknowledgement

LetsDefend - Python for Blue Team

VirusTotal

14

(Back to Top)

标签:Python, 威胁情报, 开发者工具, 恶意软件扫描, 无后门, 逆向工具