py amsi
1.11
O PY-AMSI é uma biblioteca que digitaliza strings ou arquivos em busca de malware usando a API do Windows Antimalware Scan Interface (AMSI). O AMSI é uma interface nativa do Windows que permite que os aplicativos solicitem ao antivírus instalado no sistema para analisar um arquivo/string. O AMSI não está ligado ao Windows Defender. Os provedores de antivírus implementam a interface AMSI para receber chamadas de aplicativos. Esta biblioteca aproveita a API para fazer varreduras antivírus em Python. Leia mais sobre a API do Windows AMSI aqui.
Via pip
pip install pyamsi
Repositório de clones
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
# }| Nível de risco | Significado |
|---|---|
| 0 | Amsi_result_clean (o arquivo está limpo) |
| 1 | AMSI_RESULT_NOT_DETECTED (nenhuma ameaça detectada) |
| 16384 | Amsi_result_blocked_by_admin_start (a ameaça é bloqueada pelo administrador) |
| 20479 | Amsi_result_blocked_by_admin_end (a ameaça é bloqueada pelo administrador) |
| 32768 | AMSI_RESULT_DETECTED (o arquivo é considerado malware) |
https://tomiwa-ot.github.io/py-amsi/index.html