Giter Club home page Giter Club logo

obfuscation-detection-using-machine-learning's Introduction

Code obfuscation detection using Machine Learning

This repository contains the code for the code obfuscation detection using n-grams, entropy and string length.

Dataset Sourcing

For the implementation, we have used the javascript obfuscation code dataset present on Kaggle. Obfuscated-javascript-dataset: https://www.kaggle.com/fanbyprinciple/obfuscated-javascript-dataset

The dataset comprises of:

  1. Obfuscated javascript directory: This folder consists of javascript files (.js), where the syntax is utf-8 encoded so that the contextual understanding of the code is hidden.
  2. Non-obfuscated javascript directory: This folder consists of javascript files (.js) where the code is not encoded and it's straightforward to understand it so that the contextual understanding of the code is visible.

Features

Our implementation, which aims at detecting malicious samples, is divided into several packages with distinct functionalities:

  • js for the detection of valid JavaScript code;
  • features for the extraction of specific features from inputs;

JavaScript Detection Tool

Detection of JavaScript samples respecting the grammar, detection of broken JavaScript, and files not written in JavaScript.
To use this tool: python3 <path-of-js/is_js.py> --help.

Classification and Clustering of JavaScript Inputs

An AST-based analysis of JavaScript samples can be performed. This study is based on a frequency analysis of the n-grams present in the considered files.

  • Detection of malicious JavaScript documents.
    To use this tool:
  1. python <path-of-clustering/learner.py> --help;
  2. python <path-of-clustering/updater.py> --help;
  3. python <path-of-clustering/classifier.py> --help.

obfuscation-detection-using-machine-learning's People

Contributors

anuj1501 avatar

Watchers

 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.