Last active
September 3, 2024 20:25
-
-
Save Crinfarr/dd38f44ec811befdf0a8a1f053a4a1c4 to your computer and use it in GitHub Desktop.
Revisions
-
Crinfarr revised this gist
Sep 3, 2024 . 1 changed file with 11 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,16 +2,23 @@ hook = ""# YOUR CHANNEL HOOK HERE from discord_webhook import DiscordWebhook, DiscordEmbed import sys wh = DiscordWebhook(hook) for line in sys.stdin: if (line[0:6] != 'banner'): continue print(line) [_, tcudp, port, ip, ts, stype] = line.split(' ')[0:6] banner = ' '.join(line.split(' ')[6:]) if stype == "X509": continue # All HTTPS servers send SSL -> X509 so we only care about one desc = f'{stype} server discovered '+\ f'at {"http://" if stype == "http" else "https://" if stype=="SSL" else ""}{ip}:{port}\n'+\ f'{"cert" if stype == "ssl" else "banner"}:```\n{banner}\n```' print(desc) embed = DiscordEmbed() embed.set_title(f'Discovered open {tcudp} port') embed.set_description(desc) embed.set_timestamp(int(ts)) wh.add_embed(embed) wh.execute(True) -
Crinfarr created this gist
Sep 3, 2024 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ #!/usr/bin/env python3 hook = ""# YOUR CHANNEL HOOK HERE from discord_webhook import DiscordWebhook, DiscordEmbed wh = DiscordWebhook(hook) for line in input(): [_, tcudp, port, ip, ts, stype] = line.split(' ') if stype == "X509": continue # All HTTPS servers send SSL -> X509 so we only care about one banner = ' '.join(line.split(' ')[6:]) embed = DiscordEmbed() embed.set_title(f'Discovered open {tcudp} port') embed.set_description(f'{stype} server discovered at {"http://" if stype == "http" else "https://" if stype=="SSL" else ""}{ip}:{port}. {"cert" if stype == "ssl" else "banner"}:```\n{banner}\n```') embed.set_timestamp(int(ts)) wh.add_embed(embed) wh.execute(True)