@@ -67,12 +67,20 @@ def _download_signatures(cls) -> None:
6767 for signature in signatures_list :
6868 try :
6969 process = subprocess .run (
70- ["wget" , "-O" , SIGNATURE_LOCATION , signature ["download_url" ]]
70+ [
71+ "/usr/bin/wget" ,
72+ "-O" ,
73+ SIGNATURE_LOCATION ,
74+ signature ["download_url" ],
75+ ],
76+ check = True ,
7177 )
78+
7279 except subprocess .CalledProcessError as e :
80+ stderr = process .stderr
7381 logger .error (f"Failed to download signature: { e } " )
7482 raise AnalyzerRunException (
75- f"Failed to update signatures due to error: { process . stderr } "
83+ f"Failed to update signatures due to error: { stderr } "
7684 )
7785 logger .info ("Successfully updated singatures" )
7886
@@ -109,7 +117,7 @@ def run(self):
109117 "Couldn't update capa rules or signatures successfully"
110118 )
111119
112- command : list [str ] = ["capa" , "--quiet" , "--json" ]
120+ command : list [str ] = ["/usr/local/bin/ capa" , "--quiet" , "--json" ]
113121 shell_code_arch = "sc64" if self .arch == "64" else "sc32"
114122 if self .shellcode :
115123 command .append ("-f" )
@@ -128,17 +136,21 @@ def run(self):
128136 logger .info (f"Starting CAPA analysis for { self .filename } " )
129137
130138 process : subprocess .CompletedProcess = subprocess .run (
131- command , capture_output = True , text = True , timeout = self .timeout
139+ command ,
140+ capture_output = True ,
141+ text = True ,
142+ timeout = self .timeout ,
143+ check = True ,
132144 )
133145
134- process .check_returncode ()
135146 result = json .loads (process .stdout )
136147 logger .info ("CAPA analysis successfully completed" )
137148
138149 except subprocess .CalledProcessError as e :
150+ stderr = process .stderr
139151 logger .info (f"Capa Info failed to run for { self .filename } with command { e } " )
140152 raise AnalyzerRunException (
141- f" Analyzer for { self .filename } failed with error: { process . stderr } "
153+ f" Analyzer for { self .filename } failed with error: { stderr } "
142154 )
143155
144156 return result
0 commit comments