コード例 #1
0
from Cloudflare import *
from Notifications import *
from NucleiWrapper import *
from Report import *
from TMOWrapper import *
import sys

if __name__ == '__main__':

    if (len(sys.argv) < 2):
        print("[*] Usage: python3 audit.py your_domain_name.com",
              file=sys.stderr)
        exit(1)
    domain_name = sys.argv[1]
    notify_bot = Notifications()
    notify_bot.send_debug_notification("Starting new subdomain audit at " +
                                       str(datetime.datetime.now()))
    print("[*] Starting SDTKO Audit")
    cloudflare = Cloudflare()
    data = cloudflare.get_cname_domains(domain_name)
    print("[*] Running Nuclei Scanner")
    nuclei_wrapper = NucleiWrapper()
    nuclei_result = nuclei_wrapper.check_takeover(data)
    if len(nuclei_result) == 0:
        print("[*] Nuclei scan completed no results found.")
        notify_bot.send_debug_notification(
            "Nuclei scan completed, no results found.")

    print("[*] Running Takemeon Scanner")
    tmo_wrapper = TMOWrapper()
    tmo_result = tmo_wrapper.check_takeover(data)
コード例 #2
0
ファイル: Pulse.py プロジェクト: lawanfalalu/PulseMonitor
    def __init__(self, nick, email, password, rooms):
        commands = default_commands
        commands.extend([
            CommandUpdate, CommandNotifications, CommandNotify,
            CommandUnnotify, CommandListTags, CommandAddTag, CommandRemoveTag
        ])

        version_hash = self._get_current_hash()

        self._bot_header = r'\[[PulseMonitor]' \
            '(https://github.com/Charcoal-SE/PulseMonitor) ' + \
                version_hash + r'\]'

        bot = bp.Bot(nick, commands, rooms, [], "stackexchange.com", email,
                     password)
        bot.add_alias("Halflife")

        try:
            with open(bot._storage_prefix + 'redunda_key.txt',
                      'r') as file_handle:
                key = file_handle.readlines()[0].rstrip('\n')
            bot.set_redunda_key(key)

            bot.add_file_to_sync({
                "name": bot._storage_prefix + 'tags.json',
                "ispickle": False,
                "at_home": False
            })
            bot.add_file_to_sync({
                "name": bot._storage_prefix + 'notifications.json',
                "ispickle": False,
                "at_home": False
            })
            bot.redunda_init(bot_version=version_hash)
            bot.set_redunda_default_callbacks()
            bot.set_redunda_status(True)

        except IOError as ioerr:
            logging.error(str(ioerr))
            logging.warn("Bot is not integrated with Redunda.")

        bot.set_startup_message(self._bot_header + " started on " +
                                bot._location + ".")
        bot.set_standby_message(self._bot_header + " running on " +
                                bot._location + " shifting to standby.")
        bot.set_failover_message(self._bot_header + " running on " +
                                 bot._location + " received failover.")

        notifications = Notifications(
            rooms, bot._storage_prefix + 'notifications.json')
        tags = TagManager(bot._storage_prefix + 'tags.json')
        bot._command_manager.notifications = notifications
        bot._command_manager.tags = tags

        bot.start()
        bot.add_privilege_type(1, "owner")
        bot.set_room_owner_privs_max()

        roomlist = bot._rooms
        halflife = HalflifeListener(roomlist[0], roomlist, notifications,
                                    bot._command_manager.tags)
        #deep_smoke = DeepSmokeListener(roomlist[0], roomlist, notifications)

        halflife.start()
        #deep_smoke.start()

        while bot.is_alive:
            pass

        halflife.stop()