Ejemplo n.º 1
0
def __actinit(mech,paswd):
    mech.open(PLAT)
    
    mech.select_form(nr=0)
    mech["user"] = "******"
    mech["passwd"] = b6d(paswd)
    results = mech.submit().read()
Ejemplo n.º 2
0
def __actinit(mech,paswd):
    mech.open(PLAT)
    
    mech.select_form(nr=0)
    mech["user"] = "******"
    mech["passwd"] = b6d(paswd)
    results = mech.submit().read()
    soup(results)
    print (PLAT+'file/memit/')
Ejemplo n.º 3
0
def s1c6():
    with open('s1c6.txt') as input:
        raw = ''.join([line.strip() for line in input.readlines()])
    raw_bytes = b6d(raw)
    key_size = guess_keys_2(raw_bytes)
    #print 'guess keysize by 2 block is', key_size
    key_size = guess_keys_4(raw_bytes)
    #print 'guess keysize by 4 block is', key_size
    for key_size in (2, 3, 5, 18):
        test_single(raw_bytes, key_size)
Ejemplo n.º 4
0
def __actinit(mech, paswd):
    cj = cookielib.LWPCookieJar()
    mech.set_cookiejar(cj)
    mech.open(PLAT)
    mech.select_form(nr=0)
    mech["user"] = "******"
    mech["passwd"] = b6d(paswd)
    results = mech.submit().read()
    cookies = mech._ua_handlers['_cookies'].cookiejar
    soup(results)
    xsrf = [ck for ck in cookies if ck.name == '_xsrf'][0]
    print (PLAT+STORAGE, xsrf)
    return xsrf.value
Ejemplo n.º 5
0
print("connected")


def readlines(sock, recv_buffer=4096, delim=b'\n'):
    buffer = b''
    data = True
    while data:
        data = sock.recv(recv_buffer)
        buffer += data

        while buffer.find(delim) != -1:
            line, buffer = buffer.split(b'\n', 1)
            yield line
    return


img = b''
for line in readlines(socket):
    print(">", line)
    if b">" not in line:
        img += line
    elif b'<end>' in line:
        print("img", img)
        with open("out.png", "wb") as f:
            f.write(b6d(img))
        subprocess.run(["/usr/bin/img2txt", "out.png"])
        img = b''
        inp = input().encode()
        print("you said inp", inp)
        socket.send(inp)