Skip to content

Commit d9633c8

Browse files
author
Alex
committed
Base code
1 parent ce8eba6 commit d9633c8

38 files changed

+13207
-3
lines changed

.travis.yml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
language: php
2+
3+
sudo: false
4+
5+
php:
6+
- 5.4
7+
- 5.5
8+
- 5.6
9+
- 7.0
10+
- 7.1
11+
- 7.2
12+
13+
before_script:
14+
- composer install --no-interaction --prefer-source --dev
15+
16+
script: vendor/bin/phpunit --configuration phpunit.xml

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2018 Ollyxar
3+
Copyright (c) 2018 Oleksii Svyrydenko
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

+63-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,63 @@
1-
# php-malware-detector
2-
PHP malware detector
1+
# PHP malware detector
2+
3+
[![Build Status](https://travis-ci.org/ollyxar/php-malware-detector.svg?branch=master)](https://travis-ci.org/ollyxar/php-malware-detector)
4+
![Version](https://poser.pugx.org/ollyxar/php-malware-detector/v/stable.svg)
5+
![Downloads](https://poser.pugx.org/ollyxar/php-malware-detector/d/total.svg)
6+
![License](https://poser.pugx.org/ollyxar/php-malware-detector/license.svg)
7+
8+
## Smart PHP vulnerability detector
9+
10+
Web mode:
11+
12+
![ollyxar php-malware-detector](https://i.imgur.com/oglUEpr.jpg)
13+
14+
Console mode:
15+
16+
![chat](https://i.imgur.com/VJ4548w.jpg)
17+
18+
## Using PHP malware detector
19+
20+
### Requirements
21+
* PHP 5.4+
22+
23+
24+
### Install php-malware-detector via [composer](http://getcomposer.org).
25+
26+
```bash
27+
# Install Composer
28+
curl -sS https://getcomposer.org/installer | php
29+
```
30+
31+
Next, run the Composer command to install the latest stable version of php-malware-detector:
32+
33+
```bash
34+
php composer.phar require ollyxar/php-malware-detector
35+
```
36+
37+
After installing, you need to require Composer's autoloader and run scan:
38+
39+
```php
40+
require 'vendor/autoload.php';
41+
42+
(new Scanner())->run();
43+
```
44+
45+
### Using php-malware-detector in Web-mode:
46+
47+
Put scanner.php in the web-root directory on the web-server and open your website in the browser (like http://mywebsite.com/scanner.php)
48+
49+
### Using php-malware-detector in Cron-mode:
50+
51+
You can schedule scanning process. To do that you have to add commend:
52+
53+
```bash
54+
php /path_to/scanner.php > "log.txt"
55+
```
56+
57+
### Additional parameters for scanner:
58+
59+
```php
60+
// First parameter is a scan directory
61+
// Second parameter is an array of file extensions to scan
62+
(new Scanner('/var/some_other_direcrory_to_scan'), ['php', 'txt', 'php5'])->run();
63+
```

composer.json

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"name": "ollyxar/php-malware-detector",
3+
"type": "library",
4+
"description": "PHP malware detector",
5+
"keywords": [
6+
"anti-virus",
7+
"shell",
8+
"malware",
9+
"scanner",
10+
"php",
11+
"library"
12+
],
13+
"homepage": "https://github.com/ollyxar/php-malware-detector",
14+
"license": "MIT",
15+
"authors": [
16+
{
17+
"name": "Oleksii Svyrydenko",
18+
"email": "[email protected]",
19+
"homepage": "https://ollyxar.com/"
20+
}
21+
],
22+
"require": {
23+
"php": ">=5.4"
24+
},
25+
"require-dev": {
26+
"phpunit/phpunit": "^6.0"
27+
},
28+
"autoload": {
29+
"psr-4": {
30+
"Ollyxar\\AntiMalware\\": "src/"
31+
}
32+
},
33+
"autoload-dev": {
34+
"psr-4": {
35+
"AntiMalware\\Tests\\": "tests/"
36+
}
37+
}
38+
}

phpunit.xml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit backupGlobals="false"
3+
backupStaticAttributes="false"
4+
bootstrap="vendor/autoload.php"
5+
colors="true"
6+
convertErrorsToExceptions="true"
7+
convertNoticesToExceptions="true"
8+
convertWarningsToExceptions="true"
9+
processIsolation="false"
10+
stopOnFailure="false"
11+
syntaxCheck="false">
12+
<testsuites>
13+
<testsuite name="Application Test Suite">
14+
<directory>./tests</directory>
15+
</testsuite>
16+
</testsuites>
17+
<php>
18+
<env name="APP_ENV" value="test"/>
19+
</php>
20+
</phpunit>

0 commit comments

Comments
 (0)