Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How would you programmatically test a file for viruses? [closed]

I want to programmatically test a file for viruses.

I'm aware of this thread, which didn't get a satisfactory answer in my opinion, but I'm not looking for an API here. Any kind of workaround to make it possible to test a file would be fine.

Of course, an API would probably be the best solution (I'm using .net on a Windows platform), but maybe it's possible to drop the file in the folder, and to then check whether I can still open it or if it's been quarantined by the antivirus software.

Has someone run into the same sort of situation?

like image 682
Brann Avatar asked Mar 02 '09 15:03

Brann


2 Answers

Assuming you wish to integrate with whatever antivirus is already present on the system rather than bundling your own, you should check out the way Firefox 3 does this.

Bugs 103487 and 408153 - Inform anti-virus software when Firefox downloads an executable (using the Windows "IOfficeAntiVirus" and "IAttachmentExecute" APIs).

(of course if you wish to bundle your own, check out ClamAV/ClamWin, but then you must deal with updates, etc, and you should probably first check there is not a fully updated solution on the target system for politeness)

like image 170
Colin Pickard Avatar answered Oct 03 '22 09:10

Colin Pickard


Windows? No problem. Check out ClamWin. It is based on ClamAV.

like image 22
TWA Avatar answered Oct 03 '22 08:10

TWA