scr34m / php-malware-scanner

Scans PHP files for malwares and known threats
GNU General Public License v3.0
556 stars 96 forks source link

Can i use this scanner from browser? #90

Closed CDrosos closed 4 months ago

CDrosos commented 1 year ago

i dont have terminal access. is it possible to upload the files of this scanner, open the scanner from browser and clean wordpress site with it? thanks

scr34m commented 1 year ago

Yes you can, just call the scanner from a PHP file with the parameters. There is an argument in a constructor which is tell the class is cli mode or not.

CDrosos commented 1 year ago

thanks for the fast response. do you have any recomended settings to scan a wordpress site except Wordpress md5 sum whitelisting?

scr34m commented 1 year ago

Just run the scan on the files by default, nothing fancy needed. You can hide whitelisted and ok files to suppress the noise maybe.

CDrosos commented 1 year ago

from docs i see i have to create a php file with code something like that

<?php

require_once '../scan.php';

$scan = new MalwareScanner();
$scan->setFlagHideWhitelist(true);
$scan->setFlagHideOk(true);
$scan->run('../samples/test');

im not sure what is this last line with samples. if i remove the last line is enough? how i can add Wordpress md5? should i do: $scan->'scan -d . -j 6.3.1'; instead of the last line? sorry for so many questions i havent done something like that again

scr34m commented 1 year ago

The last line is which directory you would like to scan. The version check for wordpress is not mandatory at first start simple. But there are the options and you can find in the code the corresponding set function.