Skip to content

Javascript

Nicolas Christin edited this page Sep 19, 2021 · 1 revision

Alternative ways of doing similar things

Assuming this is either window (client-side) or global (server-side).

eval(x)
Function(x)()
Function

Object.constructor

// Using <any function>.constructor
(function(){}).constructor
(()=>{}).constructor
atob.constructor
[].at.constructor

// Using 'Function' as a string, which can be encoded/constructed to bypass filters
this['Function']
Object.getOwnPropertyDescriptor(this, 'Function').value
Reflect.getOwnPropertyDescriptor(this, 'Function').value
Clone this wiki locally