py amsi
1.11
Py-AMSI เป็นไลบรารีที่สแกนสตริงหรือไฟล์สำหรับมัลแวร์โดยใช้ Windows Antimalware Scan Interface (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