Detect password-protected zip files on the DLP Agent Endpoint.
DLP Endpoint Prevent 15.x,16.x
Encrypted file-type detection, by default, is performed by the Endpoint Server.
Utilize a 'Custom File Type' signature to detect password-protected .zip files with File Type Analyzer utility to build your own script on the Endpoint Server and Endpoint Agent.
To enable the Custom File Type Signature rule
Example of script taken from Detecting an encrypted ZIP file format:
NOTE: This is example taken from DLP guide [Detecting an encrypted ZIP file format] that presents how to use File Type Analyzer utility (analyzer_gui.exe). Each time you need to evaluate about 10-15 of the exact files [for example password-protected ZIP files], load them to a File Type Analyzer Utility for analysis and then build your own script for the detection.
$pktag=ascii('PK');
$frecord=getHexStringValue('0304');
$pkbytes=getBinaryValueAt($data, 0x0, 2);
assertTrue($pktag == $pkbytes);
$recordbytes=getBinaryValueAt($data, 0x2, 2);
assertTrue($frecord == $recordbytes);
$cryptByte=getBinaryValueAt($data, 0x6, 1);
$encrypted=mod($cryptByte, 2);
assertTrue($encrypted == 1);
Below is an example of using the script.
It is possible that when using the script above, the detection might not work for a compressed folder compared to a compressed file. In case facing that issue, try the script without the last three lines of code:
$pktag=ascii('PK');
$frecord=getHexStringValue('0304');
$pkbytes=getBinaryValueAt($data, 0x0, 2);
assertTrue($pktag == $pkbytes);
$recordbytes=getBinaryValueAt($data, 0x2, 2);
assertTrue($frecord == $recordbytes);
When using the above script, it is found to detect every zip file encrypted or not.