Saturday, 6 October 2012

ClamAv Antivirus Setup



Windows:-

1. Download the appropriate installer package.-- ClamAV/tBB [http://hideout.ath.cx/clamav] Installation and update --

2. Install ClamAV to c:\clamav. The installer can create the clamd and
freshclam services which is the recommended way of running them.

Note: If you don't install ClamAV to c:\clamav you *have* to edit the
clamd.conf and freshclam.conf configuration files before starting the
ClamAV services and change the paths accordingly!

3. Open a CMD window in the ClamAV folder.

4. Run freshclam.exe once to download the signature databases.

5. If you want to use the clamd and freshclam services, enter 'net start clamd'
and 'net start freshclam' at the CMD prompt to start them. If you don't want to
use the service mode you can use the supplied chp.exe to start clamd/freshclam
in the background (without a open CMD window).

6. You're done. If you don't use the freshclam service remember to call
freshclam.exe regularly (e.g. once per hour) by the scheduler.


References:

1. Download URL




Linux:-






Useful Commands:

tasklist /svc – To See the service(windows)

To know UNIX flabour:-
uname -a
cat /etc/issue

Check port number:-
netstat -ntpul|grep clam

service clamd status – Check service status

/root/clamav-0.97/etc : contains configuration files

export CLASSPATH=$CLASSPATH:/root/ClamAvTesting/clamavj-0.1.jar:.

Virus file for testing:
--------------------------

$CeliacmaTrESTuScikgsn$FREE-TEST-SIGNATURE$EEEEE$

Save above content in a text file and scan the file.

Smaple java Code :

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.net.InetAddress;
import java.net.UnknownHostException;

import com.philvarner.*;
import com.philvarner.clamavj.ClamScan;
import com.philvarner.clamavj.ScanResult;

public class MainTest {

/**
* @param args
* @throws UnknownHostException
* @throws FileNotFoundException
*/
public static void main(String[] args) throws UnknownHostException, FileNotFoundException {
// TODO Auto-generated method stub
String host = "192.168.105.113";
int port = 3310;
int timeout = 60;
InetAddress address=InetAddress.getLocalHost();
ClamScan clamScan = new ClamScan(host,port,timeout);
InputStream io = new FileInputStream("C:\\Documents and Settings\\Tapas.Patra\\Desktop\\Clam.txt");
ScanResult sr = clamScan.scan(io);
System.out.println("Status : "+clamScan.ping());
System.out.println(sr.getStatus()+"=========="+sr.getSignature());
}
}

No comments:

Post a Comment