Skip to main content

Webshell Detection Tool integrating Machine Learning based on Static Feature Extraction

Project description

Webshell Analyzer

webshell analyzer is command line based webshell detection tool that utillizes static feature extraction and using Random Forest classification to detect malicious PHP webshell.

Webshell Analyzer Home Screen

Table of Contens

About

webshell analyzer was developed to assist security analysts, researchers, and system administrators in identifying potentially malicious PHP files before they are executed on a web server. the tool helps to mitigate the risk of unauthorised access, web defacement attacks, and persistent backdoor attacks, which are commonly associated with webshells.

this system combines three static code analysis methods: lexical analysis, statistical analysis, and Abstract Syntax Tree (AST) analysis. this approach enables the detection process to identify suspicious functions, code structure patterns, and statistical characteristics that may indicate malicious behavior.

Features

  • Scan individual PHP files for webshell indicators
  • Recursively scan entire directories
  • Static feature extraction (no code execution required)
  • Machine learning classification using Random Forest
  • Export results to only JSON file
  • Interactive CLI environment

Requirements

before installing and running webshell analyzer, ensure that your system meets the following requirements :

  • Python 3.10 or later
  • Pip (python package manager)
  • Git

Installation

Option 1 — Via pip (Recommended)

The easiest way to install Webshell Analyzer is via pip:

pip install webshell-analyzer

All required dependencies will be installed automatically.

Option 2 — Via GitHub Clone

# Clone the repository
git clone https://github.com/Adeliasaputriiii/webshell-analyzer

# Navigate to the project directory
cd webshell-analyzer

# Install dependencies
pip install -r requirements.txt

# Install the package
pip install .

Usage

Use the following command to launch the webshell analyzer interactive environment :

wsanalyzer

once started, you will be presented with the webshell analyzer command prompt. From this environment, you can run all available commands such as scan, detect, --output, help, exit.

Commands

  1. scan <directory_path> [--output <output_file.json>] -> scan all PHP files in a directory for webshell detection
  2. detect <file_path> [--output <output_file.json>] -> detect a specific file for webshell activity
  3. help -> for show this help message
  4. exit -> For Exit the Webshell Analyzer
  5. --output <output_file.json> -> Save the detection results to a JSON file

Example Output

Process Detecting Single file PHP

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

webshell_analyzer-1.0.1.tar.gz (1.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

webshell_analyzer-1.0.1-py3-none-any.whl (1.4 MB view details)

Uploaded Python 3

File details

Details for the file webshell_analyzer-1.0.1.tar.gz.

File metadata

  • Download URL: webshell_analyzer-1.0.1.tar.gz
  • Upload date:
  • Size: 1.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.3

File hashes

Hashes for webshell_analyzer-1.0.1.tar.gz
Algorithm Hash digest
SHA256 a6a28003150578a870fa2d3def87849340c50eb03aad5114aec5feed68504d75
MD5 32ef5955fb2c5c34e68db93369af7f67
BLAKE2b-256 37fe807df71dfed0dedf1a87c4e67b5c53987962a11ff59e5e888e56d3541e83

See more details on using hashes here.

File details

Details for the file webshell_analyzer-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for webshell_analyzer-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4b05965256a235022b0b56e0805ad1c0eec1a80294dca6445d7df1b51a3a59e9
MD5 3779990a3c952784f63518ab915c62dc
BLAKE2b-256 9c6ce6395ad8ca353fb9c73163284e4e68c1e27f24f1bfeb982b7de160173e97

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page