Mquery can be used to search through terabytes of malware in a blink of an eye:
Ever had trouble searching for particular malware samples? Our project is an analyst-friendly web GUI to look through your digital warehouse.
Demo
Take a look at https://mquery.tailcall.net for a quick demo.
Unfortunately, you won’t find any actual malware there. For demo purposes we have indexed the sources of this project – so you can try to find all exceptions in our source code by using this yara rule:
rule find_exceptions: trojan
{
meta:
author = “mquery_demo”
strings:
$exception_string = “Exception”
condition:
all of them
}
Also Read – Horn3t : Powerful Visual Subdomain Enumeration at the Click of a Mouse
How does it work?
YARA is pretty fast, but searching through large dataset for given signature can take a lot of time. To countermeasure this, we have implemented a custom database called UrsaDB.
It is able to pre-filter the results, so it is only necessary to run YARA against a small fraction of binaries:
Quick start
Installation (Docker)
).http://localhost:80/
samples
directory, which is bind-mounted to all containers at /mnt/samples
.sudo docker-compose run ursadb-cli tcp://ursadb:9281 --cmd 'index "/mnt/samples";'
. This will tell the database to index all the files in /mnt/samples
(change the path depending on your system).rule emotet4_basic: trojan
{
meta:
author = “cert.pl”
strings:
$emotet4_rsa_public = { 8d ?? ?? 5? 8d ?? ?? 5? 6a 00 68 00 80 00 00 ff 35 [4] ff 35 [4] 6a 13 68 01 00 01 00 ff 15 [4] 85 }
$emotet4_cnc_list = { 39 ?? ?5 [4] 0f 44 ?? (FF | A3)}
condition:
all of them
}
Note: Any administrative tasks can be performed using ursacb-cli. See CERT-Polska/ursadb for a complete list of supported commands.
Installation (Docker)
Easy way to install the software is to build it from sources using docker-compose
:
git clone –recurse-submodules https://github.com/CERT-Polska/mquery.git
docker-compose up –scale daemon=3
where --scale daemon=...
refers to the number of workers which will simultaneously process select/index jobs.
Hint: Your docker-compose
must support v3 syntax of docker-compose.yml
. Update your software if you have any problems.
For a production environment consider using kubernetes (take a look at kuebrnetes
directory to get you started) or a manual installation (see below).
There are three separate components:
db.ursa tcp://0.0.0.0:9281
after compilation. (will listen on tcp port 9281). Needs persistent storage at cwd (for docker deployments use a volume. You don’t need to do anything special for bare metal installations)config.py
run python3 webapp.py
or expose it via uwsgi.config.py
file. You can use more than one daemon.You need to mount files indexed by ursadb at the same logical path in mquery and daemons.
You also need to have a redis server somewhere (used as a task queue for mquery and daemon).
shadow-rs is a Windows kernel rootkit written in Rust, demonstrating advanced techniques for kernel manipulation…
Extract and execute a PE embedded within a PNG file using an LNK file. The…
Embark on the journey of becoming a certified Red Team professional with our definitive guide.…
This repository contains proof of concept exploits for CVE-2024-5836 and CVE-2024-6778, which are vulnerabilities within…
This took me like 4 days (+2 days for an update), but I got it…
MaLDAPtive is a framework for LDAP SearchFilter parsing, obfuscation, deobfuscation and detection. Its foundation is…