deftest2(): a='2855140337590c3434040c5b411346492b3113430c11254a49220a17b3def0b3b0e1f2b7d7bdfdb8' j=100 withopen('tmp','w') as f: for i inrange(0,len(a),2): p=int(a[i:i+2],16) print(hex(p)) print(hex(p^j)) print(chr(p^j)) f.write(chr(p^j)) j+=1
if __name__=='__main__': # test2() # test1() a='2855140337590c3434040c5b411346492b3113430c11254a49220a17b3def0b3b0e1f2b7d7bdfdb8' print(bytes.fromhex(a))
robin@ubuntu:~/ctf/asis20$ nc 66.172.10.203 9999 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + ..:: Crusoe flag checker ::.. + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | Please input your right answer for Crusoe task: QXNJU3TJUNXTMDNHMT0WM19HMIJIDTXJNHQZZH9HYZ4T251NZUHIX1 Congrats! this is the flag: ASIS{cRuS03_10V3__0bFu5c4T3d__c0COnu75!!}
a='' for i inrange(10): a+=str(i) for i inrange(26): a+=chr(ord('a')+i) for i inrange(26): a+=chr(ord('A')+i)
withopen('re\\crusoe\\Crusoe\\table','r') as f: b=f.read() b=b.split('\n\n')
defsp8(input8): cur8=['']*8 lines=input8.split('\n') for line in lines: for k inrange(0,len(line),9): cur8[k//9]+=line[k:k+9] return cur8
cur=sp8(b[0]) cctable=list() for cccc in b: cur=sp8(cccc) cctable.extend(cur)
print(len(a)) print(len(cctable))
mapp=dict() zero=cctable[0] mapp[zero]='0'
for i inrange(0,9): mapp[''.join(cctable[i*2+1:i*2+3])]=str(i+1)
for i,j in mapp.items(): print(i,j)
for i inrange(10,len(a)): print(i) mapp[cctable[i+9]]=a[i] print(mapp)
withopen('re\\crusoe\\Crusoe\\flag.crusoe','r') as f: b=f.read().split('\n\n')
cctable=list() for cccc in b: cur=sp8(cccc) cctable.extend(cur)
i=0 while i<len(cctable): # for i in range(0,len(cctable)): 这里很坑,i只能逐个增加,所以改while if cctable[i]==zero: if''.join(cctable[i:i+2]) in mapp: print(mapp[''.join(cctable[i:i+2])],end='') i+=2 continue else: print('0',end='') elif cctable[i] in mapp: print(mapp[cctable[i]],end='') else: print() print('error') # print(cctable[i]) for l inrange(0,len(cctable[i]),9): for k inrange(9): print(cctable[i][l+k],end='') print() i+=1 # a='QXNJU3QTJUNXTMDNHMT0WM1K9IHMIJIDTXJNHQZZH9IHYZ4DT225E1KNZUHIX1' # re_mapp={} # for i,j in mapp.items(): # re_mapp[j]=i # lll=['']*20 # for i in a: # cur=re_mapp[i] # for i in range(0,len(cur),9): # lll[i//9]+=cur[i:i+9] # for j in lll: # print(j)