Adversaries may be using obfuscated JavaScript payloads associated with the ScanboxFramework to execute arbitrary code and exfiltrate data, leveraging the environment to maintain persistence. SOC teams should proactively hunt for this behavior in Azure Sentinel to identify potential APT activity and prevent lateral movement and data compromise.
YARA Rule
rule apt_all_JavaScript_ScanboxFramework_obfuscated
{
meta:
ref = "https://www.fidelissecurity.com/TradeSecret"
strings:
$sa1 = /(var|new|return)\s[_\$]+\s?/
$sa2 = "function"
$sa3 = "toString"
$sa4 = "toUpperCase"
$sa5 = "arguments.length"
$sa6 = "return"
$sa7 = "while"
$sa8 = "unescape("
$sa9 = "365*10*24*60*60*1000"
$sa10 = ">> 2"
$sa11 = "& 3) << 4"
$sa12 = "& 15) << 2"
$sa13 = ">> 6) | 192"
$sa14 = "& 63) | 128"
$sa15 = ">> 12) | 224"
condition:
all of them
}
This YARA rule can be deployed in the following contexts:
This rule contains 15 string patterns in its detection logic.
Scenario: A system administrator is using Scanbox Framework for legitimate security testing and obfuscation of JavaScript payloads for internal red team exercises.
Filter/Exclusion: Exclude files where the file path contains scanbox or redteam or where the process is initiated by a known admin account (e.g., root, admin, svc_account).
Scenario: A scheduled job runs JavaScript obfuscation tools like JavaScript Obfuscator or Babel to minify and protect code in a development environment.
Filter/Exclusion: Exclude files with a .min.js or .obf.js extension, or where the process is associated with a development server (e.g., webpack, vite, node-dev).
Scenario: A developer is using Webpack or Rollup to bundle and obfuscate JavaScript code for a production application.
Filter/Exclusion: Exclude files generated by bundling tools (e.g., bundle.js, main.js) or processes running under a development environment (e.g., npm run build, webpack-dev-server).
Scenario: A CI/CD pipeline (e.g., Jenkins, GitHub Actions) runs obfuscation scripts as part of a build process for a web application.
Filter/Exclusion: Exclude files generated during CI/CD builds (e.g., build/, dist/) or processes initiated by CI/CD agents (e.g., github-actions, jenkins, ci-user).
Scenario: A security tool like OWASP ZAP or Burp Suite is used to intercept and obfuscate JavaScript payloads during penetration testing.
Filter/Exclusion: Exclude files with a payload or test in the filename, or processes initiated by security