Skip to content

Instantly share code, notes, and snippets.

@chowder
Last active March 6, 2019 02:33
Show Gist options
  • Save chowder/be7bf786eb936ff2701c66d2b3efda82 to your computer and use it in GitHub Desktop.
Save chowder/be7bf786eb936ff2701c66d2b3efda82 to your computer and use it in GitHub Desktop.
/* Question (i) and (ii)
* Exploit on: Line 13 */
var x = {toString: function(){ alert("1"); return 1 }}
/* Question (iii) and (iv)
* Exploit on: Line 38 */
var x = "h4x0r";
Object.defineProperty(Array.prototype, '0', {
set: function(val) {
if (this.length == 0) { // This part is important so that the exploit is only run once
alert("2");
}
}
});
/* Question (v) and (vi)
* Exploit on: Line 49 */
var x = "h4x0r";
CryptoAPI.sha1._round = function(H, w){ alert("3") };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment