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