Web Shell Detector – is a php script that helps you find and identify php/cgi(perl)/asp/aspx shells.

Overview

Web Shell Detector

Web Shell Detector – is a php script that helps you find and identify php/cgi(perl)/asp/aspx shells. Web Shell Detector has a “web shells” signature database that helps to identify “web shell” up to 99%. By using the latest javascript and css technologies, web shell detector has a light weight and friendly interface.

Web Shell Detector is released under the MIT License http://www.opensource.org/licenses/mit-license.php

Console version (python): https://github.com/emposha/Shell-Detector

Contributors

Piotr Łuczko

John Thornton

Detection

Number of known shells: 604

Requirements

PHP 5.x, OpenSSL (only for secure file submission)

Usage

To activate Web Shell Detector:

  1. Upload shelldetect.php and shelldetect.db to your root directory

  2. Open shelldetect.php file in your browser

    Example: http://www.website.com/shelldetect.php

  3. Use default username & password

    Username: admin Password: protect

  4. Inspect all strange files, if some of files look suspicious, send them to http://www.shelldetector.com team. After submitting your file, it will be inspected and if there are any threats, it will be inserted into a “web shell detector” web shells signature database.

  5. If any web shells found and identified use your ftp/ssh client to remove it from your web server (IMPORTANT: please be careful because some of shells may be integrated into system files!).

Demo

http://www.emposha.com/demo/shelldetect/

Options

  • extension - extensions that should be scanned
  • showlinenumbers - show line number where suspicious function used
  • dateformat - used with access time & modified time
  • langauge - if I want to use other language
  • directory - scan specific directory
  • task - perform different task
  • report_format - used with is_cron(true) file format for report file
  • is_cron - if true run like a cron(no output)
  • filelimit - maximum files to scan (more then 30000 you should scan specific directory)
  • useget - activate _GET variable for easy way to recive tasks
  • authentication - protect script with user & password in case to disable simply set to NULL
  • remotefingerprint - get shells signatures db by remote

Changelog

  • 1.66 thanks to John Thornton for small tweeks and php 5.3.3 support

  • 1.64 settings ini file support added(in case that you want to use same settings without code changing), output method rewriten, is_cron fixed, italian translation added (thanks to Marco Saiu)

  • 1.63 new shell recognize mechanizm added, shell signatures updated.

  • 1.62 version of jquery reverted to 1.7.x due bug with jquery ui dialog, new type of files added, shells signatures updated

  • 1.61 added new way to send suspicious files, some css & code fixes, new shells signatures added

  • 1.6 added support to indicate not shell files (but still those files need to be removed), loader indicator added

  • 1.52 noindex meta tag added (to remove script from search results), scann all files options added: extension = *

  • 1.51 unpack function update

  • 1.5 unpack function added, application version check added, many warnings fixed, error handler fixed.

  • 1.4 hide suspicious files option added, file scanning changed.

  • 1.3 submission of suspicious file to shelldetector.com changed, email field added with ability to get notify about suspicious file.

  • 1.2 encryption function added, authentication added, some small bugs fixed

  • 1.1 fingerprint function change show line regex changed

  • 1.0 first version

Comments
  • manage to bypass the regex & signature using backtick to execute shell operation

    manage to bypass the regex & signature using backtick to execute shell operation

    regex that might help: /.*?\$.*?/

    To reduce false positive due to the usage of regex, you can use php tokenizer to eliminate the "strings" that is not important such as commented code/information/header etc etc..

    http://php.net/manual/en/book.tokenizer.php

    opened by xanda 4
  • Error: Undefined offset: 1 line: 268

    Error: Undefined offset: 1 line: 268

    Hello,

    I've uploaded shelldetect.php and /shelldetect.db in my root directory and executed it and it gives me this type of result on a brand new fresh uploaded site !

    modules/mod_languages/helper.php

    Owner: 5500 Permission: 0644 Last accessed: 12:31:11 04/09/2012 Last modified: 09:45:42 19/07/2012 MD5 hash: 4828db57f0ea1c460fa9796532257f2a Filesize: 2.5 KB Error: Undefined offset: 1 line: 268 Error: Undefined offset: 4 line: 268 Error: Undefined offset: 3 line: 269 Fingerprint: Positive, it`s a ()

    at the end

    Status: 7 suspicious files found and 1699 shells found

    What are thoses 3 errors ?

    opened by nangenon 2
  • typo in cfg file

    typo in cfg file

    Line 6 of shelldetect.ini file got typo error. Must be language instead of langauge. Little bit confusing, takes some time to realize why language isn't applied.

    opened by eyedmax 1
  • php error

    php error

    Line 35 of shelldetect.php says:

    $shelldetector::$_settings['is_cron']=true; 
    

    It's a syntax error. Maybe this should work:

    shelldetector::$_settings['is_cron']=true;
    
    opened by eyedmax 1
  • Fix typographical error(s)

    Fix typographical error(s)

    @emposha, I've corrected a typographical error in the documentation of the PHP-Shell-Detector project. Specifically, I've changed carefull to careful. You should be able to merge this pull request automatically. However, if this was intentional or if you enjoy living in linguistic squalor, please let me know and create an issue on my home repository.

    opened by orthographic-pedant 0
  • Keep asking username and password

    Keep asking username and password

    Hello, I just uploaded on my server root and it asking username and password on alert like authentication and not getting logged success at all.

    I am using default username and password: Username: admin Password: protect

    Screenshot: http://prntscr.com/hpx26u

    opened by nomadicshiv 2
  • Made $hidesuspicious setting TRUE by default

    Made $hidesuspicious setting TRUE by default

    Currently $hidesuspicious is set to be false by default on line 87:

      private $hidesuspicious = true;
    

    and the only other place where its value is set is on line 155:

        if (isset($_GET['s']) && 1 == $_GET['s']) {
          $this->hidesuspicious = false;
        }
    

    ... where it's set to false again. Basically this means $hidesuspicious is forever false. This makes the program display A LOT of data to the screen, and more than often (in my case) renders to browser inresponsive, or even crash.

    opened by phanan 0
  • Fix for blocked mixed content

    Fix for blocked mixed content

    On modern browsers, calling this skript with https would create errors like "blocked mixed content".

    • i removed "http:" for the external jquery Stuff, now it uses http or https as needed
    • in Function fileprepare i replaced "http//www.shelldetector.com/api/loader.html" with "about:blank"
    opened by sbreiler 2
  • shell-detector looks like the malware it says it's scanning

    shell-detector looks like the malware it says it's scanning

    this code is problematic, to say the least:

        if (file_exists('shelldetect.db')) {
          $context = stream_context_create(array('http' => array('timeout' => 30)));
          $this->fingerprints = unserialize(base64_decode(file_get_contents('shelldetect.db', 0, $context)));
        }
        if ($this->remotefingerprint) {
          $this->fingerprints = unserialize(base64_decode(file_get_contents('https://raw.github.com/emposha/PHP-Shell-Detector/master/shelldetect.db')));
        }
      }
    

    now not only does this look like the malware it's suppose to stop, it's actually vulnerable to remote code execution (if file_get_contents('https://...) can be broken, which I wouldn't be surprised - yay sslstrip) as unserialize will happily execute code it uncompresses: http://ca1.php.net/manual/en/function.unserialize.php#refsect1-function.unserialize-notes

    seriously, why is this DB stored that way anyways? it's just a huge array... why not store it in a non-executable code format?

    opened by anarcat 12
YAPS - Yet Another PHP Shell

YAPS - Yet Another PHP Shell Yeah, I know, I know... But that's it. =) As the name reveals, this is yet another PHP reverse shell, one more among hund

Nicholas Ferreira 60 Dec 14, 2022
I gues i tried to make a shell that's looks like a terminal in single php file

php-shell-gui Terms of service This tool can only be used for legal purposes. You take full responsibility for any actions performed using this. The o

Squar3 4 Aug 23, 2022
A simple object oriented interface to execute shell commands in PHP

php-shellcommand php-shellcommand provides a simple object oriented interface to execute shell commands. Installing Prerequisites Your php version mus

Michael Härtl 283 Dec 10, 2022
ReactPHP Shell, based on the Symfony Console component.

Pecan Event-driven, non-blocking shell for ReactPHP. Pecan (/pɪˈkɑːn/) provides a non-blocking alternative to the shell provided in the Symfony Consol

Michael Crumm 43 Sep 4, 2022
A developer-friendly wrapper around execution of shell commands.

ptlis/shell-command A developer-friendly wrapper around execution of shell commands. There were several goals that inspired the creation of this packa

brian ridley 18 Dec 31, 2022
An Interactive Shell to Lumen Framework.

ABANDONED Please consider to use the official Laravel Tinker, it is also compatible with Lumen: laravel/tinker Lumen Artisan Tinker An Interactive She

Vagner Luz do Carmo 112 Aug 17, 2022
A CLI program that helps you check your endpoints by requesting the given servers and send a report message in any supported channel like Telegram

API Monitor A CLI program that help you check your endpoints by requesting the given servers and send a report message in any supported channel ( Tele

Hussein Feras 51 Aug 21, 2022
BetterWPCLI - a small, zero-dependencies, PHP library that helps you build enterprise WordPress command-line applications.

BetterWPCLI - a small, zero-dependencies, PHP library that helps you build enterprise WordPress command-line applications.

Snicco 5 Oct 7, 2022
php command line script to DCA crypto from Coinbase Pro

dca.php A simple php script designed to be run via the command line via a cron job. This will connect to coinbase pro and buy the crypto coins specifi

Ben Suffolk 2 Oct 22, 2021
A Cli tool to save you time, and gives you the power to scaffold all of your models,controllers,commands

A Cli tool to save you time, and gives you the power to scaffold all of your models,controllers,commands... at once Installation You can install the p

Coderflex 16 Nov 11, 2022
PHP Interminal is a command-line tool that gives you access to PHP Internals discussions in your terminal.

PHP Interminal is a command-line tool that gives you access to PHP Internals discussions in your terminal. ??

Nuno Maduro 32 Dec 26, 2022
A powerful command line application framework for PHP. It's an extensible, flexible component, You can build your command-based application in seconds!

CLIFramework CLIFramework is a command-line application framework, for building flexiable, simple command-line applications. Commands and Subcommands

Yo-An Lin 428 Dec 13, 2022
👨🏻‍🚀 A command-line tool that gives you the Alpine Day 2021 schedule in your timezone. 🚀

Alpine Day Schedule a command-line tool that gives you the Alpine Day 2021 schedule in your timezone. ?? Quick start Requires PHP 7.4+ # First, instal

Nuno Maduro 11 Jun 10, 2021
Laracon Schedule a command-line tool that gives you the Laracon Online schedule in your timezone.

Laracon Schedule a command-line tool that gives you the Laracon Online schedule in your timezone. ?? Quick start Requires PHP 7.4+ # First, install: c

Nuno Maduro 101 Sep 16, 2022
This command will guide you through upgrade your composer.json config rom version 1 to version 2.

Upgrade composer.json This command will guide you through upgrade your composer.json config rom version 1 to version 2. How to use: $ cd YOUR_PROJECT_

Ehsan Sabet 3 May 18, 2022
A simple tool to backup data & db from a web server to Google Drive.

PHP Google Drive backup - A (very) simple CLI tool that I used to backup my www directory and my database from OVH to Google Drive, in a cronjob.

Alex 18 Jan 4, 2023
Host Onion services in dark web using Heroku CLI

Tor Onion Service On Heroku Host Tor v3 Hidden Service in dark web using heroku Try my another repository built with php https://github.com/sumithemma

Emmadi Sumith Kumar 34 Dec 13, 2022
A PHP Command Line tool that makes it easy to compile, concat, and minify front-end Javascript and CSS/SCSS dependencies.

Front End Compiler A PHP Command Line tool that makes it easy to compile, concat, and minify front-end Javascript and CSS/SCSS dependencies. The minif

Happy Medium 2 Nov 12, 2021
Termage provides a fluent and incredibly powerful object-oriented interface for customizing CLI output text color, background, formatting, theming and more.

Termage provides a fluent and incredibly powerful object-oriented interface for customizing CLI output text color, background, formatting, theming and

TERMAGE 75 Dec 20, 2022