MCPcopy Create free account
hub / github.com/blacklanternsecurity/bbot / scan

Method scan

examples/discord_bot.py:38–58  ·  view source on GitHub ↗
(self, ctx, target: str)

Source from the content-addressed store, hash-verified

36
37 @commands.command(name="scan", description="Scan a target with BBOT.")
38 async def scan(self, ctx, target: str):
39 if self.current_scan is not None:
40 self.current_scan.stop()
41 await ctx.send(f"Starting scan against {target}.")
42
43 # creates scan instance
44 self.current_scan = Scanner(target, flags="subdomain-enum")
45 discord_module = Discord(self.current_scan)
46
47 seen = set()
48 num_events = 0
49 # start scan and iterate through results
50 async for event in self.current_scan.async_start():
51 if hash(event) in seen:
52 continue
53 seen.add(hash(event))
54 await ctx.send(discord_module.format_message(event))
55 num_events += 1
56
57 await ctx.send(f"Finished scan against {target}. {num_events:,} results.")
58 self.current_scan = None
59
60
61if __name__ == "__main__":

Callers

nothing calls this directly

Calls 8

ScannerClass · 0.90
DiscordClass · 0.90
setFunction · 0.85
stopMethod · 0.80
sendMethod · 0.80
async_startMethod · 0.80
addMethod · 0.45
format_messageMethod · 0.45

Tested by

no test coverage detected