Jaeseo's Information Security Story

RITSEC CTF 2019 - WriteUp - Crack me If You Can 본문

Write UP/RITSEC CTF 2019

RITSEC CTF 2019 - WriteUp - Crack me If You Can

Jaeseokim 2019. 11. 25. 11:00

Crack me If You Can

문제구분 난이도 작성자
MISC JaeSeoKim

문제 내용

문제 풀이

일단 제공하는 NC로 접속을 하면 아래와 같은 화면으로 입력값을 받습니다.

root@kali:~# nc ctfchallenges.ritsec.club 8080
Some moron just breached Meme Corp and decided to dump their passwords...  
In the meantime, prepare your GPUs, and get Ready... Set.... and go CRACK!
However... We have a theory that the passwords might come from darkweb2017-top10000.txt, xato-net-10-million-passwords-1000000.txt or 10-million-password-list-top-1000000.txt
$6$xkqzaubnw8pjwATX$4RE4ESO1jYRq6EZjG5vN1tBAwqdvq24qVvTXT7Q3WlsNOErKD9A2R1cqNclQKbtdZ.M68MpoC5O3M9K1vVE16.

출력 값을 보니 사전 파일에서 랜덤으로 제공하는 값을 Hash한 값으로 보이는데, Crack해서 그 값을 입력 해주면 되는 것으로 보입니다. Hash의 알고리즘 종류는 linux에서 사용하는 sha512로 예상이 되는데 일단 hashcat를 이용해서 크랙을 합니다.

PS D:\OneDrive - JaeSeo\tools\attack-tools\hashcat-5.1.0> .\hashcat64.exe -d 1 -a 0 -m 1800 .\passwd.txt .\darkweb2017-top10000.txt -o .\pass.txt         

이제 크랙 결과물로 iubire라는 값이 나왔는데 이걸 입력합니다.

root@kali:~# nc ctfchallenges.ritsec.club 8080
Some moron just breached Meme Corp and decided to dump their passwords...  
In the meantime, prepare your GPUs, and get Ready... Set.... and go CRACK!
However... We have a theory that the passwords might come from darkweb2017-top10000.txt, xato-net-10-million-passwords-1000000.txt or 10-million-password-list-top-1000000.txt
$6$xkqzaubnw8pjwATX$4RE4ESO1jYRq6EZjG5vN1tBAwqdvq24qVvTXT7Q3WlsNOErKD9A2R1cqNclQKbtdZ.M68MpoC5O3M9K1vVE16.
iubire
Good job.
$6$WHimXtXAMHB8UM6e$.2T7RLA4JCdeoi9k6cp/P822jK8moxcbrEbYurcWjwcPAmGDUKfr4diqykVFalVMWrdoYxIaX.4H9lekmxuF4/

그러자 한번더 hash값을 제공을 합니다. 이번에도 똑같이 Crack를 시도합니다. 이번에는 qwerty3라는 값이 나왔습니다.

root@kali:~# nc ctfchallenges.ritsec.club 8080
Some moron just breached Meme Corp and decided to dump their passwords...  
In the meantime, prepare your GPUs, and get Ready... Set.... and go CRACK!
However... We have a theory that the passwords might come from darkweb2017-top10000.txt, xato-net-10-million-passwords-1000000.txt or 10-million-password-list-top-1000000.txt
$6$xkqzaubnw8pjwATX$4RE4ESO1jYRq6EZjG5vN1tBAwqdvq24qVvTXT7Q3WlsNOErKD9A2R1cqNclQKbtdZ.M68MpoC5O3M9K1vVE16.
iubire
Good job.
$6$WHimXtXAMHB8UM6e$.2T7RLA4JCdeoi9k6cp/P822jK8moxcbrEbYurcWjwcPAmGDUKfr4diqykVFalVMWrdoYxIaX.4H9lekmxuF4/
qwerty3
Good job.
40033142f1fb31768faa8d3f619c5145

이번에는 새로운 hash값이 나오는데 이것을 hash-identifiter분석해봅니다.

 HASH: 40033142f1fb31768faa8d3f619c5145

Possible Hashs:
[+] MD5
[+] Domain Cached Credentials - MD4(MD4(($pass)).(strtolower($username)))

Least Possible Hashs:
[+] RAdmin v2.x
[+] NTLM
[+] MD4
[+] MD2
[+] MD5(HMAC)
#----------------------------------이하 생략----------------------------------

MD5, MD4, RAdmin, NTLM등의 Hash 알고리즘으로 예상이 되는데 hash-cat를 이용하여 시도하여 봅니다. 그결과 NTLM으로 시도 하였을 때 크랙이 성공하는 모습을 볼 수 있었습니다.

PS D:\OneDrive - JaeSeo\tools\attack-tools\hashcat-5.1.0> .\hashcat64.exe -d 1 -a 0 -m 1000 .\passwd.txt .\10-million-password-list-top-1000000.txt -o .\pass.txt

이제 결과값으로 나온 katinka를 입력 해주면 아래와 같이 flag 를 출력해줍니다.

root@kali:~# nc ctfchallenges.ritsec.club 8080
Some moron just breached Meme Corp and decided to dump their passwords...  
In the meantime, prepare your GPUs, and get Ready... Set.... and go CRACK!
However... We have a theory that the passwords might come from darkweb2017-top10000.txt, xato-net-10-million-passwords-1000000.txt or 10-million-password-list-top-1000000.txt
$6$xkqzaubnw8pjwATX$4RE4ESO1jYRq6EZjG5vN1tBAwqdvq24qVvTXT7Q3WlsNOErKD9A2R1cqNclQKbtdZ.M68MpoC5O3M9K1vVE16.
iubire
Good job.
$6$WHimXtXAMHB8UM6e$.2T7RLA4JCdeoi9k6cp/P822jK8moxcbrEbYurcWjwcPAmGDUKfr4diqykVFalVMWrdoYxIaX.4H9lekmxuF4/
qwerty3
Good job.
40033142f1fb31768faa8d3f619c5145
katinka
Good job.
NICE JOB.  FLAG:RS{H@$HM31FY0UCAN}

RS{H@$HM31FY0UCAN}

 

참고 포인트

  • hashcat
  • hash-identifiter
  • 1800 : sha512crypt $6$, SHA512 (Unix) 2
  • 1000 : NTLM
Comments