-
-
Save weizman/851ddc861bf6ec1334bdae8f20755daf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function malicious() { | |
const detect = (function(){ | |
const dummy = /./; | |
dummy.toString = () => { | |
alert('someone is debugging the malicious function!'); | |
return 'SOME_NAME'; | |
}; | |
return dummy; | |
}()); | |
// do a malicious action | |
if (window.stealUserCookies) window.stealUserCookies(); | |
} | |
function legit() { | |
// do a legit action | |
return 1 + 1; | |
} | |
function main() { | |
legit(); | |
malicious(); | |
} | |
debugger; | |
main(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment