Skip to content
Snippets Groups Projects
Commit 1d313fa8 authored by Tibo's avatar Tibo
Browse files

Added a binary to search webshells from the command line + configured in...

Added a binary to search webshells from the command line + configured in composer.json + updated README
parent 8d1b29ca
No related branches found
No related tags found
No related merge requests found
......@@ -2,11 +2,14 @@
[![Build Status](https://travis-ci.org/RUCD/webshell-detector.svg?branch=master)](https://travis-ci.org/RUCD/webshell-detector) [![Latest Stable Version](https://poser.pugx.org/rucd/webshell-detector/v/stable)](https://packagist.org/packages/rucd/webshell-detector) [![Total Downloads](https://poser.pugx.org/rucd/webshell-detector/downloads)](https://packagist.org/packages/rucd/webshell-detector) [![Latest Unstable Version](https://poser.pugx.org/rucd/webshell-detector/v/unstable)](https://packagist.org/packages/rucd/webshell-detector) [![License](https://poser.pugx.org/rucd/webshell-detector/license)](https://packagist.org/packages/rucd/webshell-detector)
## Installation
## Installation and usage
```composer require rucd/webshell-detector```
The webshell detector can be integrated as a composer library to your project,
or you can run it from the command line.
### As a library
## Usage
```composer require rucd/webshell-detector```
```php
require_once "vendor/autoload.php";
......@@ -15,4 +18,22 @@ use RUCD\WebshellDetector\Detector;
$detector = new Detector();
echo $detector->analyzeFile("strange_file.php");
```
\ No newline at end of file
```
### From the command line
```composer global require rucd/webshell-detector```
This will install webshell-detector to your global vendor binaries directory
(usually **~/.composer/vendor/bin**). If this directory is part of your path,
you can run it directly:
```webshell-detector <filename>```
Or, if the global vendor binaries directory is not part of your path:
```~/.composer/vendor/bin/webshell-detector <filename>```
#!/usr/bin/env php
<?php
require_once __DIR__ . "/../vendor/autoload.php";
use RUCD\WebshellDetector\Detector;
if ($argc != 2) {
echo "Usage: " . $argv[0] . " <filename>\n";
exit();
}
$filename = $argv[1];
$detector = new Detector();
echo $detector->analyzeFile($filename) . "\n";
\ No newline at end of file
......@@ -25,5 +25,6 @@
"psr-4": {
"RUCD\\WebshellDetector\\": "src"
}
}
},
"bin": ["bin/webshell-detector"]
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment