Skip to content

Instantly share code, notes, and snippets.

@weizman
Created September 1, 2021 05:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save weizman/851ddc861bf6ec1334bdae8f20755daf to your computer and use it in GitHub Desktop.
Save weizman/851ddc861bf6ec1334bdae8f20755daf to your computer and use it in GitHub Desktop.
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