Microsoft BlueHat Challenge: web level 1

The BlueHat Challenge (the “Challenge”) presents a series of computer security problems of increasing difficulty to help users build and test their computer security skills. The Challenge has three tracks: reverse engineering, vulnerability discovery, and web design vulnerabilities...More detalis

Return HACKED


We have a global variable called "goodJob" and its value is a strange one. We need to make sure that it will always return the string "HACKED" regardless of its real value.

Rules


You can't change the behavior of alert, String, or undefined.
You can't use onerror/try/catch or any code that controls errors.
Don't use instructions that bypass the code execution below the allowed area.
Your code can be any length inside the allowed area. No changes outside of it.

code


<script>
/********** YOUR CODE SHOULD START BELOW THIS LINE **********/





/*********** YOUR CODE SHOULD END ABOVE THIS LINE ***********/
var goodJob = /!/._//!//
alert(goodJob); // We should see an alert saying "HACKED".
</script>

Solution


RegExp.prototype._ = "HACKED";

You like it, share it

عربي