What is it? @.@

Here is the place where I record some tactics about wargame, systems, and other security issues.

2013-05-24

Bright Shadows - Programming 3: "Dit Dit Dah"

Description:

When you click on this link, you will get a line of numbers. Decode it and send the text to the solution page like in programming 1:

"http://www.bright-shadows.net/challenges/programming/dit_dit_dah/solution.php?solution="+decoded stuff
The time limit is set to 2 seconds.
_______________    _________
|enter solution|  |Check it!|

Solution:
  1. Modify the code used in Programming 1.
  2. Below is the steps:
    (a)Visit the page link

    Visit: http://www.bright-shadows.net/challenges/programming/dit_dit_dah/index.php

    (b)Open JavaScript Console of Chrome Developer Tools and send the following code.

    var jqlib = document.createElement('script');
    jqlib.src = "http://code.jquery.com/jquery-latest.min.js";
    document.getElementsByTagName('head')[0].appendChild(jqlib);
    
    $.ajax({
    url: 'http://www.bright-shadows.net/challenges/programming/dit_dit_dah/tryout.php',
    type: 'get',
    dataType: 'text',
    success:function(data){
    var strText=data.substring(16, data.length - 1);
    var strAns="";
    var morse_char=strText.split("2");
    alert(strText+"\n"+morse_char);
    var morse={
    '10':'a','0111':'b','0101':'c','011':'d','1':'e','1101':'f',
    '001':'g','1111':'h','11':'i','1000':'j','010':'k','1011':'l',
    '00':'m','01':'n','000':'o','1001':'p','0010':'q','101':'r',
    '111':'s','0':'t','110':'u','1110':'v','100':'w','0110':'x',
    '0100':'y','0011':'z'};
    for (i = 0; i<morse_char.length; i=i+1)
    {
    var code=morse_char[i];
    strAns+=morse[code];
    }
    var newUrl="solution.php?solution="+strAns.toUpperCase();
    window.location.href=newUrl;
    }
    });
  3. The keyword is "telegraph", well done!

No comments:

Post a Comment