Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """
- What:
- Monitors a list of domains to ensure they haven't been registered. If you have a company, know a few good domains that could be used to phish your employees but are too cheap to buy them - monitor them. Script uses pushover.net for notifications, because I prefer push notifications over emails.
- Requirements:
- pip install dnspython python-pushover
- Use:
- 1. Update the domains to monitor -> domains = []
- 2. Add your pushover key and app_token in pushover settings
- 3. Run the script.
- """
- import dns.resolver
- import time
- from pushover import init, Client
- # Settings
- domains = []
- found = []
- wait = 10
- logfile = "DomainCanary.log"
- # Pushover Settings
- po_key = ""
- po_token = ""
- def Log(domain):
- log = open(logfile, "a+")
- log.write("Found domain: %s\n" % domain)
- log.close()
- def UpdateLists(domain):
- found.append(domain)
- domains.remove(domain)
- def Notify(domain):
- print("Detected:\t" + domain)
- init(po_token)
- Message = "Phishing domain activated: %s" % domain
- Client(po_key).send_message(Message, title="Domain Canary")
- # filter out previous finds by reviewing log file
- try:
- for domain in domains:
- if domain in open(logfile).read():
- UpdateLists(domain)
- except:
- pass
- while True:
- for domain in domains:
- try:
- answer = dns.resolver.query(domain, "A")
- UpdateLists(domain)
- Log(domain)
- Notify(domain)
- print("Found domains:\t" + str(found))
- except KeyboardInterrupt:
- print("Found domains:\t" + str(found))
- exit()
- except:
- continue
- time.sleep(wait)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement