Effective measure to counteract malware self-defense techniques, Advanced Disinfection (AD) is a helper antimalware means that works in cooperation with other protection technologies and components provided by KAV SDK.
Helper here means that start of Advanced Disinfection can be initiated only by internal logic on KAV SDK and only within a context of the task processed by other AD-enabled component. One of such components is Proactive Defense Monitor (PDM).
When Active Disinfection is turned on for PDM, every time proactive defense intercepts a malicious action of a process, internal logic in KAV Engine may initialize lookup through all critical areas that may be affected by active malware working at the time of PDM-initiated interception.
Such areas are:
Startup applications that run automatically when operating system is started are scanned for presence of the image file of the process intercepted by PDM.
Lookup is made against the history of processes tracked by kernel-level components loaded by KAV Engine. This history contains information about what happened to processes ever run on the system in the current session of KAV SDK.
Decision making on whether to start Advanced Disinfection is made by internal logic of KAV Engine based on information retrieved from QSCAN and its complimentary components utilized to look though the aforementioned critical areas. The watcher component within the KAV Engine analyzes the retrieved results.
The QSCAN component analyzes critical areas by checking for presence of the image file for the process that was intercepted by PDM. If this image file is found in the start-up list or the intercepted process, or is known to have been run before within the KAV SDK session, it is a trigger for the cleaning procedure to start.
Cleaning with Advanced Disinfection
This is where Advanced Disinfection may appear for the first time. If internal watcher mechanism in KAV Engine fails to terminate malicious process, malware scanning subsystem in KAV Engine attempts to start Advanced Disinfection. Proactive Defense Monitor component checks to see if its scanning task is started with the flag that allows starting of Advanced Disinfection when standard disinfection finishes with no success. This check is made by looking up the value of dwScanningMode parameter in the KAV_PDM_MONITOR_SETTINGS3 structure. This parameter contains the bit flag specifying scanning mode enabled for the PDM. If the dwScanningMode is set to KAV_O_M_ADVDIS, the PDM knows that Advacned Disinfection is allowed. For details about supported scanning modes, see section "Scanning modes".
Because it has been verified that start of Advanced Disinfection is allowed for PDM, the KAV SDK raises an event that prompts you to confirm the start. Your callback function is invoked with EVENT_ALLOW_ADVDIS event. To confirm the start you return CLBK_OK return code with the callback function to KAV SDK. If you do not want Advanced Disinfection to start, return CLBK_CANCEL_ALL or CLBK_CANCEL_OBJECT. When Advanced Disinfection is started, you are notified with the EVENT_ADVDIS_STARTED event code. For more information about supported callback return codes, see section "Callback function return values".
Removal
If standard measures to terminate the malicious process succeeded, Proactive Defense Monitor attempts to remove the image file associated with the terminated process. You are notified about these attempts with the callback function that is invoked with EVENT_DELETE event. Note that when deletion in the current session of operating system is not possible, because the file may be locked at that time, PDM places the file to the database of files that must be removed on the next start. This database is used by the klbg driver that deletes the file upon the next boot. To notify you that removal will be made on the next start, the KAV SDK fills the dwParam1 parameter of the callback function with KLDT_ON_REBOOT when invoking the callback handler EVENT_DELETE. Because of that, Proactive Defense Monitor calls your callback function with the same sequence of events to provide you with option to start Advanced Disinfection and facilitate removal of malicious file.
Rollback
As an additional step after successful removal of file, Proactive Defense Monitor provides you with an option to revert all changes made to your environment by detected malware. The PDM calls your callback handler with EVENT_PDM_SURE event, much like it did when you were notified about the attempt to terminate malicious process. However, this time the PDM fills the dwParam1 parameter of the handler with PDM_ACTION_ROLLBACK value. As you know from the list of expected callback return codes that may be returned with callback function to KAV SDK, there are two options to respond to such an event with this action. You may either return CLBK_OK and let rollback operation quit, or you may return CLBK_ROLLBACK code to initiate the rollback. If you opt to allow rollback, the PDM makes an attempt to perform the rollback operation and remove all the traces of malicious activity left in your operating system. For more information about what codes KAV library expect to receive from your application depending on the event raised by library, see Expected return values for PDM events table.
KAV SDK does not notify you about the start of rollback cleanup procedure. The library processes the task and calls your callback function when finished. The callback is called with EVENT_PDM_SURE event where dwParam1 is set to PDM_ACTION_ROLLBACK_SUCCEEDED value or PDM_ACTION_ROLLBACK_FAILED. When the first value indicates successful rollback, the second one informs you that rollback did not succeed.
What if you refuse to start rollback procedure and return CLBK_OK code in a response to the received EVENT_PDM_SURE event? Or what if rollback has been disabled in settings within the KAV_PDM_MONITOR_SETTINGS3 structure. You could do that by initializing the enRollBackMode parameter to PDM_ROLLBACK_OFF, which is one of the members of PDM_ROLLBACK_MODE enumeration. In both cases, Proactive Defense Monitor asks your permission to start Advanced Disinfection and runs it if you respond with CLBK_OK code to the EVENT_ALLOW_ADVIS event.
Finishing
Finally, when Advanced Disinfection worked out, it asks your application the permission to restart the system by invoking your callback function with EVENT_REBOOTNEEDED event. Here you may opt to allow the immediate restart by returning CLBK_REBOOT code, or cancel the restart by sending back the CLBK_CANCEL_ALL or CLBK_CANCEL_OBJECT return code. The latter may be used when you want the restart to be made by your custom restart calls.
Lets focus on what happens if you allow automatic restart of the operating system to be made by KAV SDK and return CLBK_REBOOT. In this case KAV SDK immediately restarts the system without waiting for other scanning tasks that may have been queued to finish. That is the difference in handling the EVENT_REBOOTNEDED event by Proactive Defense Monitor to File Monitor or scanning functions that support Advanced Disinfection. To recap, when Advanced Disinfection starts as part of measures when handling scanning tasks being processed by File Monitor, KAV SDK always waits until all the queued tasks are finished before it restarts the system. With the PDM it does not wait and immediately restarts the computer upon the receiving CLBK_REBOOT.
Here is the diagram that plots standard activity of Proactive Defense Monitor when it works with Advanced Disinfection.

Proactive Defense Monitor in cooperation with Advanced Disinfection
Page top