Obtaining process info for the malicious web address

Your application can show process identifier (PID) in notifications shown to the users when Web Monitor component detects a malicious web address. Knowing the PID of the process that attempted to request a malicious URL could help create post-detection logic. For example, your application could cancel detection for a specific PID.

The described functionality is available for x64 and x86 Windows platforms.

Detection

As with any detection made by Web Monitor component, KAV SDK notifies your application through the callback handler defined in the project of your application. If Web Monitor classifies the intercepted web address as malicious, it invokes the callback handler and raises the EVENT_PREDETECT notification code. Following callback parameters are set with the specific values:

Handling detection

You can opt for the following return codes when handling EVENT_PREDETECT notification code in your application.

Any other code returned for your application is handled as CLBK_OK.

The diagram outlines Web Monitor workflow for the case when your application returns the CLBK_GETPID code.

Web Monitor workflow for the CLBK_GETPID return code

Handling CLBK_GETPID return code

To obtain the PID of the process accessing malicious URL:

  1. Return CLBK_GETPID code handling EVENT_PREDETECT event raised by Web Monitor.
  2. Handle EVENT_PID raised by Web Monitor in a response.

    You can return CLBK_OK, CLBK_CANCEL_OBJECT, or CLBK_CANCEL_ALL, see section "Expected return codes for callback function".

Handling process ID data

When Web Monitor calls the callback specified in your application with EVENT_PID event code, following callback parameters are set with the specific values.

Parameters of callback function for EVENT_PID

Parameter

Value

dwEvent

EVENT_PID, a code of a source event.

dwParam1

Identifier of the source process that requested a malicious URL.

dwParam2

0; this parameter is unused.

pObjectName

NULL; this parameter is unused.

pVirusName

NULL; this parameter is unused.

dwObjectID

Identifier of the malicious object.

This identifier is automatically generated by Web Monitor component for each of the scanned objects. The ID uniquely identifies a specific object to the Web Monitor.

It is kept same for all the event codes associated with this specific scanned object. The ID is pertained for the scanning session. If you rescan the same object after re-initializing SDK, the new ID is generated.

dwMonitorID

WEB_MONITOR, a code that refers to Web Monitor component, see section "Monitor types".

pUserContext

setting data that was specified in the corresponding member of KAV_MONITOR_SETTINGS.

Page top