#sniffer.py nums = [] keys = open('usbdata.txt','r') result=open('result.txt','w') posx = 0 posy = 0 forlineinkeys: x = int(line[2:4],16) y = int(line[5:7],16) if x > 127 : x -= 256 if y >115 : y -=256 posx += x posy += y btn_flag = int(line[0:2],16) # 1 for left , 2 for right , 0 for nothing if btn_flag == 1 : # 1 代表左键,2代表右键 result.write(str(posx)+' '+str(-posy)+'\n') keys.close() result.close()
n = p * q #模数 d = 13520637333215938186701232387959186078192441834430646200152017496580083015894693608744446669957196067379816242548412185148719678858906249430631086296059347471406865114774824686655919643954375513480029176520925196420025095437582404880108633026550155505640286905930669447727266167475328689082873003809052013145641561953548574050510799399063204788021266291024788348241346451907588463054320379080780429068578299089418923223030202618570767162875599171107099044497918583654800248238807175687675702792006125086389940138212608569298856353395124065366005586641202732989813698557545059249478652073299085605820622861917775089649
c =22886015855857570934458119207589468036427819233100165358753348672429768179802313173980683835839060302192974676103009829680448391991795003347995943925826913190907148491842575401236879172753322166199945839038316446615621136778270903537132526524507377773094660056144412196579940619996180527179824934152320202452981537526759225006396924528945160807152512753988038894126566572241510883486584129614281936540861801302684550521904620303946721322791533756703992307396221043157633995229923356308284045440648542300161500649145193884889980827640680145641832152753769606803521928095124230843021310132841509181297101645567863161780 m=pow(c,d,n) print(m)
for p2 in itertools.product(printable, repeat=3): key = "".join(p2) key2 = key+"0000000000000" cipher2 = AES.new(key=key2.encode(), mode=AES.MODE_ECB) c2 = cipher2.decrypt(yan) # print("c2==",c2) if c2 in table: key1 = table[c2] print(key1, key2) break
flag = b"196cc94c2d685beb54beeaa14c1dc0a6f3794d65fca0d1a1274515166e4255ab367383092e42d774992f74bc138faaad" flag = unhexlify(flag) for key in [key2, key1]: cipher = AES.new(key=key.encode(), mode=AES.MODE_ECB) flag = cipher.decrypt(flag) print(flag)