Scanning modes

A scanning mode defines types of objects to be checked against malware and other options that can be used while scanning. For example, scanning of archived files can be turned on or off, or heuristic code analyzer can be enabled or disabled.

The scanning mode to be used by the scanning function or monitor is determined by a value of the dwScanningMode variable. This value is a bitwise OR combination of the options listed in the table below.

Scanning mode options

Scanning option

Description

KAV_O_M_PACKED

Scanning of compressed executable files is on.

KAV_O_M_ARCHIVED

Scanning of archived files is on.

In current version of the SDK, the KAV Engine will automatically add the KAV_O_M_PACKED flag to the scanning mask if you set the KAV_O_M_ARCHIVED flag. Enabling scanning of archive files also automatically enables scanning of packed executable files, but the converse is not true.

 

This option is not supported for real time scanning of files with File Monitor component. When this flag is specified in File Monitor settings, scanning of archived files is not performed by the monitoring component, instead scanning of compressed executable files toggles on. Specifying the KAV_O_M_ARCHIVED flag effectively sets scanning mode otherwise enabled using the KAV_O_M_PACKED flag. Remember, you specify the scanning mode for File Monitor by setting the bitmask of the dwScanningMode member of a specific data structure you are using to initialize scanning settings for File Monitor. You may consider using the recommended KAV_FILE_MONITOR_SETTINGS2 data structure.

Scanning of nested archives is supported only for their nesting level does not exceed the value set by the kaveSetMaxDepth function.

KAV_O_M_BACKUP

Placing original copies of infected objects before curing or deletion to the backup storage is on.

On detection of infected compound object (an archive, packed object, email message, or mail base) the copy of entire object is placed to the backup storage, not the infected part only.

This flag can be used by the following scanning functions and modules:

  • kaveScanFile
  • kaveScanCriticalArea
  • kaveScanForRootkitsInFolder
  • kaveLoadMonitor operating as File Monitor
  • kaveLoadMonitor operating as Mail Monitor.

    When one of these functions is called with this flag and detects an infected object, it automatically puts the original copy of the infected file to the backup storage, and only then further operations like curing or deletion are performed. The operations correspond to the selected cleaning mode.

    For other scanning functions this flag is ignored.

    When this flag is used in the KAV_CLEAN_DELETE cleaning mode, the following sequence of actions is performed by KAV SDK for the scanned file if the file cannot be disinfected:

    Stage I. Scanning engine attempts to disinfect the file

  • The EVENT_BACKUP event is raised and the scanned file is placed to the backup storage with the subsequent EVENT_BACKUPSUCCEEDED event raised
  • When the file cannot be disinfected, this file is first removed from the backup storage and the EVENT_BACKUPDELETED event is raised for the scanned file

    Stage II. Scanning engine attempts to the delete the file at its original location

  • The EVENT_BACKUP event is raised for and the scanned file is placed to the backup storage with the subsequent EVENT_BACKUPSUCCEEDED event raised
  • The original copy of the file is removed and its backup copy is kept in the backup storage

    For general information on the backup functionality, see section "About backup storage".

KAV_O_M_MAILPLAIN

Scanning of email messages is on.

Setting this scanning option enables support for the following formats of plain email message files:

  • Text message files in RFC 822 format
  • Outlook® message files (MSG)
  • Any files encoded using UUE/XXE/base64 text encodings such as UUE archives.

    This option is not recommended for real time scanning as this can significantly affect system performance.

KAV_O_M_MAILBASES

Scanning of email database files is on.

Setting this scanning option enables support for the following formats of mail databases:

  • Outlook Express
  • The Bat!
  • Berkeley Message Base (Berkeley UNIX) format files such as Berkeley mailbox format archives
  • Other email storage database files that store emails

Please note that some files in Berkley Message Base (BMB) format are not necessary emails but may likely be log files stored on some UNIX servers, which are often BMB-encoded. When using this scanning option, please make sure to exclude such log files from the scanning location or scanning may take longer time.

This option is not recommended for real time scanning as this can significantly affect system performance.

KAV_O_M_ICHECKER

The iChecker acceleration mechanism is on.

The iChecker technology is only supported on Windows platform. You must not use this flag on Unix-like platforms.

The flag only affects the kaveScanFile function and File Monitor and has no impact on other functions. The iChecker technology is only supported by file on-demand scanning and File Monitor component.

This technology is aimed at increasing the scan speed by excluding certain objects from the scan.

If the object has been already scanned, anti-virus database is not outdated, and no changes are made to the object and to the scan settings, this object will be skipped while scanning. If at least one of the above conditions is not met, for example new file is added to the scanned archive, the object will be scanned again.

There are limitations to the iChecker algorithm. It does not operate with files of large size, and can be applied only to the files of specific formats which are known to the KAV Engine. Supported file types are but not limited to: EXE, DLL, LNK, TTF, INF, SYS, COM, CHM, ZIP, RAR.

Accelerating technologies are implemented in a special driver, so this option is supported only when the KLIF.sys file is installed together with the SDK.

KAV_O_M_ISWIFT

The iSwift acceleration mechanism is on.

The iSwift technology is only supported on Windows platform. You must not use this flag on Unix-like platforms.

If the computer is using the NTFS file system, enabling the KAV_O_M_ISWIFT option turns the iSwift technology on, in addition to the iChecker technology.

The iSwift technology is a development of the iChecker technology for the NTFS file system. This method can be applied only to the objects in NTFS file system, and it is bound to a specific location of the file.

Accelerating technologies are implemented in a special driver, so this option is supported only when the KLIF.sys file is installed together with the SDK.

KAV_O_M_NTFS_ADS

Scanning of NTFS alternate data streams is on.

This option flag is automatically used at the initialization of File Monitor component. Whenever File Monitor is used, there is no need to specify this flag explicitly when initializing the component.

Make sure to turn on this scanning mode when integrating KAV SDK on a desktop Windows platforms.

This option is ignored for Linux-based solutions.

KAV_O_M_ADVDIS

Turns on Advanced Disinfection scanning mechanism.

This functionality allows disinfection of active malware that is currently working on the computer being scanned. This applies to the malware detected when disinfecting objects that were intercepted while performing the following operations:

This option is supported only when the KLIF.sys file is installed together with the KAV SDK.

 

This option is ignored for Linux-based solutions.

KAV_O_M_SYSMEM_IMAGES_ONLY

This option is used for the kaveScanCriticalArea function and turns on scanning for process files image on a disk. This is performed during system memory scan only.

KAV_O_M_SYSMEM_OWNPROCESS_ONLY

This option is used for the kaveScanCriticalArea function and turns on scanning only those modules that are loaded into the KAV SDK client process; other processes are ignored. This is performed during system memory scan only.

KAV_O_M_SKIPSIGNED

Turns on the Skip signed mode. In this mode, KAV SDK overrides scan results for signed files. If KAV SDK detects an infected file, and this file has a valid digital signature, the file is marked as clean.

The digital signature must be issued by Microsoft.

This scanning mode is required when integrating KAV SDK on desktop Windows platforms. Please make sure to include the HIPS2 KAV SDK component in your build when using this mode. See kaveEnableAutoReload to find out how you may obtain the HIPS2 component and automatically prepare it for usage in KAV SDK.

The EVENT_PREDETECT and EVENT_DETECT event codes are not issued for signed files and EVENT_OK is raised with the result of scanning.

The KAV_O_M_SKIPSIGNED option flag is supported for on-demand (using scanning functions) and on-access (using monitoring components) types of scanning.

Following on-demand scanning functions support this scanning mode:

  • kaveScanFile
  • kaveScanCriticalArea

    Following on-access scanning components support this scanning mode:

  • File Monitor
  • Mail Monitor

    Requires KAV SDK 8.5.x or later.

    In versions 8.6.1.x or later KAV SDK verifies digital signatures independent of the state of KAV_O_M_SKIPSIGNED option flag. This is the default behavior for all types of scanning except for scanning made through your custom partner function, see Using partner scan function. When scanning is made through a partner scanning function, KAV SDK always checks the status of KAV_O_M_SKIPSIGNED option flag before checking validity of digital signatures.

    When using this scanning option, the KAV SDK checks validity of the digital signature of the file being scanned. If KAV SDK cannot verify the digital signature for the file, the file is considered unsigned and KAV SDK scans this file for malware. If the digitally signed file is scanned by KAV SDK, please review the log file to find out why. Information about errors verifying digital signatures is output to log files.

This option is used only in Windows solutions.

KAV_O_M_HEURISTIC_LEVEL_SHALLOW

Advanced heuristic code analyzer is on. This analyzer is based on improved detection technology; the scanning level will be shallow.

The level of detail of the advanced heuristic analyzer provides the balance between quality of the scan for new threats and the load on operating system resources, as well as the duration of the scan. The resources, as well as the duration of the scan. The higher the advanced heuristics level is, the more system resources the scan will require, and the longer it will take.

This option is recommended both for on demand scanning and file monitoring.

KAV_O_M_HEURISTIC_LEVEL_MEDIUM

Advanced heuristic code analyzer is on. This analyzer is based on improved detection technology; the scanning level will be medium.

The level of detail of the advanced heuristic analyzer provides the balance between quality of the scan for new threats and the load on operating system resources, as well as the duration of the scan. The higher the advanced heuristics level is, the more system resources the scan will require, and the longer it will take.

For file monitoring, it is recommended to turn off this option as this can significantly affect system performance.

KAV_O_M_HEURISTIC_LEVEL_DETAIL

Advanced heuristic code analyzer is on. This analyzer is based on improved detection technology; the scanning level will be detailed.

The level of detail of the advanced heuristic analyzer provides the balance between quality of the scan for new threats and the load on operating system resources, as well as the duration of the scan. The higher the advanced heuristics level is, the more system resources the scan will require, and the longer it will take.

This option is recommended for POP3 monitoring, but this can affect system performance.

For file monitoring, it is recommended to turn off this option.

KAV_O_M_HEURISTIC_LEVEL_MAXIMUM

This flag allows you to turn on a thoroughgoing heuristic analysis mode in KAV Engine that empowers your application with an even more tricky heuristic emulation of files and other objects you are scanning.

Enabling this scanning mode provides for superior detection rate by implementing the maximum possible depth of heuristic emulation.

Extremely thorough heuristic emulation is offered in exchange for scanning performance. Using this scanning mode may result in significant scanning performance degradation. Please consult with your Technical Account Manager (TAM) before using this flag for scanning in your application.

KAV_O_M_BLOCK_RISKWARE

This flag can only be used with File Monitor. To use this flag make sure kaveLoadMonitor function is called with the enMonitorType argument of the MONITOR_TYPE enumeration type is set to FILE_MONITOR value.

Blocking of potentially dangerous software is on.

You may consider to avoid using this flag to eliminate the possibility of a user losing access to a file that is potentially dangerous.

When this flag is specified, the File Monitor blocks access to the file detected as KDT_RISKWARE. For more information, see section "Detection types and severity".

KAV_O_M_URL

Enables scanning of every requested URL address.

When a web page is opened in a web browser, its web address is verified against the Web Malicious Url Filtering (WMUF) database. This includes web addresses requested from the browser application and URL addresses of web pages requested in the web page being opened. If a used opens a web page that contains a script or an iFrame requesting another web address, both the address of the source web page and embedded URL addresses are verified against WMUF.

KAV_O_M_COMPOSITE_SCAN_KSN

Enables scanning of multipacked files using Kaspersky cloud.

Multipacked files such as archive files or self-extracting archives packed multiple times or files with embedded OLE objects may be scanned in the Kaspersky KSN cloud service.

When this flag is specified in the dwScanningMode parameter of a specific scanning function you are using, or within the settings of a data structure for a specific monitoring component, scanned multipacked files may be additionally scanned in the cloud.

In-cloud scanning serves as an additional measure of malware detection. The KAV_O_M_COMPOSITE_SCAN_KSN bit flag controls scanning behavior for the case when scanning by local malware definition database did not reveal a threat.

If scanning using local definitions found a threat, KAV SDK re-scans the object in cloud even if KAV_O_M_COMPOSITE_SCAN_KSN is turned off. Re-scanning with the cloud data allows to protect against false detections.

When status of scanning of the object by using local definition database is KAV_S_R_CLEAN, KAV SDK verifies the status of KAV_O_M_COMPOSITE_SCAN_KSN. If the flag is turned off, no in-cloud checks are made. If the flag is turned on, KAV SDK re-scans the object by using the KSN service.

Please use the kaveSetMaxDepth function to specify the maximum nesting level of the multipacked files. Files within the multipacked files that are nested deeper the specified level are skipped from scanning. These nesting constraints do not propagate to the nesting level of folders within a packed file. The multipacked file may have an unlimited number of nested folders with the limited number of nested archives.

This mode is available in the following API, depending on the scanning type you are using.

  • When using the ODS (on-demand) scanning

    Every scanning function supported in KAV SDK API, see section "Scanning functions".

  • When using OAS (on-access) scanning

    Only Web Monitor and Mail Monitor components are supported. These components are configured using KAV_WEB_MONITOR_SETTINGS3 and KAV_POP3_MONITORSETTINGS data structures respectively.

    This scanning mode is not supported in the File Monitor and Proactive Defense Monitor components.

    This must be used with any combination of the following flags:

  • KAV_O_M_PACKED
  • KAV_O_M_ARCHIVED
  • KAV_O_M_MAILBASES
  • KAV_O_M_MAILPLAIN

    When none of the mentioned flags is specified, KAV_O_M_COMPOSITE_SCAN_KSN is ignored.

    When the KAV_O_M_COMPOSITE_SCAN_KSN is used in combination with KAV_O_M_ICHECKER flag and embedded files being scanned are known by iChecker to have been already scanned in the cloud before, these files are not rescanned in the cloud; these files are present in the database of scanned files maintained by iChecker technology.

    The following sequence of event codes must be expected when scanning multipacked files in the KAV_O_M_COMPOSITE_SCAN_KSN mode:

  • EVENT_ARCHIVE
  • EVENT_PASSWORD_PROTECTED
  • EVENT_ASK_PASSWORD
  • EVENT_PREDETECT
  • EVENT_VERDICT_CURABILITY
  • EVENT_DETECT
  • EVENT_OK
  • EVENT_RESULT

    Default setting: turned off.

KAV_O_M_EXTERNAL_SCAN

Enables partner scan function in File monitor, Web monitor and Mail monitor.

For more information, see Using partner scan function.

KAV_O_M_PHISHING

Enables Phishing protection in Web Monitor.

To enable Web Monitor to scan web addresses by phishing database, set this flag in the bit mask configured in dwScanningMode in an instance of KAV_WEB_MONITOR_SETTINGS3, see section "Phishing protection".

To enable using any of the scanning options, assign it to the value of the dwScanningMode variable. Options can be specified in any order.

For example, if the dwScanningMode variable has the following value:

dwScanningMode = KAV_O_M_ARCHIVED | KAV_O_M_PACKED;

this means that archives and compressed executable files will be scanned; all other scanning mode options are disabled.

There are recommended values for the dwScanningMode variable.

For on demand scanning in the Windows-based solutions, it is the following:

dwScanningMode = KAV_O_M_PACKED | KAV_O_M_ARCHIVED | KAV_O_M_MAILPLAIN | KAV_O_M_ICHECKER | KAV_O_M_ISWIFT | KAV_O_M_HEURISTIC_LEVEL_SHALLOW | KAV_O_M_NTFS_ADS

For monitoring file activity in the Windows-based solutions that use File Monitor component the recommended scanning mode setting is:

dwScanningMode = KAV_O_M_PACKED | KAV_O_M_ICHECKER | KAV_O_M_ISWIFT | KAV_O_M_HEURISTIC_LEVEL_SHALLOW

Page top