機器學習&惡意代碼檢測簡介


Malware detection

可執行文件簡介

  • ELF(Executable Linkable Format)

    linux下的可執行文件格式,按照ELF格式編寫的文件包括:.so、.a等

  • PE(Portable Executable)

    windows下的可執行文件格式,按照PE格式編寫的文件包括: .dll、.lib、.exe等

參考文獻【3】中對ELF的各個字段作了詳細介紹

圖4

Linux和Windows可執行文件分類:

ELF文件類型 說明 實例
可重定位文件(Relocatable File) 包含了代碼與數據,可以用來連接成可執行文件或共享目標文件,如目標文件與靜態鏈接庫 Linux的.o與.a,Windows的.obj與.lib
共享目標文件(Shared Object File) 包含了代碼和數據,主要有兩種用途,一是與目標文件或其它共享目標文件鏈接成新的共享目標文件,二是與可執行文件結合,作為進程映像的一部分來運行 Linux的.a,Windows的.dll
可執行文件(Executable File) 包含了可直接執行的程序 Linux下無后綴的ELF可執行文件,Windows的.exe文件
核心轉儲文件(Core Dump File) 當進程意外終止時,系統可以將該進程的地址空間的內容及終止時的一些其他信息轉儲到核心轉儲文件 Linux下的core dump

檢測方法概述

可以初步分為兩類 [4,5]:

  • 靜態檢測:不需要執行程序(如直接使用反匯編后的代碼)

    滑動窗口字節或熵統計、PE頭IAT特征、可打印字符、PE元信息等

  • 動態檢測:在沙箱執行程序

    API調用序列、系統調用序列、api圖 [6]

靜態檢測方法:

  • 基於OPcode、二進制代碼,使用NLP方法
  • 基於二進制代碼,生成灰度圖,使用圖像方法
  • 字節直方圖或字節熵直方圖
  • 反匯編為匯編語言,使用NLP方法
  • 反匯編后得到API調用序列,根據API調用序列使用NLP方法或圖論
  • 直接根據源惡意程序中的可打印字符串或者圖片

動態檢測方法:

  • 在沙箱運行,得到動態執行數據(進程詳情),根據API調用序列使用NLP方法或圖論

優缺點:

靜態不需要運行,快速、安全;對加密、混淆程序檢測不適用

動態需要執行,不太安全,但可以應對加密、混淆程序檢測

公開數據集:

EMBER[15]

SoReL-20M[16]

資源及參考文獻

【1】PE/ELF/Mach-O之比較. https://www.jianshu.com/p/21850560caf0

【2】認識目標文件的格式——a.out COFF PE ELF

【3】ELF文件格式學習總結. https://www.cnblogs.com/sayhellowen/p/802b5b0ad648e1a343dcd0f85513065f.html

【4】基於機器學習的惡意代碼檢測技術詳解. https://blog.csdn.net/Eastmount/article/details/120421043

【5】Survey of Machine Learning Techniquesfor Malware Analysis. 2019

【6】graph2vec: Learning Distributed Representations of Graphs

【7】Malware Images: Visualization and Automatic Classification. https://vision.ece.ucsb.edu/sites/default/files/publications/nataraj_vizsec_2011_paper.pdf

【8】在線分析工具的重新評測. https://www.52pojie.cn/thread-871410-1-1.html

【9】阿里雲惡意程序檢測https://tianchi.aliyun.com/competition/entrance/231694/information

【10】https://xz.aliyun.com/t/3106, https://xz.aliyun.com/t/3704

【11】Handling webshell attacks: A systematic mapping and survey. 2021

【12】Detecting unknown malicious code by applying classification techniques on OpCode patterns. https://security-informatics.springeropen.com/track/pdf/10.1186/2190-8532-1-1.pdf

【13】DataCon2020 惡意代碼分析.https://zhuanlan.zhihu.com/p/187535672

【14】惡意代碼分類. http://blog.moonsea.ac.cn/Malware-Classification. http://drops.xmd5.com/static/drops/tips-8151.html. http://blog.moonsea.ac.cn/Malcode-ngram-opcode

【15】EMBER: An Open Dataset for Training Static PE Malware Machine Learning Models. https://arxiv.org/pdf/1804.04637.pdf

【16】SOREL-20M: A LARGE SCALE BENCHMARK DATASET FOR MALICIOUS PE DETECTION. https://arxiv.org/pdf/2012.07634.pdf

【17】Novel Feature Extraction, Selection and Fusion forEffective Malware Family Classification. 2016

github

https://github.com/malicialab/avclass

https://github.com/elastic/ember

https://github.com/sophos-ai/SoReL-20M

android malware

DL-Droid: Deep learning based android malware detection using real devices

DREBIN: Effective and Explainable Detection of Android Malware in Your Pocket

API

MalDAE: Detecting and explaining malware based on correlation and fusion of static and dynamic characteristics

MAAR: Robust features to detect malicious activity based on API calls, their arguments and return values

API GRAPH

Dynamic Android Malware Classification Using Graph-Based Representations

behaviour

Behavior-based anomaly detection on big data https://ro.ecu.edu.au/cgi/viewcontent.cgi?article=1182&context=ism

AMAL: High-fidelity, behavior-based automated malware analysis and classification https://www.sciencedirect.com/science/article/pii/S0167404815000425#bib37

DTB-IDS: an intrusion detection system based on decision tree using behavior analysis for preventing APT attacks https://link.springer.com/content/pdf/10.1007/s11227-015-1604-8.pdf

Transformer

Bert惡意軟件. https://www.cnblogs.com/bitterz/p/14000826.html. https://github.com/bitterzzZZ/Bert-malware-classification

Malware Detection on Highly Imbalanced Data through Sequence Modeling

MALBERT: USING TRANSFORMERS FOR CYBERSECURITY AND MALICIOUS SOFTWARE DETECTION. https://arxiv.org/pdf/2103.03806.pdf

PalmTree: Learning an Assembly Language Model for Instruction Embedding. CCS 2021

GENTAL: GENERATIVE DENOISING SKIP-GRAM TRANSFORMER FOR UNSUPERVISED BINARY CODE SIMILARITY DETECTION. ICLR 2022

Asm2Vec: Boosting Static Representation Robustness for Binary Clone Search against Code Obfuscation and Compiler Optimization


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM