s = "cp33AI9~p78f8h1UcspOtKMQbxSKdq~^0yANxbnN)d}k&6eUNr66UK7Hsk_uFSb5#9b&PjV5_8phe7C#CLc#<QSr0sb6{%NC8G|ra!YJyaG_~RfV3sw_&SW~}((_1>rh0dMzi><i6)wPgxiCzJJVd8CsGkT^p>_KXGxv1cIs1q(QwpnONOU9PtP35JJ5<hlsThB{uCs4knEJxGgzpI&u)1d{4<098KpXrLko{Tn{gY<|EjH_ez{z)j)_3t(|13Y}" print len(s) a = 0 flag = "" for i in range(32): flag += s[a] a = (a + 33) % 256 print flag
flag:cybrics{pdp_gpg_crc_dtd_bkb_php}
Honey, Help!
1 2
desc:I was working in my Kali MATE, pressed something, AND EVERYTHING DISAPPEARED! file:honey_hlep.txt
defaffine_d(a,b,c): return chr((a*(ord(c) - b))%256) with open("zakukozh.bin",'rb') as f: data = f.read()
for i in range(3,256,2): for j in range(256): file = ''.join([affine_d(i,j,c) for c in data]) with open("output/file_{}_{}".format(i,j),'wb') as f: f.write(file)
png = [0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a] zakukozh = [0x60, 0x09, 0xeb, 0x82, 0x1c, 0xef, 0xdf, 0xef] x = [] defbrute_a_b(): for a in range(3,256,2): for b in range(256): x = zakukozh[:] for i in range(8): x[i] = (a*(zakukozh[i] - b))%256 if x==png: return a,b
a,b = brute_a_b() print a,b
with open("zakukozh.bin",'rb') as f: data = f.read()
png = "" for i in data: png += chr((a * (ord(i) - b))%256) with open("flag.png",'wb') as f: f.write(png)
flag:cybrics{W311_C0M3_2_CY13R1C5}
ProCTF
1 2 3 4
desc:We Provide you a Login for your scientific researches. Don't try to find the flag.
img = qrcode.make('cat flag.txt') #生成二维码图片 data = b'' for y in range(img.size[1]): for x in range(img.size[0]): r = img.getpixel((x, y)) if r == 255: data += b'\xe2\x96\x88' else: data += b' ' data += b'\n' data += b'\n.'
from pwn import * from PIL import Image from pyzbar.pyzbar import decode import qrcode
#context.log_level = 'debug' p = remote("spbctf.ppctf.net", "37338")
defrecv(): data = p.recvuntil("\n.").rstrip('.').rstrip() p.recvline()
data += '#' qr = [[]] i = 0
while i < len(data): if data[i] == '\xe2': qr[-1].append(255) i += 3 elif data[i] == '\x20': qr[-1].append(0) i += 1 elif data[i] == '\x0a': qr.append([]) i += 1 else: break
defsend(cmd): img = qrcode.make(cmd) data = b'' for y in range(img.size[1]): for x in range(img.size[0]): r = img.getpixel((x, y)) if r == 255: data += b'\xe2\x96\x88' else: data += ' ' data += '\n' data += b'\n.' p.sendline(data)