spender-sandbox / cuckoo-modified

Modified edition of cuckoo
394 stars 178 forks source link

API request for IOCS django error #63

Closed pashashocky closed 8 years ago

pashashocky commented 8 years ago

I was getting a django error for some samples that didnt contact any hosts in:

web/api/views.py:1274 - KeyError exception for the 3 del's web/api/views.py:1299 - KeyError exception for 3 buf asignments

Fixed using a try, maybe there is a more elegant solution to this?

spender-sandbox commented 8 years ago

Can you give me more of the logs and the specific line contents? I'd like to see what keys were a problem.

-Brad

pashashocky commented 8 years ago

I will do on Monday, since I've added try: except: statements, the error never appeared again

doomedraven commented 8 years ago

i had the same problem last week but solved addign some ifs

    if "machine" in data["info"] and isinstance(data["info"]["machine"], dict):
        if data["info"]["machine"].get("manager", ""):
            del data["info"]["machine"]["manager"]
        if data["info"]["machine"].get("label", ""):
            del data["info"]["machine"]["label"]
        if data["info"]["machine"].get("id"):
            del data["info"]["machine"]["id"]
    # Grab target file info
    if "target" in buf.keys():
        data["target"] = buf["target"]
        if data["target"]["category"] == "file":
            if data["target"]["file"].get("path", ""):
                del data["target"]["file"]["path"]
            if data["target"]["file"].get("guest_paths", ""):
                del data["target"]["file"]["guest_paths"]

here is where it located https://github.com/spender-sandbox/cuckoo-modified/blob/master/web/api/views.py#L1331

if that ok, i can push it as PR