fix(ttp/stix): extract commands from both 'command' and 'command_text' keys
This commit is contained in:
@@ -323,9 +323,9 @@ def build_fleet_bundle(
|
|||||||
except Exception:
|
except Exception:
|
||||||
raw_cmds = []
|
raw_cmds = []
|
||||||
cmds = [
|
cmds = [
|
||||||
str(e.get("command_text", "")).strip()
|
str(e.get("command_text") or e.get("command") or "").strip()
|
||||||
for e in raw_cmds
|
for e in raw_cmds
|
||||||
if isinstance(e, dict) and e.get("command_text")
|
if isinstance(e, dict) and (e.get("command_text") or e.get("command"))
|
||||||
]
|
]
|
||||||
|
|
||||||
intel = row.get("threat_intel")
|
intel = row.get("threat_intel")
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ class AttackerActivityMixin(_MixinBase):
|
|||||||
seen: set[str] = set()
|
seen: set[str] = set()
|
||||||
out: list[str] = []
|
out: list[str] = []
|
||||||
for entry in commands:
|
for entry in commands:
|
||||||
text = str(entry.get("command_text", "")).strip()
|
text = str(entry.get("command_text") or entry.get("command") or "").strip()
|
||||||
if text and text not in seen:
|
if text and text not in seen:
|
||||||
seen.add(text)
|
seen.add(text)
|
||||||
out.append(text)
|
out.append(text)
|
||||||
|
|||||||
Reference in New Issue
Block a user