edu.ntnu.item.jt.system
Class PowerScan

java.lang.Object
  extended by edu.ntnu.item.jt.system.PowerScan

public class PowerScan
extends Object

Central "control point" for the PowerScan application. Provides some simple functionality between the UI and the executing classes.

Author:
Jøran Vagnby Lillesand

Constructor Summary
PowerScan(String xmlConfigFile, String properties)
          Instantiates a new PowerScan object.
 
Method Summary
 ArrayList<DynamicAnalysisResult> executeInAnalysisTool(String malwareSample)
          Run the supplied malware sample in all the registered dynamic analysis tools
 ArrayList<ScanResult> executeMalwareSample(String malwareSample)
          Execute the supplied malware sample on all registered scanners.
static String getLastUpdate()
          Get the date of the last call to PowerScan.update() from this client.
static Logger getLogger(String filename, String className)
          Create a logger that logs to the given file for a class with the given name.
static void main(String[] args)
           
 ArrayList<ScanResult> scan(String malwareSample)
          Perform a surface scan of the given malware sample file using the registered anti-virus engines.
 ArrayList<AVUpdateResult> update()
          Attempt to update all scanner registered in the system.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PowerScan

public PowerScan(String xmlConfigFile,
                 String properties)
          throws ParserException,
                 InvalidFileException,
                 XMLValidationException,
                 FileNotFoundException
Instantiates a new PowerScan object. Accepts the system's two configuration files (xml config and properties) and initalizes/parses these. The instantiated PowerScan object should be used to perform PowerScan system operations.

Parameters:
xmlConfigFile - path to the XML config file with the setup parameters for the system.
properties - path to the properties file containing the system constants.
Throws:
ParserException - if parsing of the XML config file failed.
InvalidFileException - if the XML config file could not be read.
XMLValidationException
FileNotFoundException
Method Detail

scan

public ArrayList<ScanResult> scan(String malwareSample)
Perform a surface scan of the given malware sample file using the registered anti-virus engines.

Parameters:
malwareSample - path to the malware sample to be scanned.
Returns:
list of the scan results reported from the antivirus engines.
Throws:
NoScannersLoadedException - no scanners were loaded during initialization of the system, thus no engines are available to perform scan.

update

public ArrayList<AVUpdateResult> update()
Attempt to update all scanner registered in the system.

Returns:
list of update results.

getLastUpdate

public static String getLastUpdate()
                            throws NoMatchFoundException
Get the date of the last call to PowerScan.update() from this client.

Returns:
String representing the date of the last update() call.
Throws:
NoMatchFoundException
See Also:
update()

executeMalwareSample

public ArrayList<ScanResult> executeMalwareSample(String malwareSample)
Execute the supplied malware sample on all registered scanners. If a scanner does not support real time scanning, the Scanner object associated with it will not attempt to execute the malware.

Parameters:
malwareSample - absolute or relative path to the sample to be executed.
Returns:
list of scan results resulting from the operation.

executeInAnalysisTool

public ArrayList<DynamicAnalysisResult> executeInAnalysisTool(String malwareSample)
Run the supplied malware sample in all the registered dynamic analysis tools

Parameters:
malwareSample - path to the malware sample to be analyzed
Returns:
list of analysis tool result objects

getLogger

public static Logger getLogger(String filename,
                               String className)
Create a logger that logs to the given file for a class with the given name.

Parameters:
filename - name of the file to log to. Can be both relative and absolute.
className - name of the class to create the Logger object for (should be full package path).
Returns:
instance of the logger with the requested parameters.

main

public static void main(String[] args)
                 throws Exception
Throws:
Exception