Cyber security

py-amsi: Streamlining Malware Detection in Python with the Windows AMSI API

py-amsi is a library that scans strings or files for malware using the Windows Antimalware Scan Interface (AMSI) API. AMSI is an interface native to Windows that allows applications to ask the antivirus installed on the system to analyse a file/string. AMSI is not tied to Windows Defender. Antivirus providers implement the AMSI interface to receive calls from applications. This library takes advantage of the API to make antivirus scans in python. Read more about the Windows AMSI APIĀ here.

Installation

Via pip

pip install pyamsi

Clone repository

git clone https://github.com/Tomiwa-Ot/py-amsi.git
cd py-amsi/
python setup.py install

Usage

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
# }
Tamil S

Tamil has a great interest in the fields of Cyber Security, OSINT, and CTF projects. Currently, he is deeply involved in researching and publishing various security tools with Kali Linux Tutorials, which is quite fascinating.

Recent Posts

PwnedPasswordsDownloader – Efficient Downloading Of HIBP Password Hashes Using Curl Parallelism

Thanks for HIBP and this downloader. At first I was considering using it, but the…

3 days ago

Cybersecurity Conferences – A Comprehensive Slide Collection

Comprehensive repository for presentation slides from major cybersecurity conferences held in 2023 and 2024. It…

7 days ago

DLL Proxy Generator – Harnessing Advanced Proxy Capabilities

Generate a proxy dll for arbitrary dll, while also loading a user-defined secondary dll. In…

7 days ago

DLL Universal Patcher – A Comprehensive Guide To Advanced Binary Patching

DLL Universal Patcher is a flexible and convenient code patcher that doesn't touch the files…

7 days ago

RustiveDump : A Rust-Based Tool For Efficient Memory Dumping Of lsass.exe

RustiveDump is a Rust-based tool designed to dump the memory of the lsass.exe process using…

1 week ago

SharpExclusionFinder – Streamlining Windows Defender Exclusion Checks With Advanced Scanning Capabilities

This C# program finds Windows Defender folder exclusions using Windows Defender through its command-line tool…

1 week ago