''' n = 8250871280281573979365095715711359115372504458973444367083195431861307534563246537364248104106494598081988216584432003199198805753721448450911308558041115465900179230798939615583517756265557814710419157462721793864532239042758808298575522666358352726060578194045804198551989679722201244547561044646931280001 e = 3 c = 945272793717722090962030960824180726576357481511799904903841312265308706852971155205003971821843069272938250385935597609059700446530436381124650731751982419593070224310399320617914955227288662661442416421725698368791013785074809691867988444306279231013360024747585261790352627234450209996422862329513284149 '''
import gmpy2 from Crypto.Util.number import long_to_bytes
n = 8250871280281573979365095715711359115372504458973444367083195431861307534563246537364248104106494598081988216584432003199198805753721448450911308558041115465900179230798939615583517756265557814710419157462721793864532239042758808298575522666358352726060578194045804198551989679722201244547561044646931280001 e = 3 c = 945272793717722090962030960824180726576357481511799904903841312265308706852971155205003971821843069272938250385935597609059700446530436381124650731751982419593070224310399320617914955227288662661442416421725698368791013785074809691867988444306279231013360024747585261790352627234450209996422862329513284149
from pwn import * import string from hashlib import * import itertools from sage.allimport * strs = string.ascii_letters + string.digits PR = PolynomialRing(Zmod(2), name='x') x = PR.gen()
defproof(end,sha): num=4 slist=itertools.permutations(strs,int(num)) for i in slist: i = ''.join(i) if sha256((i + end.decode()).encode()).hexdigest()==sha.decode(): return i
defpoly(s): data = 0 if s[-1] == '1': data = 1 if'x'in s.replace('x^',''): data += x for i inrange(2,15): ifstr(i) in s: data += x^i return data
io = remote('39.107.137.85' ,41366) context.log_level = 'debug' io.recvuntil('sha256(XXXX+') message=io.recvuntil('\n')[:-1] end = message[:16] SHA = message[-64:] io.sendafter('Give me XXXX: ', proof(end,SHA))
defget_password(username): if username=="admin": return admin.secret else: # conn=sqlite3.connect("user.db") # cursor=conn.cursor() # cursor.execute(f"select password from usertable where username='{username}'") # data=cursor.fetchall()[0] # if data: # return data[0] # else: # return None return session.get("password")
@app.route('/balancer', methods=['GET', 'POST']) defflag(): pickle_data=base64.b64decode(request.cookies.get("userdata")) ifb'R'in pickle_data orb"secret"in pickle_data: return"You damm hacker!" os.system("rm -rf *py*") userdata=pickle.loads(pickle_data) if userdata.token!=hash(get_password(userdata.username)): return"Login First" if userdata.username=='admin': return"Welcome admin, here is your next challenge!" return"You're not admin!"
# nginx.vh.default.conf -- docker-openresty # # This file is installed to: # `/etc/nginx/conf.d/default.conf` # # It tracks the `server` section of the upstream OpenResty's `nginx.conf`. # # This config (and any other configs in `etc/nginx/conf.d/`) is loaded by # default by the `include` directive in `/usr/local/openresty/nginx/conf/nginx.conf`. # # See https://github.com/openresty/docker-openresty/blob/master/README.md#nginx-config-files # lua_package_path"/lua-resty-balancer/lib/?.lua;;"; lua_package_cpath"/lua-resty-balancer/?.so;;";