(interaction: discord.Interaction, term: str)
| 590 | |
| 591 | @client.tree.command(name="exploitsearch", description="Search for known vulnerabilities using a term.") |
| 592 | async def exploitsearch(interaction: discord.Interaction, term: str): |
| 593 | try: |
| 594 | exploit_search = client.shodan.exploits.search(term) |
| 595 | |
| 596 | if 'matches' in exploit_search and exploit_search['matches']: |
| 597 | top_exploits = exploit_search['matches'][:10] |
| 598 | replies = [] |
| 599 | |
| 600 | for exploit in top_exploits: |
| 601 | description = exploit.get('description', 'No description available.').strip() |
| 602 | source = exploit.get('source', 'Unknown source') |
| 603 | date = exploit.get('date', 'Unknown date') |
| 604 | exploit_type = exploit.get('type', 'Unknown type') |
| 605 | |
| 606 | detailed_info = (f"**Description:** {description}\n" |
| 607 | f"**Source:** {source}\n" |
| 608 | f"**Date:** {date}\n" |
| 609 | f"**Type:** {exploit_type}\n" |
| 610 | f"---") |
| 611 | replies.append(detailed_info) |
| 612 | |
| 613 | message = "\n".join(replies) |
| 614 | await client.send_split_messages(interaction, message) |
| 615 | else: |
| 616 | await interaction.followup.send("No exploits found for that term.") |
| 617 | except shodan.APIError as e: |
| 618 | await handle_errors(interaction, e, "Shodan API Error") |
| 619 | except Exception as e: |
| 620 | await handle_errors(interaction, e) |
| 621 | |
| 622 | @client.tree.command( |
| 623 | name="listtags", |
nothing calls this directly
no test coverage detected