Write-up


 

SUBSTITUTION CIPHER

CRYPTO, 60

We have discovered some ciphertext. We need you to find the plaintext. The flag is in the {flag} format, not the actf{flag} format. There are no spaces in flag.





와.. 힌트없는줄 알았는데 힌트가 잇엇음... 뭐 도움은 안됐지만;; 이미 풀고난뒤 ㅂㄷ


hint : The letters seem to be the only thing that was encrypted...how unfortunate.


 some ciphertext.


vfauedwyedmtlwylwnawyjfdzltqilqdezfntmwyewyejzettjedmwyfjlzettjyeilwfplxaenmlmpvbldzqwyxadjzyfjxfddemfqwvfavfatwzlqdplnxqyeilexnlewlnnljsfdjqpqtqwvwyedvfauedsfjjqptvoewyfbvfazllsofnjedwqexfedmvfauanjlwylbenqdljvfayeilwyewtaranvvfayeilwyltaranvfodfwcdfzqdxzyewqcdfzwyewjedwqexfjmlewyzyqtlwnexqusnfpeptvjeilmtqiljedmbvlrqjwldulzyqtlxnfwljgaledmqdufbsnlyldjqptlwfvfajeiljtqiljvfamfdwzedwwylwnawyplueajlmllsmfzdqdsteuljvfamfdwwetcepfawewsenwqljvfazedwblfdwyewzettvfadllmblfdwyewzettzlajlzfnmjtqclyfdfnufmltfvetwvzlajlwyljlzfnmjejwylpeucpfdlwfetqoljsldwmloldmqdxjfblwyqdxvfaajllbejesaduytqdlqyeildlqwylnwylwqbldfnwylqdutqdewqfdwflrsteqdbvjltowfebedzyfnqjljedmjtllsjadmlnwylptedclwfowylilnvonllmfbqsnfiqmlwyldgaljwqfdjwylbeddlnqdzyquyqsnfiqmlqwqmnewylnvfahajwjeqmwyedcvfaedmzldwfdvfanzevfwylnzqjlqjaxxljwvfasqucasezlesfdedmjwedmesfjwlqwylnzevqmfdwxqilemebdzyewvfawyqdcvfanlldwqwtlmwf{olzxffmbldhljjls}


오...



간단히 일단 설명...


http://www.cryptoclub.org/tools/ciphers.php


위 사이트 substitution cipher에서 빈도수 조사해서




l=e 일 확률이 높아서 http://quipqiup.com/ 여기서 그렇게 하고 ㄱㄱ 햇음


http://www.cryptoclub.org/tools/ciphers.php




you cant handle the truths on we live in a world that has walls and those walls have to be guarded by men with guns whos gonna do it you yoult weinberg i have a greater responsibility than you can possibly fathom you weep for santiago and you curse the marines you have that luxury you have the luxury of not knowing what i know that santiagos death while tragic probably saved lives and my existence while grotesque and incomprehensible to you saves lives you dont want the truth because deep down in places you dont talk about at parties you want me on that wall you need me on that wall we use words like honor code loyalty we use these words as the backbone to a life spent defending something you use em as a punch line i have neither the time nor the inclination to explain myself to a man who rises and sleeps under the blanket of the very freedom i provide then questions the manner in which i provide it id rather you just said thank you and went on your way otherwise i suggest you pick up a weapon and stand a post either way i dont give a damn what you think youre entitled to{ few good men jesse p}

'Write-up > Crypto' 카테고리의 다른 글

[anstromCTF 2017] Knock Knock  (0) 2017.04.25
[anstromCTF 2017] Descriptions  (2) 2017.04.25
[ch4n3] How are you? I'm XOR XOR.. (Crypto)  (0) 2017.03.08
[ch4n3] King Sejong (Crypto)  (0) 2017.03.08
[ch4n3] Reverse! (Crypto)  (0) 2017.03.08

 

초보 개발자의 일기 (Web)


Created by ch4n3 | You can get 150point!


진짜 초보같은 개발자가 DB를 이용해서 일기를 만들었다고 한다.
CSS하고 DB를 보니까 진짜 초보인가 보다. 

http://chaneyoon.dothome.co.kr/h3x0r.php



위 URL로 들어가면 "초보개발자의 하루"라는 일기 형식의 웹이 나온다.


일기를 보려면 일을 입력해달라고 나오는데... 1~31까지 입력하면 그날의 일기가 나온다. (참고로 하나하나 보면 꽤 재미가 쏠쏠하다 ㄷㄷ)


먼저 소스보기를 통해 소스를 보았다.




<!DOCTYPE html>

<html>

<head>

    <meta charset="UTF-8">

    <title>초보 개발자의 일기</title>

    <script src="./javascript.js"></script>

    <link rel="stylesheet" type="text/css" href="./style.css">

</head>

<body>

<div class="container" align="center">

    <div class="header">

        <br><br><br><br><br>

        <p align="right" style="font-family: 'Noto Sans KR', sans-serif; color: darkgrey;"  class="title">made by ch4n3</p>

        <h1 align="right" style="font-family: 'Noto Sans KR', sans-serif;"  class="title">

            <a href="./index.php" class="title">초보 개발자의 하루</a>

        </h1>

    </div>

    <p>히힛 오늘은 개발 배우기 시작한지 딱 한달되는 날이다! 정말 기분 좋다ㅎㅎ</p>

    <p>개발할 때 마다 일기를 쓰고 있는데 정말 재밌는 것 같다.</p>

    <textarea id="daily" rows="1"></textarea>

    <button type="button" id="submit" value="일기 보기" class="button5">일기보기</button>

    <p>일기를 보려면 일(日)을 입력해주세용~~ (ex. 1)</p><br><br><br>

    <div id="daily_note" class="daily">

        <!-- Vmtkb2NHTXhPWEJqTVRsMVlqTlNabGxXT1VkVVJVWkk= -->

    </div>

</div>

</body>

</html> 



먼저 위의 초록색  <!-- Vmtkb2NHTXhPWEJqTVRsMVlqTlNabGxXT1VkVVJVWkk= --> 이 부분이 눈에 띈다.

base64로 인코딩이 여러번 씌워져있어서 디코딩을 여러번 수행해보았다. 


그 결과 아래와 같은 것이 나왔다.


This_is_not_a_FLAG


... ㅂㄷㅂㄷ


다른것을 살펴보도록하자... 초보 개발자라고 하니 (사실 필자보다 훨 낫긴하지만 ㅠ)


/javascript.js /style.css 가 눈에 띄어서 살펴보았다.


먼저 style.css 에는 크게 특별한게 없었다... 굳이 특별한게 있다고 치면 아래내용?

/* Nice try.. but flag is not in this css file.. */

ㅋㅋㅋㅋㅋ 또 한방먹었다.


이제 javascript.js 를 살펴보면



var isEmpty = function(value){

    if( value == "" || value == null || value == undefined || ( value != null && typeof value == "object" && !Object.keys(value).length ) ){

        return true

    }else{

        return false

    }

};




function daily(e) {

    var daily = document.getElementById("daily").value;

    var query = 'daily=' + daily;

    var http = new XMLHttpRequest();

    var url = "./json.php";

    var params = "daily=" + daily;

    http.open("POST", url, true);

    http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");


    http.onreadystatechange = function() {//Call a function when the state changes.

        if(http.readyState == 4 && http.status == 200) {

            var res = http.responseText;

            res = JSON.parse(res);

            if(isEmpty(res[0].daily)) {

                var element = "<br>2016년 1월 " + daily + "일의 일기가 없음 T.T";

            } else {

                var element = "<br>2016년 1월 " + daily + "일" + "<br><br><br>" + res[0].daily;

            }


            document.getElementById("daily_note").innerHTML = element + "<br><br>";

        }

    }

    http.send(params);


}


window.onload = function() {

    document.getElementById("submit").onclick = daily;

};



 



날짜값을 얻어 일기를 띄워주는것 같다.


여기서 다른것은 잘 모르겠고... 사실 잘모른다 ㅠ;


./json.php에 무언가 있을거같아서 들어가 보았다.


아니다 다를까;


[{"daily":null},{"V20xNGFGcDNQVDA9":"Vm0wd2QyUXlVWGxXYTJoV1YwZG9WVll3Wkc5alJsWjBUVl .... "}


많이 생략하였지만 무언가 들어있다.(생략은 필자가 했다.)


daily가 null일 경우 출력해주는 것같다.


하지만 위 isEmpty 함수에 의해 null값이 들어가면 "일기가 없음 T.T"  가 뜨게 되어있으므로 flag값은 아마 일기의 일이 null일때에 숨겨뒀음을 알수 있다.


base64로 다시 풀어보면 아래와 같이 나온다.


flag : heh3_Th4t_w45_f4ke!_Im_sorry


'Write-up > Web' 카테고리의 다른 글

[ch4n3] Strcmp (Web)  (1) 2017.03.08

 

How are you? I'm XOR XOR.. (Crypto)


Created by ch4n3 | You can get 130point!


These numbers are an array of numbers that are obtained by XORing a sentence and an alphabet. Decode these numbers.

However, the alphabet is lower case.


이 숫자들은 어떤 문장과 한 알파벳을 XOR연산해서 나온 숫자들의 배열이다. 이 숫자들을 복호화하여라.

단, 알파벳은 소문자이다.

53 63 50 52 8 11 28 1 11 28 1 78 78 0 28 0 28 44 27 22 27 22 44 7 27 18 7 44 4 18 0 44 30 10 44 23 1 26 3 82 14


문제에서 나온 대로다... 후우...


코드는 아래와 같이 사용했다.


아스키 범위안에서 모두 XOR해서 표시하여 그중에 FLAG를 찾는 전략을 사용했다.


  1. # your code goes here
  2.  
  3. str = [53,63,50,52,8,11,28,1,11,28,1,78,78,0,28,0,28,44,27,22,27,22,44,7,27,18,7,44,4,18,0,44,30,10,44,23,1,26,3,82,14]
  4.  
  5. for i in range(80,128):
  6. for s in str:
  7. print("%c" % (s^i),end="")
  8. print("")


플래그처럼 보이는 것을 하나 찾을 수 있었다.


FLAG{xorxor==soso_hehe_that_was_my_drip!}


'Write-up > Crypto' 카테고리의 다른 글

[anstromCTF 2017] Descriptions  (2) 2017.04.25
[anstromCTF 2017] Substitution Cipher  (0) 2017.04.25
[ch4n3] King Sejong (Crypto)  (0) 2017.03.08
[ch4n3] Reverse! (Crypto)  (0) 2017.03.08
[ch4n3] BASE인코딩을 아니? (Crypto)  (0) 2017.03.06

[ch4n3] Strcmp (Web)

2017. 3. 8. 23:46

Strcmp (Web)


Created by 해커지망생 | You can get 100point!


 



이 문제는 PHP 에서 strcmp 취약점을 이용한 인증 우회 기법을 이용한 문제다.


근데 아니... 저거 404 NOT FOUND뜸 ;; 일단 패스


문제오류가 수정되었다!


  1. No...
  2. <?php
  3. require_once("./flag.php");
  4. $password = mt_rand();
  5. $password2 = $_GET['password2'];
  6. if(@strcmp($password2, $password)==0){
  7. echo "Gooooooooooood! flag is ".$flag;
  8.  
  9. }
  10. else{
  11. echo "No...";
  12. }
  13. show_source("strcmp.php");
  14. ?>


이게 본 문제의 소스다. 들어가면 바로 저 소스가 보인다.


flag를 얻기 위해서는 password와 password2를 strcmp로 비교하여 같다면 flag를 출력하게 되어있고

아니라면 No...를 출력하게 되어있다.


일단 밑과 같이 동작한다.


http://respect.dothome.co.kr/strcmp.php?password2=123

=> No...



여기서 password 파라미터를 GET방식으로 얻는데 (POST로 얻어도 상관없다.)


strcmp 함수의 내용을 살펴보면 아래와 같다.



Description ¶

int strcmp ( string $str1 , string $str2 )


Return Values ¶

Returns < 0 if str1 is less than str2; > 0 if str1 is greater than str2, and 0 if they are equal.


strcmp($str1, $str2)에서 $str1이 $str2보다 작으면 음수, 반대로 더 크면 양수, 같으면 0이 반환된다.


문제에서 우리가 password의 값과 같은 값을 password2에 넣으면 0이 반환된다. 하지만 rand함수로.. 랜덤으로 나오겠지;;


그래서 password 값을 모르면서 저 값을 0으로 우회할 방법이 필요하다.


구글에 (Google : strcmp() expects parameter 2 to be string, array given in ) 검색하면 


PHP 버전 5.2, 5.3에서 strcmp에 대한 취약점을 찾을수 있다.


PHP 버전 5.2에서 strcmp(String, Array())을 실행하면 1 or -1을 반환한다. (5.2에서는 Array()를 "Array"라는 문자열로 변환하여 비교한다...)

PHP 버전 5.3에서는 strcmp(String, Array())을 실행하면 NULL 을 반환한다.


예제를 하나 들면


  1. <?php
  2.  
  3. $str1 = 'rand';
  4. $str2 = Array("test");
  5.  
  6. if (strcmp($a, $b) == 0)
  7. echo "good !";
  8. else
  9. echo "bad ....";
  10.  
  11. ?>
  12.  


이 코드를 실행하면 결과는 "good !"이 나온다.


이는 PHP 5.3 버전에서 strcmp 함수 인자값에 문자열이 들어오지 않을 경우 NULL을 반환하는 것에서


발생한 취약점으로 인해 if( NULL==0 ) 에서 NULL==0은 TRUE가 되어 if문이 실행되는것이다. 


여기서 우리는 미리 결과를 봤기 때문에 NULL == 0 의 결과가 TRUE라는 것을 알지만


그러면 결과적으로 NULL은 0 인 것인가 하면... 밑의 비교표를 보면 알 수 있다.



"==" 으로 느슨한 비교를 한 결과


"===" 으로 엄격한 비교를 한 결과


위 두 표를에서 나오듯 느슨한 비교를 할 시에는 NULL이 숫자 0과 같기 때문에 0 == NULL 이 TRUE를 반환하지만 

NULL이 0과 같은 타입이 아니기 때문에 0 === NULL 시에는 FALSE를 얻게 된다.



그러므로 위 취약점이 있는 PHP 버전에서 위 같은 취약점이 생기길 원하지 않을 경우 엄격한 비교인 ===을 사용하거나


비교대상이 Array가 아닌지 확인을 통해 취약점을 해결할수 있다. ( 참고로 PHP 5.5버전도 통한다... 어디까지 되는거여 ㄷㄷ)




어쨋든 .. 그러므로 다시 문제로 돌아와서


password2의 값에 array값을 넣어주면 답이 출력된다.


http://respect.dothome.co.kr/strcmp.php?password2[]


Gooooooooooood! flag is {are_y0u_kn0w_strcmp_bo9?} 

<?php
require_once("./flag.php");
$password mt_rand();
$password2 $_GET['password2'];
if(@
strcmp($password2$password)==0){
  echo 
"Gooooooooooood! flag is ".$flag;

}
else{
  echo 
"No...";
}
show_source("strcmp.php");
?>




flag is {are_y0u_kn0w_strcmp_bo9?}

'Write-up > Web' 카테고리의 다른 글

[ch4n3] 초보 개발자의 일기 (Web)  (0) 2017.03.08

Stegano_Dark (Steganography)


Created by HTJJing | You can get 100point!


Give me the lightark

dark.zip

 



으아... 정말로... 짜증나는 것이 뭐냐면


이미지 첨부가 안된다는 것이다!!




그래서 포기하고 구두로 설명 ㅠ;


일단 저 zip을 풀어보면 그냥 커먼색 dark.bmp가 나온다.


스테가노그래피 문제이고, bmp파일이므로 픽셀의 LSB를 이용한 문제일것으로 예상된다.

(그러므로 그전에 그림판으로 열어서 색채우기로 해보니까.. 조금 다른 부분이 있는것이 보인다.. 물론 답은 안보인다 ㅠ)


뭐... 스테가노그래피에 관해서는 나중에 더 자세히 쓰겠다.


일단 인터넷에 돌아다니는 stegsolve를 이용하여 문제를 풀었다.


gray bit으로 해서 보면 답이 보인다. 이미지 첨부가 불가하여 더이상 설명 불가 ㅠ


stegsolve : https://www.wechall.net/forum/show/thread/527/Stegsolve_1.3/page-1




FLAG IS {H1H1_H4H4_H0H0}





참고할 곳 : https://bpsecblog.wordpress.com/2016/08/21/amalmot_4/

'Write-up > Misc (+ Forensic, Stegano)' 카테고리의 다른 글

[anstromCTF 2017] USB Encryption  (0) 2017.04.26
[anstromCTF 2017] Document  (0) 2017.04.26
[anstromCTF 2017] IMAGE TRICKERY  (0) 2017.04.26
[ch4n3] 나잡아봐라~~ (Steganography)  (0) 2017.03.08
[ch4n3] Brute-Force (Misc)  (0) 2017.03.08

나잡아봐라~~ (Steganography)


Created by MushRooM | You can get 100point!



hahahahahahhahhahhahahah.zip


 


압축을 풀고 나면 hahahahah.jpg가 나온다.


binwalk를 통해 저 안에 hahahahah.....jpg 안에 PK 압출파일 헤더가 잇는걸 발견
HxD로 확인해본결과 word파일같음...

binwalk는 파일안에서 파일헤더 및 시그니처를 찾아준다;; 이미지를 못올려서 자세한건 생략

보통 리눅스에서 많이 쓰는데; 윈도우 버전도 존재하므로 그걸 썻다.


HxD : https://mh-nexus.de/en/downloads.php?product=HxD (한글버전도 존재한다!)
참고로 이 프로그램을 이용하면.. 파일의 헥스값을 볼 수 있다! 더 자세한건 생략하겠다. 귀찮어 ㅇㅇ

 
그래서 추출해서 마이크로소프트 워드로 열고싶엇으나 없어서

hwp로 열어서 확인하여 플래그를 확인할수 있었다.

Flag_{S0_funny_St3g0!}


... 아오.. 이미지첨부안되니까 힘들다;;




[ch4n3] Brute-Force (Misc)

2017. 3. 8. 23:31

Brute-Force (Misc)


Created by Cl4vis | You can get 70point!


I can not open the zip file.. T.T  flag.zip
※HINT : The password is 5 digits.

Please auth here

http://chaneyoon.dothome.co.kr/zip_secret.php

 


정말 간단한 문제... zip파일을 풀면되는데 문제는 이게 비밀번호가 걸려있다.


근데 정말 친절하게 힌트로 5자리 숫자로 이루어졌다는걸 알려준다 ;;


이걸 푸는 툴은 아주 많다. 


대표적으로 

advanced archive password recovery, 

Advanced ZIP Password Recovery

John the Ripper (칼리 리눅스 등에 있음)  , John the Ripper (Windows) - 1.7.9 (윈도우버전도 있다!)

ALZip_v7.13 (구버전 알집으로 기본적으로 "알집 비밀번호 찾기" 기능을 제공해준다.)



사진이 안알라가므로.. ㅠㅠ


이이상은 생략.. 아무튼 5자리 숫자가 비밀번호이므로 브루트포싱(Brute-Force)하면 된다.

비밀번호는 38297


비밀번호를 풀고 알집을 열어보면 PW~.txt라는 게 있는데 


내용은 PASSWORD IS "asjkfhhdkjnxsdfiiuiui1258398298" 이다. 이제 이걸로 인증하면 플래그가 나온다.



FLAG{0H?!_Did_y0U_s01v3_it??}



[ch4n3] King Sejong (Crypto)

2017. 3. 8. 23:12

King Sejong (Crypto)


Created by ch4n3 | You can get 70point!



Great King Sejong said..
"EBB0A3EBB0A3EB94B0EBB0A6EB8BA4EBA7A3EBB0A3EBB0A2EB94B0EBB0A4E....



일단 문제 제목과 본문에서 알 수 있듯


세종대왕님... 즉 한글과 관련되었을 가능성이 매우 높아보인다.


일단 저 문자열을 2개씩 묶어 %을 붙여 URL디코딩을 해보았다.


  1. # your code goes here
  2.  
  3. str = "EBB0A3EBB0A3EB94B0EBB0A6EB8BA4EBA7A3EBB0A3EBB0A2EB94B0EBB0A4EB8BA4EBA7A3EBB09EEBB09DEB94B0EBB095EB8BA4EBA7A3EBB0A3EBB0A3EB94B0EBB09DEB8BA4EBA7A3EBB09CEBB0A3EB94B0EBB09BEB94B0EBB0AAEB8BA4EBA7A3EBB0A1EBB09DEB94B0EBB095EB8BA4EBA7A3EBB0A3EBB0A2EB94B0EBA7A3EBB0A3EBB0A3EB94B0EBB09AEB8BA4EBA7A3EBB09FEBB09EEB94B0EBB0A4EB8BA4EBA7A3EBB0A3EBB0A3EB94B0EBB0A1EB8BA4EBA7A3EBB09EEBB09FEB94B0EBB0A3EB8BA4EBB0A6EB8BA4EBA7A3EBB0A0EBB0A0EB94B0EBA7A3EBB0A4EBB0A2EB94B0EBA7A3EBB09EEBB0A2EB94B0EBB0A3EB8BA4EBB0A6EB8BA4EBA7A3EBB0A6EBB0A0EB94B0EBB095EB94B0EBA7A3EBB0A2EBB0AEEB8BA4EBB0A3EB94B0EBA7A3EBB0A0EBB0A0EB94B0EBB098EB8BA4EBA7A3EBB09EEBB09EEB94B0EBB0A3EB8BA4EBB0A6EB8BA4EBA7A3EBB09DEBB0A0EB94B0EBB098EB94B0EBA7A3EBB0A0EBB09DEB94B0EBB095EB8BA4EBA7A3EBB0A5EBB099EB94B0EBB09BEB8BA4EBB09AEB94B0EBA7A3EBB09AEBB099EB94B0EBB0A5EB8BA4EBB0AEEB94B0EBA7A3EBB0A1EBB0A1EB94B0EBB0A3EB8BA4EBB0A6EB8BA4EBA7A3EBB0A3EBB0A1EB94B0EBB097EB8BA4EBA7A3EBB09EEBB099EB94B0EBB09DEB8BA4EBA7A3EBB09BEBB09AEB94B0EBB09DEB94B0EBB099EB8BA4EBA7A3EBB0A5EBB0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%EB%A7%A3%EB%B0%A0%EB%B0%9D%EB%94%B0%EB%B0%95%EB%8B%A4%EB%A7%A3%EB%B0%A6%EB%B0%99%EB%8B%A4%EB%B0%AC%EB%94%B0%EB%A7%A3%EB%B0%A6%EB%B0%9A%EB%8B%A4%EB%B0%AC%EB%94%B0%EB%A7%A3%EB%B0%99%EB%B0%9C%EB%94%B0%EB%B0%9C%EB%94%B0%EB%A7%A3%ED%95%98


URL 디코딩 : http://www.convertstring.com/ko/EncodeDecode/UrlDecode


결과는 밑과 같다.


밣밣따밦다맣밣밢따밤다맣밞밝따박다맣밣밣따밝다맣발밣따받따밪다맣밡밝따박다맣밣밢따맣밣밣따밚다맣밟밞따밤다맣밣밣따밡다맣밞밟따밣다밦다맣밠밠따맣밤밢따맣밞밢따밣다밦다맣밦밠따박따맣밢밮다밣따맣밠밠따반다맣밞밞따밣다밦다맣밝밠따반따맣밠밝따박다맣밥밙따받다밚따맣밚밙따밥다밮따맣밡밡따밣다밦다맣밣밡따밗다맣밞밙따밝다맣받밚따밝따밙다맣밥밤따밦따밠다맣밠밦다밡따맣밭발따밚따밪타맣밗밤따밦따밝다맣밠밝따박다맣밦밙다밬따맣밦밚다밬따맣밙발따발따맣하


거참... 처음에는 잘못된줄 알았다.


일단 모르므로 첫 5~6글자 정도만 구글에 검색해보면 비슷한 형식으로 쓰인것들이 많이 검색되는것을 알수있다.


그래서 알아보니 "아희"라는 한글 프로그래밍언어란다. (아희 - 한글로 쓰는 난해한 프로그래밍 언어. 한국어 · English.)

나무위키 "아희" : https://namu.wiki/w/%EC%95%84%ED%9D%AC


이에 아희 인터프리터를 이용하여 위 언어를 해독하여 flag를 구할수 있었다.

아희 인터프리터 : http://puzzlet.org/doc/aheui/jsaheui_ko.html



FLAG{AHEUI_1$_Th3_b3st_L4nguag3!!}






[ch4n3] Reverse! (Crypto)

2017. 3. 8. 23:05


 

Reverse! (Crypto)


Created by 해커지망생 | You can get 60point!


}?HVUHYHU_ZRQN_XRB_RG{ VL JDOI

Can you decode it?
※ Flag is in upper case.



간단한 문제다. 일단 문제의 제목대로 저 문자열을 뒤집어보자


IODJ LV {GR_BRX_NQRZ_UHYHUVH?}


위와 같이 된다. 이 IODJ가 뭔가 FLAG같지 않은가? LV는 is로 보인다.


일단 간단한 시저암호를 시도해보면...


  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. int main()
  5. {
  6. char str[30]="IODJ LV {GR_BRX_NQRZ_UHYHUVH?}";
  7. int i,j;
  8.  
  9. for(j=0; j<26; j++, puts("")){
  10. printf("%2d : ",j);
  11. for(i=0; i<30; i++){
  12. if(str[i]>='A' && str[i]<='Z')
  13. printf("%c",(str[i]-'A'+j)%26+'A');
  14. else
  15. printf("%c",str[i]);
  16. }
  17. }
  18.  
  19. return 0;
  20. }


와... 사진안올라가;


23번째에서 복호화된.. 23 : FLAG IS {DO_YOU_KNOW_REVERSE?}


플래그를 발견할수있다.



FLAG : DO_YOU_KNOW_REVERSE?



BASE인코딩을 아니? (Crypto)


Created by MushRooM | You can get 50point!


Hint: base (2 square 4), base (2 square 5), base (2 square 6) X 5


base.txt


 


간단한 문제다.


힌트에서 나온대로 하면된다


문제의 base.txt을 base64 decode -> base32 decode -> base16 decode 이 순서대로 5번 반복하면된다.


base.txt 내용

...


너무 많으므로 결과물만 올리도록하겠다.


flag_{R3SP3CT_Y00N}


위가 결과다.


참고한 사이트는 밑과 같다... 사실 한사이트에서 다른것도 지원해주지만.. 서로서로 가끔씩 오류먹어서; base32 string이 아닙니다 라든가

역시 여러개의 사이트를 사용해서 오류안나는걸 확신할수 있어야할듯...


base64 : http://www.convertstring.com/ko/EncodeDecode/Base64Decode

base32 : https://emn178.github.io/online-tools/base32_decode.html

base16 : http://pbaseconverter.com/

'Write-up > Crypto' 카테고리의 다른 글

[anstromCTF 2017] Substitution Cipher  (0) 2017.04.25
[ch4n3] How are you? I'm XOR XOR.. (Crypto)  (0) 2017.03.08
[ch4n3] King Sejong (Crypto)  (0) 2017.03.08
[ch4n3] Reverse! (Crypto)  (0) 2017.03.08
[ch4n3] 아니..이것은?? (Crypto)  (0) 2017.03.06

+ Recent posts