Skip to content

Instantly share code, notes, and snippets.

@0-vortex
Last active January 10, 2024 18:05
Show Gist options
  • Save 0-vortex/d5e90f10e3d006caf76e5c5e463cdeef to your computer and use it in GitHub Desktop.
Save 0-vortex/d5e90f10e3d006caf76e5c5e463cdeef to your computer and use it in GitHub Desktop.
PerimeterX
// get atob functions
VariableDeclarator StaticMemberExpression[property=atob]
VariableDeclarator[init.type="CallExpression"][init.callee.body.statements.0.body.statements.0.expression.property="atob"]
.closest('VariableDeclarator[init]')
// get atob function aliases
FunctionDeclaration ReturnStatement IdentifierExpression[name="Pu"]
.closest('FunctionDeclaration BindingIdentifier')
CallExpression[callee.type="IdentifierExpression"][callee.name="et"][arguments.length=1][arguments.0.type="LiteralStringExpression"]
// find functions that return single static values
FunctionDeclaration[params.items.length=0][body.statements.0.expression.type=IdentifierExpression]
CallExpression[callee.type="IdentifierExpression"][callee.name="si"][arguments.length=0]
// find global static variables
Script > TryCatchStatement FunctionBody[directives.0.rawValue="use strict"] > VariableDeclarationStatement
VariableDeclarator[init.type=LiteralStringExpression]
// find capabilities functions and utils
Script > TryCatchStatement > Block > ExpressionStatement > UnaryExpression > CallExpression > FunctionExpression > FunctionBody[directives.0.rawValue="use strict"]
ReturnStatement[expression.type=LiteralBooleanExpression]
VariableDeclarator[init.type=LiteralStringExpression]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment