I have a ClamAV installed on a RHEL 8 box. clamd is running, listening on port 3310.
If I run the command 'clamdscan' on the same host, it succeeds.
As per the man page of clamd, I created a text file with clamd commands in it:
PING
VERSION
SHUTDOWN
I then connect to clamd via curl and send this file, using the command below and expecting a response, but it fails:
curl -v -T commands-file ftp://127.0.0.1:3310
I get this output:
* Trying 127.0.0.1...
* TCP_NODELAY set
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Connected to 127.0.0.1 (127.0.0.1) port 3310 (#0)
0 0 0 0 0 0 0 0 --:--:-- 0:00:30 --:--:-- 0< COMMAND READ TIMED OUT
* response reading failed
0 0 0 0 0 0 0 0 --:--:-- 0:00:30 --:--:-- 0
* Closing connection 0
curl: (56) response reading failed
So I wonder if clamdscan is doing some magic that I am missing.
Any help would be appreciated.
Curl is the wrong tool to use as the ClamAV server is listening on TCP, not on HTTP/HTTPS.
To check connectivity to the ClamAV server, use telnet: