Home DICE CTF@HOPE 2022
Post
Cancel

DICE CTF@HOPE 2022

rev/slices

Description: Have a slice

Given python file

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
flag = input('Enter flag: ')

def fail():
    print('Wrong!')
    exit(-1)

if len(flag) != 32: fail()

if flag[:5] != 'hope{': fail()
if flag[-1] != '}': fail()
if flag[5::3] != 'i0_tnl3a0': fail()
if flag[4::4] != '{0p0lsl': fail()
if flag[3::5] != 'e0y_3l': fail()
if flag[6::3] != '_vph_is_t': fail()
if flag[7::3] != 'ley0sc_l}': fail()

print('Congrats!')
print('flag is: ', flag)

Solve script

1
2
3
4
5
6
7
8
9
flag = ['x' for _ in range(0,32)]
flag[:5] = 'hope{'
flag[-1] = '}'
flag[5::3] = 'i0_tnl3a0'
flag[4::4] = '{0p0lsl'
flag[3::5] = 'e0y_3l'
flag[6::3] = '_vph_is_t'
flag[7::3] = 'ley0sc_l}'
print(''.join(flag))

flag:hope{i_l0ve_pyth0n_slic3s_a_l0t}

misc/orphan

Description: nothing to see here

orphan.zip

Visit /orphan/.git/logs

0000000000000000000000000000000000000000 2ce03bc4ae69cd194b7680b18172641f7d56fbbf William Wang <defund@users.noreply.github.com> 1658084429 -0400 commit (initial): add foo
0000000000000000000000000000000000000000 2ce03bc4ae69cd194b7680b18172641f7d56fbbf William Wang <defund@users.noreply.github.com> 1658084534 -0400 checkout: moving from flag to main
0000000000000000000000000000000000000000 b53c9e6864ed176ea0192fd8283362a41d94906c William Wang <defund@users.noreply.github.com> 1658084626 -0400 commit (initial): add flag
b53c9e6864ed176ea0192fd8283362a41d94906c 2ce03bc4ae69cd194b7680b18172641f7d56fbbf William Wang <defund@users.noreply.github.com> 1658084645 -0400 checkout: moving from flag to main

Move to the commit where the flag was added using git checkout -b res b53c9e6864ed176ea0192fd8283362a41d94906c

flag:hope{ba9f11ecc3497d9993b933fdc2bd61e5}

This post is licensed under CC BY 4.0 by the author.
Trending Tags