@@ -17,7 +17,7 @@ def map_protocol_to_legba_plugin_name(common_protocol_name: str) -> str:
1717
1818class legba (BaseModule ):
1919 watched_events = ["PROTOCOL" ]
20- produced_events = ["VULNERABILITY " ]
20+ produced_events = ["FINDING " ]
2121 flags = ["active" , "aggressive" , "deadly" ]
2222 per_hostport_only = True
2323 meta = {
@@ -149,8 +149,8 @@ async def handle_event(self, event):
149149
150150 await self .run_process (command )
151151
152- async for new_vuln_event in self .parse_output (output_path , event ):
153- await self .emit_event (new_vuln_event )
152+ async for finding_event in self .parse_output (output_path , event ):
153+ await self .emit_event (finding_event )
154154
155155 async def parse_output (self , output_filepath , event ):
156156 protocol = event .data ["protocol" ].lower ()
@@ -177,10 +177,16 @@ async def parse_output(self, output_filepath, event):
177177 self .warning (f"Failed to parse Legba output ({ line } ), using raw output instead: { e } " )
178178 message_addition = f"raw output: { line } "
179179
180- yield self .create_vuln_event (
181- "CRITICAL" ,
182- f"Valid { protocol } credentials found - { message_addition } " ,
183- event ,
180+ yield self .make_event (
181+ {
182+ "severity" : "CRITICAL" ,
183+ "confidence" : "CONFIRMED" ,
184+ "host" : str (event .host ),
185+ "port" : str (event .port ),
186+ "description" : f"Valid { protocol } credentials found - { message_addition } " ,
187+ },
188+ "FINDING" ,
189+ parent = event ,
184190 )
185191 except FileNotFoundError :
186192 self .info (
@@ -264,18 +270,3 @@ async def construct_command(self, host, port, protocol):
264270 cmd += ["--rate-limit" , self .config .rate_limit , "--concurrency" , self .config .concurrency ]
265271
266272 return cmd , output_path
267-
268- def create_vuln_event (self , severity , description , source_event ):
269- host = str (source_event .host )
270- port = int (source_event .port )
271-
272- return self .make_event (
273- {
274- "severity" : severity ,
275- "host" : host ,
276- "port" : port ,
277- "description" : description ,
278- },
279- "VULNERABILITY" ,
280- source_event ,
281- )
0 commit comments