py amsi
1.11
PY-AMSI是一個庫,它使用Windows Antimalware掃描界面(AMSI)API掃描字符串或文件。 AMSI是Windows本地的接口,允許應用程序詢問系統上安裝的防病毒軟件以分析文件/字符串。 AMSI與Windows Defender無關。防病毒提供商實施AMSI接口以接收來自應用程序的呼叫。該庫利用API在Python中進行防病毒掃描。在此處閱讀有關Windows AMSI API的更多信息。
通過PIP
pip install pyamsi
克隆存儲庫
git clone https://github.com/Tomiwa-Ot/py-amsi.git
cd py-amsi/
python setup.py install from pyamsi import Amsi
# Scan a file
Amsi . scan_file ( file_path , debug = True ) # debug is optional and False by default
# Scan string
Amsi . scan_string ( string , string_name , debug = False ) # debug is optional and False by default
# Both functions return a dictionary of the format
# {
# 'Sample Size' : 68, // The string/file size in bytes
# 'Risk Level' : 0, // The risk level as suggested by the antivirus
# 'Message' : 'File is clean' // Response message
# }| 風險水平 | 意義 |
|---|---|
| 0 | AMSI_RESULT_CLEAN(文件很乾淨) |
| 1 | amsi_result_not_detected(未檢測到威脅) |
| 16384 | amsi_result_blocked_by_admin_start(威脅被管理員阻止) |
| 20479 | AMSI_RESULT_BLOCKED_BY_ADMIN_END(威脅由管理員阻止) |
| 32768 | amsi_result_detected(文件被視為惡意軟件) |
https://tomiwa-ot.github.io/py-amsi/index.html