Skip to content

Commit 0073188

Browse files
committed
fixes to thug, domain visualizer and goresym
1 parent e94bd79 commit 0073188

4 files changed

Lines changed: 18 additions & 14 deletions

File tree

api_app/analyzers_manager/file_analyzers/goresym.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,19 @@ def run(self):
4949
)
5050
result = self._docker_run(req_data, req_files, analyzer_name=self.analyzer_name)
5151
if "error" in result:
52-
er = (
53-
"Failed to parse file: failed to read pclntab: failed to locate pclntab"
54-
)
55-
if result["error"] == er:
56-
logger.warning(f"Not a GO-compiled file: {result['error']}")
57-
return f"Not a Go-compiled file: {result['error']}"
52+
# the error message may change based on the version of the program
53+
partial_error_keywords = ["failed", "no"]
54+
found_negative_clause = False
55+
if "pclntab" in result["error"]:
56+
for partial_error_keyword in partial_error_keywords:
57+
if partial_error_keyword in result["error"]:
58+
found_negative_clause = True
59+
break
60+
if found_negative_clause:
61+
message = f"Not a GO-compiled file: {result['error']}"
62+
logger.warning(message)
63+
self.report.errors.append(message)
64+
raise AnalyzerRunException(message)
5865
raise AnalyzerRunException(result["error"])
5966
return result
6067

api_app/analyzers_manager/observable_analyzers/thug_url.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,16 @@ class ThugUrl(ObservableAnalyzer, DockerBasedAnalyzer):
2323

2424
def _thug_args_builder(self):
2525
user_agent = self.user_agent
26-
if not user_agent:
27-
user_agent = (
28-
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 "
29-
"(KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36 Edg/131.0.2903.86"
30-
)
3126
dom_events = self.dom_events
3227
use_proxy = self.use_proxy
3328
proxy = self.proxy
3429
enable_awis = self.enable_awis
3530
enable_img_proc = self.enable_image_processing_analysis
3631
# make request arguments
3732
# analysis timeout is set to 5 minutes
38-
args = ["-T", "300", "-u", str(user_agent)]
33+
args = ["-T", "300"]
34+
if user_agent:
35+
args.extend(["-u", str(user_agent)])
3936
if dom_events:
4037
args.extend(["-e", str(dom_events)])
4138
if use_proxy and proxy:
@@ -53,7 +50,6 @@ def run(self):
5350
tmp_dir = secrets.token_hex(4)
5451
tmp_dir_full_path = "/opt/deploy/thug" + tmp_dir
5552
# make request data
56-
# the option -n is bugged and does not work https://github.com/intelowlproject/IntelOwl/issues/2656
5753
args.extend(["-n", tmp_dir_full_path, self.observable_name])
5854

5955
req_data = {

api_app/visualizers_manager/visualizers/domain_reputation_services.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ def run(self) -> List[Dict]:
238238
third_level_elements.append(
239239
self.Bool(
240240
value=printable_analyzer_name,
241-
disable=not analyzer_report.report["malicious"],
241+
disable=not analyzer_report.report.get("malicious"),
242242
)
243243
)
244244

integrations/thug/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# This base image is the one currently (02/2025) updated by the maintainer
22
# but it does not support ARM
3+
# CAREFUL! This is still bugged and does not provide analysis.json
34
FROM thughoneyclient/thug:v6.12
45

56
USER root

0 commit comments

Comments
 (0)