示例#1
0
def init():
    global r, cnt
    cnt = 0
    # r = uio.spawn('./main', encoding7None)
    # r = uio.local(5454, encoding=None)
    # r = uio.tcp('18.207.3.48', 5454, encoding=None)
    # r = uio.tcp('54.234.79.19', 5454, encoding=None)
    # r = uio.tcp('127.0.0.1', 5454, encoding=None)
    # r = uio.tcp('127.0.0.1', 5459, encoding=None)
    r = uio.tcp('3.231.33.173', 5454, encoding=None)
示例#2
0
文件: solve.py 项目: ZIllR0/ctf-1
def check(tag):
    tok = copy.copy(token)
    tok['tag'] = tag.hex
    r = uio.tcp('200.136.252.51', 5555)
    with r.timeout(5) as ti:
        res = r.line('2').after('Token: ').line(str(tok)).until('.InvalidTag')
        print(tag, res)
    r.close()
    if ti.safe:
        return None
    return tag
示例#3
0
from test import genplain, printplain, toint, hexx
from firstblood.all import uio
import string

r = uio.tcp('34.92.185.118', 10001)

suffix = r.after('XXXX+').until(')')
target = r.after('= ').line().strip().hexd

print('POW')
print(suffix)
print(target)

for p in (string.ascii_letters + string.digits).product(4):
    digest = (p + suffix).sha256
    if digest == target:
        print(p)
        break

r.line(p)

print('pts:')
plain = genplain()
printplain(plain)
print('')

print('cts:')
for pt1, pt2 in plain:
    pt1 = bytes(pt1)
    pt2 = bytes(pt2)
    r.line(pt1.hexe)
示例#4
0
文件: solve.py 项目: ZIllR0/ctf-1
def conn():
    global r, rawenc, flagenc, off1, off2, cnt, key
    # r = uio.spawn('python3 -u vuln.py')
    r = uio.tcp('195.201.131.58', 3250)
    flagenc = r.line().hexd
示例#5
0
文件: solve.py 项目: ZIllR0/ctf-1
import ast
import copy
import multiprocessing as mp
from firstblood.all import uio

r = uio.tcp('200.136.252.51', 5555)
# r = uio.spawn('python2 -u gcm.py 2>&1')

token = r.line('1').line('abc').line('abc').after('token:\n').line()
token = ast.literal_eval(token)
r.close()

enc = token['enc'].hexd
enc = enc[:30] + enc[30:31].xor(b'N').xor(b'Y') + enc[31:]
token['enc'] = enc.hexe


def check(tag):
    tok = copy.copy(token)
    tok['tag'] = tag.hex
    r = uio.tcp('200.136.252.51', 5555)
    with r.timeout(5) as ti:
        res = r.line('2').after('Token: ').line(str(tok)).until('.InvalidTag')
        print(tag, res)
    r.close()
    if ti.safe:
        return None
    return tag


pool = mp.Pool(32)