반응형
반응형

*CTF 2021 
Crypto

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
from random import randint
import os
 
flag = "flag"
N=64
key=randint(0,2**N)
print key
key=bin(key)[2:].rjust(N,'0')
count=0
while True:
    p=0
    q=0
    new_key=''
    zeros=[0]
    for j in range(len(key)):
        if key[j]=='0':
            zeros.append(j)
    p=zeros[randint(0,len(zeros))-1]
    q=zeros[randint(0,len(zeros))-1]
    try:
        mask=int(raw_input("mask:"))
    except:
        exit(0)
    mask=bin(mask)[2:]
    if p>q:
        tmp=q
        q=p
        p=tmp
    cnt=0
    for j in range(0,N):
        if j in range(p,q+1):
            new_key+=str(int(mask[cnt])^int(key[j]))
        else:
            new_key+=key[j]
        cnt+=1
        cnt%=len(mask)
    key=new_key
    try:
        guess=int(raw_input("guess:"))
    except:
        exit(0)
    if guess==int(key,2):
        count+=1
        print 'Nice.'
    else:
        count=0
        print 'Oops.'
    if count>2:
        print flag
 
cs

랜덤 key를 생성하고

generate random key

mask 값을 입력받아 여러번 xor을 해서

xor mask value and key

만들어진 key값을 3번 맞추면 되는데

need guessing key 3 times

 

mask에 0을 넣으면 xor을 몇 번을 하던지 그대로다.

however, when you put 0 in mask, xor calculation is useless.


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
from random import randint
import os
from flag import flag
N=64
key=randint(0,2**N)
# print key
key=bin(key)[2:].rjust(N,'0')
count=0
while True:
    p=0
    q=0
    new_key=''
    zeros=[0]
    for j in range(len(key)):
        if key[j]=='0':
            zeros.append(j)
    p=zeros[randint(0,len(zeros))-1]
    q=zeros[randint(0,len(zeros))-1]
    try:
        mask=int(raw_input("mask:"))
    except:
        exit(0)
    mask=bin(mask)[2:]
    if p>q:
        tmp=q
        q=p
        p=tmp
    cnt=0
    for j in range(0,N):
        if j in range(p,q+1):
            new_key+=str(int(mask[cnt])^int(key[j]))
        else:
            new_key+=key[j]
        cnt+=1
        cnt%=len(mask)
    key=new_key
    try:
        guess=int(raw_input("guess:"))
    except:
        exit(0)
    if guess==int(key,2):
        count+=1
        print 'Nice.'
    else:
        count=0
        print 'Oops.'
    if count>2:
        print flag
cs

guesskey 문제 잘못냈나보다.

처음 print key가 주석처리되었다.

no print key :p

 

key를 2진법으로 나타냈을 때 0의 개수를 구해서

p와 q를 생성하고

p와 q번째 사이번째 비트는 mask와 xor을 하고

그 외 비트는 그대로 가져온다.

 

mask = 1 로 두고 계속 돌리면

하위 비트 쪽은 1로 되고

0의 개수가 작아지면서 p와 q도 작아지고

그럼 더더욱 하위 비트는 유지되고

 

just put 1 in mask.

뭐 이런 식으로 비트들이 1로 되어간다.

it's gonna be 1s

 

한 150~200번 돌리면

try 150-200 times

값은 두 개중 하나가 된다.

이제 mask = 0 으로 두고 두 개중 하나를 때려박으면 된다.

choice one between 92~ and 18~

 


Misc

\

vhdxfile

encrypted by BitLocker

 

 

bitlocker2john

 

hashcat

 

 

password 12345678

 

 

 

open with tool like ftk imager

extract two pdf files

 

pdfcandy.com/extract-images.html

extract images from pdf files

flag image. done.

반응형

'CTF Write Up' 카테고리의 다른 글

0x41414141 CTF Write up  (0) 2021.01.31
ShadowCTF write up  (0) 2021.01.27
The Cyber Grabs CTF 0x02 write up  (0) 2021.01.17
0xL4ugh CTF write up  (0) 2021.01.16
2020 Christmas CTF [show me the pcap] Write-up  (2) 2020.12.27
반응형

my write ups during the ctf & after the ctf

공부겸 오피셜 롸업 보고 풀어서 내용들을 추가했습니다.

 

Forensic

gchq.github.io/CyberChef/

 

CyberChef

 

gchq.github.io


 

SAM은 있는데 SYSTEM이 없네...;;

 다른 방법을 찾아야 한다.

 

이 내용이 힌트였다.

 

저 내용만 가지고 temp 에 있는 lsass.DMP를 찾아내야 했다..

 

crackstation.net/

 

CrackStation - Online Password Hash Cracking - MD5, SHA1, Linux, Rainbow Tables, etc.

Free Password Hash Cracker Enter up to 20 non-salted hashes, one per line: Supports: LM, NTLM, md2, md4, md5, md5(md5_hex), md5-half, sha1, sha224, sha256, sha384, sha512, ripeMD160, whirlpool, MySQL 4.1+ (sha1(sha1_bin)), QubesV3.1BackupDefaults How Crack

crackstation.net


 

아 왜 이거 아님

 

흠.......................

여기 있는 이 stargazer.jpg를 사용해야되는 문제였다.

 

 

여기서 이 문자열을 패스워드로 해서

steghide를 돌리면 플래그가 나오는 문제였다... 아니 이걸 어케 알지..


Crypto

CipherText : @$$@@@$$@$$$$@@$@$$@@@$@@$$@@$@$@$$$@@$@@$$@@$$$@$$$@@$@@$$@@@@$@$$@@@$@@$$$@@$$@$$$$@$$@$$$@@@$@$$$@$@$@$$@$@@$@$$$@$@@@@$$@@$$@$@$$$$$@$$@@$$$@@$$@@@@@@$$@@@@@$$@@$@@@$@$$$$$@$$$@$$$@@$$@$@@@$$$@@$@@$$@$$@$@$$$@$@$@$$$@@@@@$@$$$$$@$$@$@@$@$$$@@$$@$$@$$$@@@$@@$$$@$$$@$@@@$@$$$$$@$$@$@@$@$$$@$@@@$$$$$@$

 

@ -> 0

$ -> 1

bin to ascii

 


morsecode.world/international/decoder/audio-decoder-adaptive.html

 

Morse Code Adaptive Audio Decoder | Morse Code World

Notes The decoder will analyse sound coming from the microphone or from an audio file. The spectrogram of the sound is shown in the main graph along with a pink region showing the frequency being analysed. If the volume in the chosen frequency is louder th

morsecode.world


Misc

 

holloway.nz/steg/

 

Twitter Secret Messages - Steganography

Hide secret messages in your tweets (or any text) with steg-of-the-dump.js. Tweet i had a great day at the beach! #sunshine Hidden Message kidnapped by pirates Tweet to post Warning: Not all of Hidden Message stored in tweet. Add more text (e.g. spaces) to

holloway.nz

이런게 있넹


www.boxentriq.com/code-breaking/hexahue

 

Hexahue Alphabet - decoder, translator | Boxentriq

Tool to decrypt Hexahue code. Hexahue, and variants of it, are used occasionally in geocaching mystery caches, CTFs and logic puzzles. Look specifically for the color combinations to recognize it.

www.boxentriq.com

color code cryptography

이런게 있네

반응형

'CTF Write Up' 카테고리의 다른 글

ShadowCTF write up  (0) 2021.01.27
starCTF 2021 write-up  (0) 2021.01.18
0xL4ugh CTF write up  (0) 2021.01.16
2020 Christmas CTF [show me the pcap] Write-up  (2) 2020.12.27
CyberTalents Digital Forensics CTF write up  (0) 2020.11.29
반응형

Forenscis

 

3Cd7MMS7GmZMwxmRTfQwoXvxcDkGt8o4cFzwPUrg

then what?

 

 

 

아 base58이었넹

ah it was base58 encoded strings.


 

ascii 85 -> pastebin.pl/view

 

use "d02a7960"

 

pastebin.pl/view/d02a7960

 

morse code

 

S0METIM35SH4RK1SFR13ND1Y

 


png file.

4F -> 4E

43 -> 44

 

46 -> 4e

 

nothing here :(

 

 

move to 5527125

start and end...?

xor 6


Crypto

{ ^),!&),!!$,^$,!^%,!$&,!%),!&#,!!#,^#,!&!,!$@,^),!$!,!^@,!$$,!#&,^!,!^#,!#&,!!),^#,!!$,!@),!)^,!@%,^!,^!,!&% }

 

! -> 1

@ -> 2

# -> 3

...

60 170 114 64 165 147 150 173 113 63 171 142 60 141 162 144 137 61 163 137 110 63 114 120 106 125 61 61 175

hmm..

Isn't it this?

 

아 8진수였네

ah octal..


n = 5028492424316659784848610571868499830635784588253436599431884204425304126574506051458282629520844349077718907065343861952658055912723193332988900049704385076586516440137002407618568563003151764276775720948938528351773075093802636408325577864234115127871390168096496816499360494036227508350983216047669122408034583867561383118909895952974973292619495653073541886055538702432092425858482003930575665792421982301721054750712657799039327522613062264704797422340254020326514065801221180376851065029216809710795296030568379075073865984532498070572310229403940699763425130520414160563102491810814915288755251220179858773367510455580835421154668619370583787024315600566549750956030977653030065606416521363336014610142446739352985652335981500656145027999377047563266566792989553932335258615049158885853966867137798471757467768769820421797075336546511982769835420524203920252434351263053140580327108189404503020910499228438500946012560331269890809392427093030932508389051070445428793625564099729529982492671019322403728879286539821165627370580739998221464217677185178817064155665872550466352067822943073454133105879256544996546945106521271564937390984619840428052621074566596529317714264401833493628083147272364024196348602285804117877
e = 65537
c = 4690057718147075505522680135959473215321622692923721213835300886402444910436674094980456964526719786485709929645871497583481786451712108343985733309427211434750949557522557087475715799166136616546091244246093209194216096205011115055709130990240778725741521267153888212132276867942685123502211572949952162376597662509054070693025973089923370015547373862589488928782901235791144433788299046705518327561160954291094820233386528023713184029738780555483600166071578613803010858511582163397706626459433456365568227181855121476317779040965290548179086133039864725660837003894485377993939038122515590380127757353399577646033195886942935498851291625325622687406058565345707842924577200871090281931390828399034387159796711570518912284855782049322766568438776035673997640836043767460584670094065481165095303859142188605921710309909549354356478577687136627040919972987279885429990570784611705563443122226291405511409355924588407638851356402686178076614729462505897314633054448103933929160379080620408454649164684464952565103672481604538187885457480005006907884784443460386864548916037417492123123957243478299871616131317172973941585334012558762947082226744473068190488648000780008598569174088053018903156614111943478152720349210983651343

search n at www.factordb.com/

 

factordb.com

 

www.factordb.com

good.

 

 


braille

 

0xL4ugh{I_Th1nk_Br1ll3_W45_$m4rt}

 


Web

make money~

 

I found base32 strings in cookie.

 

 

 


 

 

Reverse Engineering

 

HxD


 

WA! Flag!


rand() % 4 값을 반복 생성하여 파일 크기와 동일한 크기의 배열에 저장한다.

파일의 j번째 바이트와 랜덤값이 들어간 배열의 j번째 바이트를 가져와서

mystery함수 호출

 

Repeat generation of values (rand() %4) and push them on an array of the same size as the file size.
Gets the jth byte of the file and the jth byte of the array containing random values.

call mystery function

 

랜덤값이 2또는 0인경우 파일의 값과 1을 xor연산하여 리턴.

 

If the random value is 2 or 0, xor computes the byte and 1 of the file and returns it.

 

 

 

main 함수에서 srand(0)을 사용했으므로 시드가 고정.

랜덤값을 구할 수 있음.

 

 

The seed is fixed because it used sand(0) in main func.
I can get random values.

 

 

 


 

Programming

 

 

 


Misc

Sonic Visualiser

spectrogram

FLAG : 0xL4ugh{SP3c7ro_1s_Gr347}

 

 


 

github.com/jzyra/DecodeAndroidGesture

 

jzyra/DecodeAndroidGesture

This tool decode Android's pattern lock screen with gesture.key file in Android device. - jzyra/DecodeAndroidGesture

github.com

 

 


 

github.com/ribt/dtmf-decoder

 

ribt/dtmf-decoder

Extract phone numbers from an audio recording of the dial tones. - ribt/dtmf-decoder

github.com

 

 

66#666#8#33#888#33#777#999#8#44#444#66#4#666#66#7777#2#6#33#9#2#999#

->
noteverythingonsameway

 

 

 

반응형

'CTF Write Up' 카테고리의 다른 글

starCTF 2021 write-up  (0) 2021.01.18
The Cyber Grabs CTF 0x02 write up  (0) 2021.01.17
2020 Christmas CTF [show me the pcap] Write-up  (2) 2020.12.27
CyberTalents Digital Forensics CTF write up  (0) 2020.11.29
제 2회 TeamH4C CTF 2020 Write-up  (0) 2020.10.13

+ Recent posts