import string a = "H5wg_2g_MCif_T1ou_v7v7v" b = "" ascii_lowercase = string.ascii_lowercase ascii_uppercase = string.ascii_uppercase
for letter in a: log = 0 if letter in ascii_uppercase: for upper in ascii_uppercase: c_upper = (ord(upper)-51)%26+65 ifchr(c_upper) == letter: b += upper log = 1 print("[+]{} is find --> {}".format(letter,upper)) if letter in ascii_lowercase: for lower in ascii_lowercase: c_lower = (ord(lower)-83)%26+97 ifchr(c_lower) == letter: b += lower log = 1 print("[+]{} is find --> {}".format(letter,lower)) if log == 0: b += letter print("[+]{} is find.".format(letter)) print(b)
msg1 = 0x9a9a9a6a9aa9656699a699a566995956996a996aa6a965aa9a6aa596a699665a9aa699655a696569655a9a9a9a595a6965569a59665566955a6965a9596a99aa9a9566a699aa9a969969669aa6969a9559596669 s = bin(msg1)[2:] print s r = "" tmp = 0 for i in xrange(len(s) / 2): c = s[i * 2] if c == s[i * 2 - 1]: r += '1' else: r += '0' printhex(int(r, 2))[2:-1].decode('hex')
flag
flag{zw1tt1hl-7zcv-ebfk-akxt-i4xdsxeuv5d3}
encrypt
flag
flag{Easy!eAsy!eaSy!}
Pwn
Electrical System
64位,仅有 NX 保护的程序。通过 IDA 分析,在菜单选择列表中,存在着栈溢出的漏洞。
分析源码得出,在输入 ID 时,数据(&buf)将会保存到 .bss 段,输入地址0x6020e0,检查发现这个程序的 .bss 段有可执行权限。
最终利用思路:输入 ID 时,把 shellcode 输进去。在菜单时,输入Check或者Recharge,避免exit(0),然后精心构造栈上数据,将 rip 覆写为 .bss 段地址(0x6020e0)。