spender-sandbox / cuckoo-modified

Modified edition of cuckoo
392 stars 178 forks source link

'BSON message larger than MAX_MESSAGE_LENGTH' For Non-Content File #483

Open sust4in opened 6 years ago

sust4in commented 6 years ago

Hello people, i cant analyze any of bson logs. i changed the code little and tried to see error. and there is;

File: image

netlog.py line - 78

I dont know why blen variable is really more than max_message_lenght without any content but just 'BSON'

    def read_next_message(self):
        data = self.handler.read(4) --------------- data : b'BSON'
        blen = struct.unpack("I", data)[0] ----------- blen: 1313821506
        if blen > MAX_MESSAGE_LENGTH:
            log.critical("BSON message larger than MAX_MESSAGE_LENGTH, "
                         "stopping handler.")
            return False

debug output:

BSON message larger than MAX_MESSAGE_LENGTH, stopping handler.
BSON message larger than MAX_MESSAGE_LENGTH, stopping handler.

BsonParser decoding problem bad eoo on data[:50] b'\n\xe4\x00\x00\x00\x10I\x00\x00\x00\x00\x00\x02name\x00\x0c\x00\x00\x00process\x00\x02type\x00\x05\x00\x00\x00info\x00\x02'

doomedraven commented 6 years ago

no hash no happens :P

sust4in commented 6 years ago

I dont really understand. all process logs has 'BSON' string on their first 4 chars. after the logs fullfilled, cuckoo logs same errors. Just 'BSON' lenght cant be 1313821506 bits

it can be encode or decode error, something that conflicting with index lenght.

doomedraven commented 6 years ago

can you share sample? it looks like it report with wring package header

sust4in commented 6 years ago

before the example, extra info would be good.

i also found this similar https://github.com/cuckoosandbox/cuckoo/issues/520

doomedraven commented 6 years ago

you need to check how logging working, it start netlogger and send bson data, and you answered your question in second part