CybercentreCanada/assemblyline-service-apivector
GitHub: CybercentreCanada/assemblyline-service-apivector
这是一个Assemblyline服务,利用ApiScout从Windows文件中提取API向量,用于恶意软件家族的自动化分类和威胁情报匹配。
Stars: 3 | Forks: 1
[](https://discord.gg/GUAy9wErNu)
[](https://discord.gg/GUAy9wErNu)
[](https://github.com/CybercentreCanada/assemblyline)
[](https://github.com/CybercentreCanada/assemblyline-service-apivector)
[](https://github.com/CybercentreCanada/assemblyline/issues?q=is:issue+is:open+label:service-apivector)
[](./LICENSE)
# APIVector 服务
此服务从 Windows PE 文件或内存转储中提取库导入信息,以生成 API 向量分类。
## 服务详情
[ApiScout](https://github.com/danielplohmann/apiscout) 使用常见的 Windows API 调用来构建一个称为 ApiVector 的表示。
技术详情请参阅以下链接:
* 描述 ApiScout/ApiVectors 及其在 malpedia 数据集上应用结果的学术论文 - https://journal.cecyf.fr/ojs/index.php/cybin/article/view/20
* GitHub 上的代码 - https://github.com/danielplohmann/apiscout
* 博客文章 - http://byte-atlas.blogspot.com/2017/04/apiscout.html
**注意**:为了使 ApiVector AL 服务正常工作,您需要
1. 将 MALPEDIA_APIKEY 设置为环境变量
为了充分利用此服务,您应该拥有一个要与传入数据进行比较的 apivector 集合。
您可以申请访问 [Malpedia](https://malpedia.caad.fkie.fraunhofer.de/) 并向他们申请一个 API 密钥,此服务可以使用该密钥
定期获取更新。
或者,您可以生成自己的文件,只要您遵循[此处](https://github.com/danielplohmann/apiscout/blob/master/dbs/collection_example.csv)的格式:
它是一个 CSV 文件,使用分号作为分隔符:
### 服务配置
可用的服务配置选项如下:
```
# Parameters for matching apivector
# minimum confidence in the apivector match to do anything with it
`min_confidence`: 50,
# min jaccard score to report as implant family
# from https://journal.cecyf.fr/ojs/index.php/cybin/article/view/2 , you can set this depending on your
# tolerance for false positives.
# Even if set very high, FPs are still possible for samples that share a lot of statically linked code
# * 0.18 leads to a TPR/FPR of 90.18% and 9.45%
# * 0.22 leads to a TPR/FPR of 89.10% and 4.74% (closest distance to the (0,1) point)
# * 0.32 leads to a TPR/FPR of 86.55% and 0.99%
# * 0.55 leads to a TPR/FPR of 80.72% and 0.09%
`min_jaccard`: 0.40
```
## 镜像变体与标签
Assemblyline 服务基于 [Assemblyline 服务基础镜像](https://hub.docker.com/r/cccs/assemblyline-v4-service-base) 构建,
该基础镜像基于 Debian 11 和 Python 3.11。
Assemblyline 服务使用以下标签定义:
| **标签类型** | **描述** | **示例标签** |
| :----------: | :----------------------------------------------------------------------------------------------- | :------------------------: |
| latest | 最近的构建版本(可能不稳定)。 | `latest` |
| build_type | 所使用的构建类型。`dev` 是最新的不稳定构建。`stable` 是最新的稳定构建。 | `stable` 或 `dev` |
| series | 完整的构建详情,包括版本和构建类型:`version.buildType`. | `4.5.stable`, `4.5.1.dev3` |
## 运行此服务
这是一个 Assemblyline 服务。它设计为在 Assemblyline 框架中运行。
如果您想在本地测试此服务,可以直接从 shell 运行 Docker 镜像:
```
docker run \
--name APIVector \
--env SERVICE_API_HOST=http://`ip addr show docker0 | grep "inet " | awk '{print $2}' | cut -f1 -d"/"`:5003 \
--network=host \
cccs/assemblyline-service-apivector
```
要将此服务添加到您的 Assemblyline 部署中,请参阅此
[指南](https://cybercentrecanada.github.io/assemblyline4_docs/developer_manual/services/run_your_service/#add-the-container-to-your-deployment)。
## 文档
通用的 Assemblyline 文档可以在以下网址找到:https://cybercentrecanada.github.io/assemblyline4_docs/
# APIVector 服务
此服务从 Windows 可执行文件或内存转储中提取导入的库,以生成 API 的向量分类。
## 服务详情
[ApiScout](https://github.com/danielplohmann/apiscout) 使用常见的 Windows API 调用来构建一个称为 ApiVector 的表示。
最初的工作是在 GeekWeek 5 (https://gitlab.com/GeekWeekV/4.2_malfinder/alsvc_apivector) 期间完成的。
技术详情请参阅以下链接:
* 描述 ApiScout/ApiVectors 及其应用于 malpedia 数据集结果的学术论文 - https://journal.cecyf.fr/ojs/index.php/cybin/article/view/20
* GitHub 上的代码 - https://github.com/danielplohmann/apiscout
* 博客文章 - http://byte-atlas.blogspot.com/2017/04/apiscout.html
**注意**:为了使 ApiVector AL 服务正常工作,您必须
1. 定义环境变量 MALPEDIA_APIKEY
为了充分利用此服务,您必须拥有一个 apivector 集合,您希望将传入数据与之进行比较。
您可以申请访问 [Malpedia] (https://malpedia.caad.fkie.fraunhofer.de/) 并向他们申请一个 API 密钥,此服务可以使用该密钥
定期获取更新。
您也可以创建自己的文件,前提是遵循[此处](https://github.com/danielplohmann/apiscout/blob/master/dbs/collection_example.csv)的格式:
它是一个 CSV 文件,使用分号作为分隔符:
```
malware_family;sample_metadata;0;0;compressed_apivector
```
### 服务配置
可用的服务配置选项如下:
```
# Paramètres pour la correspondance avec l'apivecteur
# confiance minimale dans la correspondance de l'apivecteur pour en faire quelque chose
`min_confidence` : 50,
# score jaccard minimum à signaler en tant que famille d'implants
# à partir de https://journal.cecyf.fr/ojs/index.php/cybin/article/view/2 , vous pouvez régler ce paramètre en fonction de votre
# tolérance aux faux positifs.
# Même s'il est très élevé, les faux positifs sont toujours possibles pour les échantillons qui partagent beaucoup de code lié statiquement.
* 0,18 conduit à un TPR/FPR de 90,18% et 9,45%.
* 0,22 conduit à un TPR/FPR de 89,10% et 4,74% (distance la plus proche du point (0,1))
* 0,32 conduit à un TPR/FPR de 86,55% et 0,99%.
# 0,55 conduit à un TPR/FPR de 80,72% et 0,09%.
`min_jaccard` : 0.40
```
## 镜像变体与标签
Assemblyline 服务基于 [Assemblyline 服务基础镜像](https://hub.docker.com/r/cccs/assemblyline-v4-service-base) 构建,
该基础镜像基于 Debian 11 和 Python 3.11。
Assemblyline 服务使用以下标签定义:
| **标签类型** | **描述** | **示例标签** |
| :------------------: | :------------------------------------------------------------------------------------------------------------- | :------------------------: |
| latest | 最新的版本(可能不稳定)。 | `latest` |
| build_type | 所使用的构建类型。`dev` 是最新的不稳定构建。`stable` 是最新的稳定构建。 | `stable` 或 `dev` |
| series | 完整的构建详情,包括版本和构建类型:`version.buildType`。 | `4.5.stable`, `4.5.1.dev3` |
## 运行此服务
此服务经过专门优化,可在 Assemblyline 部署中运行。
如果您想在本地测试此服务,可以直接从终端运行 Docker 镜像:
```
docker run \
--name APIVector \
--env SERVICE_API_HOST=http://`ip addr show docker0 | grep "inet " | awk '{print $2}' | cut -f1 -d"/"`:5003 \
--network=host \
cccs/assemblyline-service-apivector
```
要将此服务添加到您的 Assemblyline 部署中,请参阅此
[指南](https://cybercentrecanada.github.io/assemblyline4_docs/fr/developer_manual/services/run_your_service/#add-the-container-to-your-deployment)。
## 文档
通用的 Assemblyline 文档可以在以下网址查阅:https://cybercentrecanada.github.io/assemblyline4_docs/
标签:ApiScout, ApiVector生成, API向量分类, API提取, Assemblyline, Conpot, DAST, PE文件分析, Windows API分析, Windows安全, 二进制分析, 云安全运维, 内存转储分析, 威胁分析工具, 威胁情报, 安全服务, 库导入分析, 开发者工具, 恶意软件分析, 恶意软件特征提取, 网络安全, 自动化分析, 请求拦截, 跨站脚本, 逆向工具, 隐私保护