Skip to content

Commit 182f52f

Browse files
committed
fix: [correlation] add missing correlations
1 parent 91d6ccc commit 182f52f

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

bin/lib/correlations_engine.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,25 +43,25 @@
4343
CORRELATION_TYPES_BY_OBJ = {
4444
"author": ["pdf"],
4545
"barcode": ["chat", "cve", "cryptocurrency", "decoded", "domain", "image", "message", "screenshot"],
46-
"chat": ["barcode", "chat-subchannel", "chat-thread", "cryptocurrency", "cve", "decoded", "domain", "file-name", "image", "message", "ocr", "pdf", "pgp", "user-account"],
46+
"chat": ["barcode", "chat-subchannel", "chat-thread", "cryptocurrency", "cve", "decoded", "domain", "file-name", "image", "message", "ocr", "pdf", "pgp", "qrcode", "user-account"],
4747
"chat-subchannel": ["chat", "chat-thread", "image", "message", "ocr", "user-account"],
4848
"chat-thread": ["chat", "chat-subchannel", "image", "message", "ocr", "user-account"],
4949
"cookie-name": ["domain"],
5050
"cryptocurrency": ["barcode", "chat", "domain", "item", "message", "ocr", "qrcode"],
5151
"cve": ["barcode", "chat", "domain", "item", "message", "ocr", "qrcode"],
5252
"decoded": ["barcode", "chat", "domain", "item", "message", "ocr", "qrcode"],
53-
"domain": ["barcode", "chat", "cve", "cookie-name", "cryptocurrency", "dom-hash", "decoded", "etag", "favicon", "gtracker", "hhhash", "item", "mail", "message", "pgp", "screenshot", "ssh-key", "title", "username"],
53+
"domain": ["barcode", "chat", "cve", "cookie-name", "cryptocurrency", "dom-hash", "decoded", "etag", "favicon", "gtracker", "hhhash", "item", "mail", "message", "pgp", "qrcode", "screenshot", "ssh-key", "title", "username"],
5454
"dom-hash": ["domain", "item"],
5555
"etag": ["domain"],
56-
"favicon": ["domain", "pdf", "item"], # TODO Decoded
56+
"favicon": ["domain", "item"], # TODO Decoded
5757
"file-name": ["chat", "item", "message", "pdf"],
5858
"gtracker": ["domain", "item"],
5959
"hhhash": ["domain"],
6060
"image": ["barcode", "chat", "chat-subchannel", "chat-thread", "message", "ocr", "qrcode", "user-account"], # TODO subchannel + threads ????
6161
"ip": ["ssh-key"],
6262
"item": ["cve", "cryptocurrency", "decoded", "domain", "dom-hash", "favicon", "file-name", "gtracker", "mail", "message", "pdf", "pgp", "screenshot", "title", "username"], # chat ???
6363
"mail": ["domain", "item", "message"], # chat ??
64-
"message": ["barcode", "chat", "chat-subchannel", "chat-thread", "cve", "cryptocurrency", "decoded", "domain", "file-name", "image", "item", "mail", "ocr", "pdf", "pgp", "user-account"],
64+
"message": ["barcode", "chat", "chat-subchannel", "chat-thread", "cve", "cryptocurrency", "decoded", "domain", "file-name", "image", "item", "mail", "ocr", "pdf", "pgp", "qrcode", "user-account", "username"],
6565
"ocr": ["chat", "chat-subchannel", "chat-thread", "cve", "cryptocurrency", "decoded", "image", "message", "pgp", "user-account"],
6666
"pdf": ["author", "chat", "file-name", "item", "message"],
6767
"pgp": ["chat", "domain", "item", "message", "ocr"],
@@ -73,6 +73,14 @@
7373
"username": ["domain", "item", "message", "user-account"],
7474
}
7575

76+
def debug_correlation_asymmetries():
77+
missing = []
78+
for k, values in CORRELATION_TYPES_BY_OBJ.items():
79+
for v in values:
80+
if k not in CORRELATION_TYPES_BY_OBJ.get(v, []):
81+
missing.append((k, v))
82+
return missing
83+
7684
def get_obj_correl_types(obj_type):
7785
return CORRELATION_TYPES_BY_OBJ.get(obj_type)
7886

@@ -263,5 +271,5 @@ def _get_correlations_graph_node(links, nodes, meta, obj_type, subtype, obj_id,
263271

264272

265273
if __name__ == '__main__':
266-
r = get_obj_one_depth_correlations('item', '', '', {'domain'}, intermediate_types=set(), end='.onion')
274+
r = debug_correlation_asymmetries()
267275
print(r)

0 commit comments

Comments
 (0)