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:
dwParam1This parameter is set to KDT_MALICIOUS_URL constant, see section "Detection types and severity".
dwMonitorIDThis parameter is set to WEB_MONITOR, a code that refers to Web Monitor component, see section "Monitor types".
Handling detection
You can opt for the following return codes when handling EVENT_PREDETECT notification code in your application.
CLBK_OKContinue scanning.
CLBK_CANCEL_OBJECTCancel scanning the object with the identifier in dwObjectID.
CLBK_CANCEL_ALLCancel scanning all queued objects in the task.
CLBK_GETPIDObtain process ID data.
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.

Handling CLBK_GETPID return code
To obtain the PID of the process accessing malicious URL:
CLBK_GETPID code handling EVENT_PREDETECT event raised by Web Monitor.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 |
|---|---|
|
|
|
Identifier of the source process that requested a malicious URL. |
|
|
|
|
|
|
|
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. |
|
|
|
setting data that was specified in the corresponding member of |