Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Custom Magic for Quarantine #243

Merged
merged 5 commits into from
Jul 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions assemblyline/common/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,11 @@ class ServiceStatus(enum.IntEnum):
'resource/unity': True,
'text/calendar': True,
'text/markdown': True,
'quarantine/ahnlab': True,
'quarantine/avast': True,
'quarantine/avira': True,
'quarantine/mcafee': True,
'quarantine/windowsdefender': True,
'unknown': True,
}

Expand Down
6 changes: 6 additions & 0 deletions assemblyline/common/custom.magic
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,9 @@
>&0 short 0xA1B2 custom: network\tcpdump
# Email
0 string DKIM-Signature: custom: document/email
# Quarantine Files
0 string AhnLab\040Inc.\0402006 custom: quarantine/ahnlab
0 string \055chest\055\040 custom: quarantine/avast
0 string AntiVir\040\Qua custom: quarantine/avira
0 beshort 0x0BAD custom: quarantine/windowsdefender
0 belong 0xDBE8C501 custom: quarantine/windowsdefender
6 changes: 5 additions & 1 deletion assemblyline/common/identify.py
Original file line number Diff line number Diff line change
Expand Up @@ -543,11 +543,15 @@ def ident(buf, length: int, path) -> Dict:
clsid_offset = root_entry_property_offset + 0x50
if len(buf) >= clsid_offset + 16:
clsid = buf[clsid_offset:clsid_offset + 16]
if len(clsid) == 16 and clsid != "\0" * len(clsid):
if len(clsid) == 16 and clsid != b"\0" * len(clsid):
clsid_str = uuid.UUID(bytes_le=clsid)
clsid_str = clsid_str.urn.rsplit(':', 1)[-1].upper()
if clsid_str in OLE_CLSID_GUIDs:
data['type'] = OLE_CLSID_GUIDs[clsid_str]
else:
bup_details_offset = buf[:root_entry_property_offset+0x100].find(u"Details".encode("utf-16-le"))
if -1 != bup_details_offset:
data['type'] = 'quarantine/mcafee'
except Exception:
pass

Expand Down