import requests for i in range(1000): url = 'http://bxs.cumt.edu.cn/challenge/web/code/{}.bak'.format(i) r = requests.get(url) print(i) if'flag'in r.text: print(r.text) break
import requests, json, urllib, re s = requests.Session() r = s.get(r'http://bxs.cumt.edu.cn/challenge/web/ctf0001/') second = int(re.search(r'服务器时间:.+?\d{2}:\d{2}:(\d{2})', r.text).group(1)) print(second) r = s.get(r'http://bxs.cumt.edu.cn/challenge/web/ctf0001/param1.php') data = eval(urllib.parse.unquote('%5B%221%22%2C%226%22%2C%222%22%2C%228%22%2C%224%22%2C%222%22%2C%228%22%2C%224%22%2C%229%22%2C%221%22%2C%2210%22%5D')) data = [int(i) for i in data] print(data) sum = 0 for i in range(1, len(data)): for j in range(0, len(data)//2): sum += data[i] * second + data[j] print(sum)
r = s.get(r'http://bxs.cumt.edu.cn/challenge/web/ctf0001/param2.php?param={}'.format(sum)) print(json.loads(r.text)['f'].encode('utf-8').decode('unicode_escape'))
import gmpy2, binascii from Crypto.Util.number import bytes_to_long
#with open(r'EasyRSAFile/cumtflag.enc', 'rb')as f: # b = f.read() #print(b) b = b'\x10\xa2\x1d\xd5\x90\xb1\x11\xf1-\xd0\x1d\xa6fs$v\x94\xd3\xd3[\xfd\xa4\xa4\xff\x9a\xafg#\xbf*\xbf\x84'
c = bytes_to_long(b) print('c:', c)
n = 0xC2636AE5C3D8E43FFB97AB09028F1AAC6C0BF6CD3D70EBCA281BFFE97FBE30DD p = 275127860351348928173285174381581152299 q = 319576316814478949870590164193048041239
phi = (p-1)*(q-1) e = 65537 d = gmpy2.invert(e, phi) m = pow(c, d, n)
''' D:\计算机\CTF\工具\MISC\工具包\RSA题目\yafu>yafu-x64.exe factor(0xC2636AE5C3D8E43FFB97AB09028F1AAC6C0BF6CD3D70EBCA281BFFE97FBE30DD) fac: factoring 87924348264132406875276140514499937145050893665602592992418171647042491658461 fac: using pretesting plan: normal fac: no tune info: using qs/gnfs crossover of 95 digits starting SIQS on c77: 87924348264132406875276140514499937145050893665602592992418171647042491658461 ==== sieving in progress (1 thread): 36224 relations needed ==== ==== Press ctrl-c to abort and save state ==== 36279 rels found: 17962 full + 18317 from 193516 partial, (3464.68 rels/sec) SIQS elapsed time = 61.9747 seconds. Total factoring time = 61.9917 seconds ***factors found*** P39 = 275127860351348928173285174381581152299 P39 = 319576316814478949870590164193048041239 ans = 1 D:\计算机\CTF\工具\MISC\工具包\RSA题目\yafu> '''