DONE spbctf4x8664
Свапает permutation[input[i]] и permutation[input[i] + 1], проверяет что permuation отсорченый
arr = [8, 7, 5, 4, 1, 3, 2, 6, 9, 10]
res = []
for i in range(len(arr)):
for j in range(len(arr) - 1):
if arr[j] > arr[j + 1]:
res.append(j)
arr[j + 1], arr[j] = arr[j], arr[j + 1]
print(''.join(map(lambda x: str(x), res)))DONE s2.out
DONE spbctf2x86
497 1207 1273 871 476 884 1615 475 2233 231 505 1919 190 2755 231 561
Каждая пара чисел это x * prime1 и x * prime2, где x число из ввода, а
prime1, prime2 два различных простых числа
import math
arr = [497, 1207, 1273, 871, 476, 884, 1615, 475, 2233, 231, 505, 1919, 190, 2755, 231, 561]
res = ''
for i in range(0, len(arr), 2):
res += chr(math.gcd(arr[i], arr[i + 1]))
return resDONE cosy
import math
arr = [3089, 9659, 174, 9993, 3255, 9961, 5876, 8910, 6155, 9986, 4382, 7880, 1218, 8660, 3255, 8746, 6155, 9781, 4999, 9455, 1218, 7987]
res = ''
for (i, x) in enumerate(arr):
if i % 2 == 0:
c = math.asin(x / 10000.) * 180. / math.pi
else:
c = math.acos(x / 10000.) * 180. / math.pi
c = round(c)
if c == 36:
res += '{'
elif c == 37:
res += '}'
elif c == 38:
res += '_'
elif c <= 25:
res += chr(c + ord('a'))
else:
res += chr(c + 0x16)
print(res) DONE sparta
s = "st_3phr_b13gcsvut_3yf1rz{55}"
res = [0]*len(s)
k = 0
for i in range(7):
for j in range(i, len(s), 7):
res[j] = ord(s[k])
k += 1
print(''.join(map(lambda x: chr(x), res)))DONE spbctf3x8664
Есть функция swapper(input, step), которая свапает эдементы input[i] и
input[i + step - 1] для i = 0, step, step * 2, ... и step = 10..2.
s = "_A_m_aFneSuyn_w_IypvSr_ahIEwp_gitrnMhaetevT_so!"
res = list(s)
for step in range(2, 11):
for i in range(0, len(s) - step + 1, step):
res[i], res[i + step - 1] = res[i + step - 1], res[i]
print(''.join(res))DONE mixer
arr1 = "abcdefghijklmnopqrstuvwxyz_{}0123456789"
arr2 = "wmf9slha2r}v7te_13kby8ug4c{oz5j0idp6nqx"
dec = "k_mfblobadb{udp{idp4{iaxz"
res = ''
for c in dec:
res += arr1[arr2.find(c)]
print(res)DONE task2.out
Решим систему
- id(‘s’) = id(x) * id(‘d’) + id(y) % 29
- id(‘p’) = id(x) * id(‘i’) + id(y) % 29
s = "abcdefghijklmnopqrstuvwxyz{}_"
enc = "dix_gyhiiz}xdduah}puvyhn}u}pxa}tnbfh}ozbc"
id_d = s.find(enc[0])
id_i = s.find(enc[1])
for x in range(len(s)):
for y in range(len(s)):
id_s = (x * id_d + y) % 29
id_p = (x * id_i + y) % 29
if s[id_s] == 'f' and s[id_p] == 'l':
print(s[x], s[y])DONE task4
print(0x0804867F) DONE s3.out
f = 61
c = 117 * f
i = 1
while c * i % 256 != 118:
i += 1
print(chr(f - 1), chr(i - 1))DONE crackme1
all ones
DONE task1.out
import struct
s = "FLAG{123REALFLAG!!!}"
h = -889266515
for i in range(0, len(s), 4):
h ^= struct.unpack('I', s[i:i+4].encode())[0]
print(h)import struct
h = -889266515
print(struct.pack('I', h ^ -928216155 ^ struct.unpack('I', b'1234')[0]))DONE task3
01234567
zfssaizs

DONE s5.out
s = 'a'
for i in range(6):
s += chr(ord(s[-1]) + i + 1)
print(s)DONE s7.out
s = 'x'
for i in range(5, 0, -1):
s = chr(ord(s[0]) - i) + s
print(s)DONE s6.out
0123456
X2Fw13D
DONE s4.out
89ABCD
c14aeB