(self, ctx, target: str)
| 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 | |
| 61 | if __name__ == "__main__": |
nothing calls this directly
no test coverage detected