Question

I would like to write a small commandline scanner using ClamAV and Python. I have tried several tutorials and instructions on this matter, but have been unable to get this working. Everything I have read says I need ClamAV, Clamd and Python installed. I have Python and ClamAV, but where exactly do I get Clamd? How does it all work together? Which module should I use? pyclamav or pyclamd?

Was it helpful?

Solution

Looks like clamd is a deamon (service) which should come for you with your ClamAV installation. The documentation says that it runs on TCP/IP port and accepts certain commands. So all you need to do in your python script is to connect to it over socket, (Read Socket Programming Howto) and then issue the commands like SCAN, or MULTISCAN over the socket.

I hope that is what you are looking for. Otherwise give some trials on your own and try to to post the what failed or where you got struck.

OTHER TIPS

pyclamd is recommended over pyclamav. It works well as a scanner, but I have not yet figured out how to use it to quarantine a file.

(yes, I realize this thread is 2 years old, but still, it's helpful info :))

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top