콘텐츠로 건너뛰기

Secure Mail

Description

중요한 정보가 적혀있는 보안 메일을 발견하였습니다.
보안 메일의 비밀번호는 생년월일 6자리인 것으로 파악되나, 저희는 비밀번호 정보를 가지고 있지 않습니다.
비밀번호를 알아내고 보안 메일을 읽어 중요한 정보를 알아내주세요!

secure-mail.html 소스코드는 아래와 같다.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<script type="text/javascript">
(해괴망측한 난독화된 졸라긴 스크립트~~~)
</script>
<html>
    <body>
        <h2>Secure mail</h2>
        <img src="data:image/png;base64,iVBORw..(대충 메일 아이콘 이미지)" width=20 style="vertical-align: top;">
        <input id="pass" type="password" maxlength="6" size=30 title="User password input" value="" placeholder="Input your birthday eg.) 850810">
        <button type="submit" onclick="_0x9a220(pass.value);">Confirm</button>
    </body>
</html>
function _0x9a220(_0x30bf04) {
    ...
    if (_0x3eebe5(odradurs1, null, raw = !![]) != _0x540d50('0x55', 'dGZC'))
        return alert('Wrong'),
        ![];
    return document['write'](_0x540d50('0x66', 'AZ$r') + odradurs1 + '\x22>'),
    !![];
}

_0x9a220 함수에서 6자리 비밀번호를 넘겼을때,
비밀번호가 틀리면 false, 맞으면 true를 반환한다.
이러한 점과, 생년월일 6자리 힌트를 이용하여 브루트포싱하면 된다.

알림이 거슬리니 alert 대신 console.log 함수로 바꿔주었다.

function makeTwoDigit(num) {
    if(num < 10)
        return '0' + num.toString();
    return num.toString();
}

let found = false;

for(year = 57; year <= 99; year++) {
    for(month = 1; month <= 12; month++) {
        for(day = 1; day <= 31; day++) {
            sixDigit = year.toString() + makeTwoDigit(month) + makeTwoDigit(day);
            console.log(sixDigit);
            if(_0x9a220(sixDigit)) {
                found = true;
                alert(sixDigit);
            }

            if(found)
                break;
        }
        if(found)
            break;
    }
    if(found)
        break;
}

비밀번호는 960229였다.

태그:

답글 남기기