Skip to content

Commit

Permalink
Merge pull request #1868 from blacklanternsecurity/yara-handle-bad-chars
Browse files Browse the repository at this point in the history
handle bad chars in matched data
  • Loading branch information
liquidsec authored Oct 18, 2024
2 parents 0a20c13 + 7595ff7 commit e7e5c6a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bbot/modules/internal/excavate.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,9 @@ async def preprocess(self, r, event, discovery_context):
yara_rule_settings = YaraRuleSettings(description, tags, emit_match)
yara_results = {}
for h in r.strings:
yara_results[h.identifier.lstrip("$")] = sorted(set([i.matched_data.decode("utf-8") for i in h.instances]))
yara_results[h.identifier.lstrip("$")] = sorted(
set([i.matched_data.decode("utf-8", errors="ignore") for i in h.instances])
)
await self.process(yara_results, event, yara_rule_settings, discovery_context)

async def process(self, yara_results, event, yara_rule_settings, discovery_context):
Expand Down

0 comments on commit e7e5c6a

Please sign in to comment.