1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
| from os import stat import requests from bs4 import BeautifulSoup import random url = "http://47.104.243.99:10000/show.php"
def getdata(msg): data = { "rp": msg } r = requests.post(url, data=data) Soup = BeautifulSoup(r.text, 'lxml') all_p = Soup.find_all('p') return (all_p)
flag = int(str(getdata("flag")[1]).split(":")[1].strip('</p>')) print(flag) '''
print(bin(101)) print(bin(102)) print(bin(103)) s = state[2] - state[1] print(s) print(state[2] - state[0]) news = [] news.append(state[2] - state[0]) news.append(state[2] - state[1]) print(state[0b1101100-101]-state[0b1101000-101]) print(state[0b1101101-101]-state[0b1101001-101])
'''
flag = int(str(getdata("flag")[1]).split(":")[1].strip('</p>')) base = 0b10000000000000000000000000000000000000000000000 base_num = (int(str(getdata(base)[1]).split(":")[1].strip('</p>'))) new_state = [] for i in range(32): tmp = 1<<i new_state.append(int(str(getdata(base|tmp)[1]).split(":")[1].strip('</p>')) - base_num) print(new_state) ''' new_state =[97005071980911, 32652300906411, 73356817713575, 108707065719744, 103728503304990, 49534310783118, 53330718889073, 2121345207564, 46184783396167, 115771983454147, 64261597617025, 2311575715655, 56368973049223, 84737125416797, 24316288533033, 82963866264519, 101019837363048, 25996629336722, 41785472478854, 68598110798404, 40392871001665, 94404798756171, 54290928637774, 112742212150946, 91051110026378, 124542182410773, 40388473698647, 22059564851978, 57353373067776, 80692115733908, 84559172686971, 28186390895657, 97005071980911, 32652300906411, 73356817713575, 108707065719744, 103728503304990, 49534310783118, 53330718889073, 2121345207564, 46184783396167, 115771983454147, 64261597617025, 2311575715655, 56368973049223, 84737125416797, 24316288533033, 82963866264519, 101019837363048, 25996629336722, 0, 68598110798404, 40392871001665, 94404798756171, 54290928637774, 112742212150946, 91051110026378, 124542182410773, 40388473698647, 22059564851978, 57353373067776, 80692115733908, 84559172686971, 125191462876568] ''' from sage.all import* nbit = len(new_state) A = Matrix(ZZ, nbit + 1, nbit + 1) for i in range(nbit): A[i, i] = 1
for i in range(nbit): A[i, nbit] = new_state[i]
A[nbit, nbit] = -int(flag)
res = A.LLL() for i in range(0, nbit + 1): M = res.row(i).list() nnn = True for m in M: if m != 0 and m != 1: nnn = False break if nnn: print(i, M) M = ''.join(str(j) for j in M) M = (int(M[::-1], 2)) print(M) print(getdata(M))
|