Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Antivirus integration in PHP

I want to integrate antivirus plugin in my code ( To check the files when users are uploading or downloading, Like yahoo mail). How do we integrate an antivirus component inside PHP? Any ideas or help would be appreciated. Thanks a bunch.

like image 716
Coolbreeze Avatar asked Mar 30 '11 09:03

Coolbreeze


People also ask

Is PHP an antivirus?

An ideal solution for shared hosting environments, where it's often not possible to utilise or install conventional anti-virus protection solutions, phpMussel is a PHP script designed to detect trojans, viruses, malware and other threats within files uploaded to your system wherever the script is hooked, based on the ...

How do I scan PHP for malicious code?

PHP Antimalware Scanner is a free tool to scan PHP files and analyze your project to find any malicious code inside it. It provides an interactive text terminal console interface to scan a file, or all files in a given directory, and find PHP code files that seem to contain malicious code.

How to use clamav in PHP?

Example CodeIgniter Usage$this->load->library('clamav', array('clamd_sock' => '/path/to/clamd. sock')); Scan a file.

How scan upload Virus for virus programmatically in PHP?

5 A Small Example. We will now create a small upload script, /var/www/upload. php, which contains an HTML upload form. If you submit the form, the script will call itself and use cl_info(), cl_scanfile(), cl_setlimits(), and clam_get_version() to scan the uploaded file for viruses.


1 Answers

That depends on which AV solution you are using. If there is no bindings for PHP for that particular solution, you have to see if you can trigger the av check through system or exec calls.

An example of an AV solution that actually does provide bindings for usage with PHP would be

  • http://sourceforge.net/projects/php-clamav/
like image 74
Gordon Avatar answered Nov 08 '22 05:11

Gordon