🐳 Android 标注工具一 🐳
1、Android 标注工具
Android 标注工具 AVCLASS 发布于 2016 RAID ,其新版本 AVCLASS2 发布于 2020 ACSAC 。
二者的原文引用为:
- “Marcos Sebastián, Richard Rivera, Platon Kotzias, and Juan Caballero. AVClass: A Tool for Massive Malware Labeling[C]. In Proceedings of the International Symposium on Research in Attacks, Intrusions and Defenses, September 2016.”。
- “Silvia Sebastián, Juan Caballero. AVClass2: Massive Malware Tag Extraction from AV Labels[C]. In proceedings of the Annual Computer Security Applications Conference, December 2020.”。
2、AVCLASS vs. AVCLASS2
AVCLASS 和 AVCLASS2 都用于标注 Android malware family。作者及其团队 (IMDEA Software Institute) 推荐使用可以提供更多信息的 AVCLASS2。
二者输出的信息如下:
- AVCLASS 只提供 family names (i.e.,family tags)。
- AVCLASS2 除 family names 之外,还可以额外提供 malware class (e.g.,worm,ransomware,grayware),behaviors (e.g.,spam,ddos) 和 file properties (e.g.,packed,themida,bundle,nsis)。
对于 family names 而言,AVCLASS2 会输出多个所属 family names,而 AVCLASS 只输出一个。并且二者输出的 family name 也不一定相同。
作者在 Github 中给出了这样的陈述 “AVClass is no longer updated and may be deprecated in the near future. For example, we add family aliases and generic terms from time to time for AVClass2, but we are not currently adding them for AVClass.”。
3、使用示例一
两种工具都支持 VirusTotal v2 API JSON reports (-vt file)。以下示例仅以 AVCLASS2 为例,如使用 AVCLASS 只需替换 ./avclass2/avclass2_labeler.py
为 ./avclass/avclass_labeler.py
。
vtv2 sample 详见 Github 中提供的 avclass-master/examples/vtv2_sample.json
文件。
其使用示例如下 (Windows):
python ./avclass2/avclass2_labeler.py -vt examples/vtv2_sample.json -p > examples/vtv2_output.txt
控制台输出日志可参考如下 (Windows):
[-] Using tagging rules in C:\Users\*\Desktop\avclass-master\avclass2\data/default.tagging
[-] Using taxonomy in C:\Users\*\Desktop\avclass-master\avclass2\data/default.taxonomy
[-] Using expansion tags in C:\Users\*\Desktop\avclass-master\avclass2\data/default.expansion
[-] Processing input file examples/vtv2_sample.json
[-] 2 JSON read
[-] Samples: 2 NoScans: 0 NoTags: 0 GroundTruth: 0
输出结果如下 (avclass-master/examples/vtv2_output.txt
):
602695c8f2ad76564bddcaf47b76edff 52 FAM:zeroaccess|19,FILE:os:windows|16,BEH:server|8,CLASS:backdoor|8,FILE:packed|7
f117cc1477513cb181cc2e9fcaab39b2 39 CLASS:rogueware|15,BEH:alertuser|15,FILE:os:windows|11,FAM:winwebsec|4,CLASS:grayware|4,CLASS:grayware:tool|3,FILE:packed|3
4、使用示例二
两种工具都支持 VirusTotal v3 API JSON reports (-vt file -vt3)。以下示例仅以 AVCLASS2 为例,如使用 AVCLASS 只需替换 ./avclass2/avclass2_labeler.py
为 ./avclass/avclass_labeler.py
。
vtv3 sample 详见 Github 中提供的 avclass-master/examples/vtv3_sample.json
文件。
其使用示例如下 (Windows):
python ./avclass2/avclass2_labeler.py -vt examples/vtv3_sample.json -p -vt3 > examples/vtv3_output.txt
控制台输出日志可参考如下 (Windows):
[-] Using tagging rules in C:\Users\*\Desktop\avclass-master\avclass2\data/default.tagging
[-] Using taxonomy in C:\Users\*\Desktop\avclass-master\avclass2\data/default.taxonomy
[-] Using expansion tags in C:\Users\*\Desktop\avclass-master\avclass2\data/default.expansion
[-] Processing input file examples/vtv3_sample.json
[-] 1 JSON read
[-] Samples: 1 NoScans: 0 NoTags: 0 GroundTruth: 0
输出结果如下 (avclass-master/examples/vtv3_output.txt
):
5e31d16d6bf35ea117d6d2c4d42ea879 35 FILE:exploit|10,BEH:execdownload|3,CLASS:downloader|3,FILE:os:windows|2
5、使用示例三 (AVCLASS2)
AVCLASS2 支持简化后的 JSON reports,但该 report 必须至少包含 md5,sha1,sha256 和 av_labels。
其 sample 详见 Github 中提供的 avclass-master/examples/malheurReference_lb.json
文件。
其使用示例如下 (Windows),不加重定向 >
则只会在控制台输出标注结果:
python ./avclass2/avclass2_labeler.py -lb examples/malheurReference_lb.json -p > examples/av2_output.txt
控制台输出日志可参考如下 (Windows):
[-] Using tagging rules in C:\Users\*\Desktop\avclass-master\avclass2\data/default.tagging
[-] Using taxonomy in C:\Users\*\Desktop\avclass-master\avclass2\data/default.taxonomy
[-] Using expansion tags in C:\Users\*\Desktop\avclass-master\avclass2\data/default.expansion
[-] Processing input file examples/malheurReference_lb.json
[-] 3131 JSON read
[-] Samples: 10 NoScans: 0 NoTags: 0 GroundTruth: 0
部分输出结果如下 (avclass-master/examples/av2_output.txt
):
aca2d12934935b070df8f50e06a20539 33 CLASS:grayware|9,CLASS:grayware:adware|9,FILE:os:windows|8,FAM:adrotator|8,BEH:execdownload|3,CLASS:downloader|3,FAM:zlob|2
67d15459e1f85898851148511c86d88d 37 CLASS:dialer|23,BEH:dials|18,FILE:os:windows|9,FAM:adultbrowser|8,CLASS:dialer:porndialer|7,CLASS:grayware|6,CLASS:grayware:tool|3,FAM:target|2
6、使用示例四 (AVCLASS)
AVCLASS 同样支持简化后的 JSON reports,其与 AVCLASS2 的区别主要在于输出结果之间的差异。
其使用示例如下 (Windows),不加重定向 >
则只会在控制台输出标注结果:
python ./avclass/avclass_labeler.py -lb examples/malheurReference_lb.json > examples/av_output.txt
控制台输出日志可参考如下 (Windows):
[-] Using aliases in C:\Users\*\Desktop\avclass-master\avclass\data/default.aliases
[-] Using generic tokens in C:\Users\*\Desktop\avclass-master\avclass\data/default.generics
[-] Processing input file examples/malheurReference_lb.json
[-] 3131 JSON read
[-] Samples: 3131 NoLabels: 0 Singletons: 141 GroundTruth: 0
部分输出结果如下 (avclass-master/examples/av_output.txt
):
aca2d12934935b070df8f50e06a20539 adrotator
67d15459e1f85898851148511c86d88d adultbrowser