Giter Site home page Giter Site logo

yuanchongbit / cfgexplainer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dherath/cfgexplainer

0.0 0.0 0.0 191.49 MB

[code] "CFGExplainer: Explaining Graph Neural Network-Based Malware Classification from Control Flow Graphs" by Jerome Dinal Herath, Priti Prabhakar Wakodikar, Ping Yang and Guanhua Yan. In: IEEE/IFIP International Conference on Dependable Systems and Networks (DSN) (2022)

Shell 3.97% Python 96.03%

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.

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).

Accepted for DSN'2022

cfgexplainer's People

Contributors

dherath avatar

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.