PDA

View Full Version : Javascript Password



johannes001
04-17-2004, 02:00 PM
Im playing Mod-x and being the usual non experienced noob im stuck on level 1. I understand javascript to a point and the point is just on this page <_< .

The page code for the password script is:

&#60;HTML&#62;
&#60;HEAD&#62;
&#60;TITLE&#62;Null&#60;/TITLE&#62;
&#60;script&#62;

var string = &#34;8ac249fbd363fx52j1&#34;;
var enigma = &#34;&#34;;
var whatisthis = &#34;var myxor = prompt&#40;&#39;Password&#58;&#39;,&#39;&#39;&#41;;for &#40;y=1; y&#60;5; y++&#41; {enigma += &#40;string.indexOf&#40;y&#41;+1&#41;;}enigma += 5;if &#40;myxor==enigma&#41;{enigma = enigma + &#39;.php&#39;;location.href=enigma;}else{location.href=&#39;hahaha.php&#39;;}&#34;;

eval&#40;whatisthis&#41;;

&#60;/SCRIPT&#62;
&#60;/HEAD&#62;
&#60;BODY&#62;&nbsp;&#60;/BODY&#62;
&#60;/HTML&#62;

What i need is help getting the string decoded using the information in the code. I&#39;m not lookin for the answer but instead so hints or information on how i turn the script around and display the password for me :ph34r:

Thanks for any help
Johannes001 :helpsmile:

h1
04-17-2004, 10:20 PM
Make it simpler.
var enigma = &#34;&#34;;
for &#40;y=1; y&#60;5; y++&#41;
{
&nbsp; enigma += &#40;&#34;8ac249fbd363fx52j1&#34;.indexOf&#40;y&#41;+1&#41;;
}
enigma += 5;
alert&#40;enigma + &#39;.php&#39;&#41;;

johannes001
04-17-2004, 10:59 PM
Thx Haxor needed a example to get me there lol
I think i understand it but will have a better look in a while.
Nyways thanks very much :)

h1
04-18-2004, 09:04 PM
:lol: I just handed the answer to you... and if you can&#39;t do this you&#39;ll get hit really hard with level two&#39;s ASCII shift encryption. :D