Mquery是一个Web的YARA样本查询平台,由波兰CERT开源。项目地址:https://github.com/CERT-Polska/mquery
mquery架构
可见mquery的组件是比较简单的,由4个部分组成:
Web前端
Daemons (也叫mquery agents或workers)
UrsaDB (后端数据库)
Redis
git clone --recurse-submodules https://github.com/CERT-Polska/mquery.git
cd mquery
mkdir samples
vim .env #设置样本路径,比如SAMPLES_DIR=/root/mquery/samples INDEX_DIR=/root/mquery/index
docker-compose up -d --scale daemon=3
3.在项目的sample路径下放置样本(.env中配置的挂载路径)
4.构建ursadb索引
docker-compose exec ursadb ursacli
index "/mnt/samples" with taints ["white"]
rule mquery_exceptions {
strings: $a = "Exception"
condition: all of them
}
https://github.com/elastic/protections-artifacts/blob/main/yara/rules/Linux_Trojan_Mirai.yar
测试方式 | 耗费时间 |
mquery | 35s |
yara(Linux) | 48s |
mquery流程图
rule example
{
strings:
$test = "abcd"
condition:
$test
}
https://cert-polska.github.io/ursadb/
hunter:web.icon="37013ee35e340a9f0bdf65ec56b21f18"
fofa:icon_hash="1706076547"