コード例 #1
0
ファイル: gh0st_decode.py プロジェクト: kcreyts/chopshop
def get_name_and_size(msg, tcp):
    (hsize, lsize) = struct.unpack("<II", msg[:8])
    size = winsizeize(hsize, lsize)
    fname = msg[8:-1]
    if tcp.module_data["savefiles"]:
        tcp.stream_data["fsize"] = size
        tcp.stream_data["fname"] = sanitize_filename(fname)
        chop.prnt(tcp.stream_data["fname"])
        tcp.stream_data["byteswritten"] = 0
    return (fname, size)
コード例 #2
0
def get_name_and_size(msg, tcp):
    (hsize, lsize) = struct.unpack('<II', msg[:8])
    size = winsizeize(hsize, lsize)
    fname = msg[8:-1]
    if tcp.module_data['savefiles']:
        tcp.stream_data['fsize'] = size
        tcp.stream_data['fname'] = sanitize_filename(fname)
        chop.prnt(tcp.stream_data['fname'])
        tcp.stream_data['byteswritten'] = 0
    return (fname, size)
コード例 #3
0
ファイル: gh0st_decode.py プロジェクト: 0rbytal/chopshop
def get_name_and_size(msg, tcp):
    (hsize, lsize) = struct.unpack('<II', msg[:8])
    size = winsizeize(hsize, lsize)
    fname = msg[8:-1]
    if tcp.module_data['savefiles']:
        tcp.stream_data['fsize'] = size
        tcp.stream_data['fname'] = sanitize_filename(fname)
        chop.prnt(tcp.stream_data['fname'])
        tcp.stream_data['byteswritten'] = 0
    return (fname, size)
コード例 #4
0
ファイル: gh0st_decode.py プロジェクト: kcreyts/chopshop
def token_file_list(msg, tcp):
    if len(msg) == 0:
        chop.prnt("TOKEN: FILE LIST (INVALID HANDLE)")
        return
    chop.prnt("TOKEN: FILE LIST")
    chop.prnt("TYPE\tNAME\tSIZE\tWRITE TIME")
    while len(msg) >= 1:
        d = struct.unpack("B", msg[1])[0]
        if d & 0x10:
            d = "DIR"
        else:
            d = "FILE"
        msg = msg[1:]
        null = msg.find("\x00")
        name = msg[:null]
        msg = msg[null + 1 :]
        (hsize, lsize, wtime) = struct.unpack("<IIQ", msg[:16])
        size = winsizeize(hsize, lsize)
        msg = msg[16:]
        chop.prnt("%s\t%s\t%i\t%i" % (d, name, size, wtime))
コード例 #5
0
def token_file_list(msg, tcp):
    if len(msg) == 0:
        chop.prnt("TOKEN: FILE LIST (INVALID HANDLE)")
        return
    chop.prnt("TOKEN: FILE LIST")
    chop.prnt("TYPE\tNAME\tSIZE\tWRITE TIME")
    while len(msg) >= 1:
        d = struct.unpack('B', msg[1])[0]
        if d & 0x10:
            d = "DIR"
        else:
            d = "FILE"
        msg = msg[1:]
        null = msg.find('\x00')
        name = msg[:null]
        msg = msg[null + 1:]
        (hsize, lsize, wtime) = struct.unpack('<IIQ', msg[:16])
        size = winsizeize(hsize, lsize)
        msg = msg[16:]
        chop.prnt("%s\t%s\t%i\t%i" % (d, name, size, wtime))