Code Monkey home page Code Monkey logo

cfgexplainer's Introduction

CFGExplainer: Explaining Graph Neural Network-Based Malware Classification from Control Flow Graphs

model

CFGExplainer is an interpretability model designed to explain Graph Neural Network (GNN) based malware classification using Control Flow Graphs (CFGs). This model produces an ordered set of nodes with respect to its usefulness towards malware classification. CFGExplainer also produces the subgraphs pruned based on the identified node ordering. The code provided here are for interpretations considering 11 malware families (i.e., Bagle, Bifrose, Hupigon, Ldpinch, Lmir, Rbot, Sdbot, Swizzor, Vundo, Zbot and Zlob) and one benign class. The requirements for the experiments are in requirements.txt. Please refer the paper for in depth details.

Running the code

  1. run_train_GCNClassifier.sh: will run the code for training the GNN classifier model.
  2. run_train_CFGExplainer.sh: will run the initial learning stage of CFGExplainer.
  3. run_interpret_graphs.sh: will run the interpret stage of CFGExplainer.

Interpretability Results

The interpretability_results/ folder stores the results for running CFGExplainer. For each graph sample the model stores the following:

  • results_top_blocks.txt: the ordering of nodes from most important to least important w.r.t the classification task in text format. The file also includes the assembly instructions for each node.
  • top_blocks.pickle: the ordering of the nodes saved in pickle format for later analysis if needed.
  • subgraph_10percent.gpickle: the subgraph from top 10% nodes in networkx graph pickle format.
  • subgraph_20percent.gpickle: the subgraph from top 20% nodes in networkx graph pickle format.

For example, considering the Bagle malware family and sample name Email-Worm.Win32.Bagle.cy.. The results can be found in folder: interpretability_results/Bagle/Email-Worm.Win32.Bagle.cy./. The same folder pattern is followed for results saved for all other malware families. It is possible to save more graphs by changing the code in exp_interpret_graphs.py (line 235).

@inproceedings{herath2022cfgexplainer,
  title={CFGExplainer: Explaining Graph Neural Network-Based Malware Classification from Control Flow Graphs},
  author={Herath, Jerome Dinal and Wakodikar, Priti Prabhakar and Yang, Ping and Yan, Guanhua},
  booktitle={2022 52nd Annual IEEE/IFIP International Conference on Dependable Systems and Networks (DSN)},
  pages={172--184},
  year={2022},
  organization={IEEE}
}

cfgexplainer's People

Contributors

dherath avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

cfgexplainer's Issues

Model Training and Hardware Requirements?

Hi,

Could I ask:

  • what GPU is necessary for model training?
  • what approximately how long does it take to train the model using the GPU mentioned above (and the dataset provided in the repo)?

Thanks in advance.

Edit: Nevermind. Found the answer by referring to the paper (Section V and Table IV). Thanks.

code for acfgs

hello,Jerome!I have read your paper and your code and tried to reproducing your project,but i have trouble with how to transfer cfg to acfg like the txt and pickle file you showed in CFGExplainer/interpretability_results/8c4567b464e29f634baaf747a905ea95./,could you add code of this part to your project?I'll be really appreciating your kindness!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.