Anti-Tampering protects your application against tampering attacks. Countermeasures can be specified (optionally) to be executed when someone tries to tamper with the code.
Anti-Tampering is fully compatible with the browser's Content-Security Policy (CSP).
// @jscrambler global define antiTampering {countermeasures: {breakApplication: 1}} as at
// @jscrambler enable at
function a() {
}
// @jscrambler enable at
function b() {
}
Note: Anti-Tampering can be used on multiple places on the same file, however it cannot have different options in each of those places. This means that you can only define it once, and then enable it across the file. When using Anti-Tampering as a parameter, only disable annotations are allowed.
Some environments are incompatible with SKL mode:
Name | Required | Default Value | Description |
---|---|---|---|
maxTargetsPerFunction | No | 3 | Max number of targets per function |
validatedRange | No | 15 | Max number of characters to be validated per Function |
mode | Yes | ["RCK","SKL"] | Transformation Modes |
countermeasures | Yes | {"deleteCookies": false,"breakApplication": true,"realTimeNotifications": false,"dataExfiltrationPrevention": false,"selfDestruct": false} | List of available countermeasures |
Name | Description |
---|---|
customCallback | Name of the function to be called as a countermeasure. |
deleteCookies | Deletes all the cookies accessible via JavaScript. |
redirect | Redirects the user to a specific URL. |
breakApplication | Breaks the application's functionality. |
realTimeNotifications | Sends a notification when a violation occurs. |
dataExfiltrationPrevention | Prevents a malicious actor from carrying out an unauthorized data transfer by blocking network requests. |
selfDestruct | Attempts to damage the state and behavior of the application and/or the environment that is running the application. |
Name | Description |
---|---|
RCK | Integrity Check mode RCK |
SKL | Integrity Check mode SKL |
Browser | Compatible Versions | Tested Versions | Notes |
---|---|---|---|
Chrome | 80+ | 80+ | |
Firefox | 80+ | 80+ | |
Internet Explorer | N/A | 8+ | |
Microsoft Edge | 111+ | 111+ | |
Safari | 12.1+ | 12.1+ |
Example:
{
"keys": {
"accessKey": "XXXXXX",
"secretKey": "YYYYYY"
},
"applicationId": "ZZZZZZ",
"params": [
{
"name": "antiTampering",
"options": {
"maxTargetsPerFunction": 3,
"validatedRange": 15,
"mode": [
"RCK",
"SKL"
],
"countermeasures": {
"customCallback": null,
"deleteCookies": false,
"redirect": null,
"breakApplication": true,
"realTimeNotifications": false,
"dataExfiltrationPrevention": false,
"selfDestruct": false
}
}
}
]
}