├── requirements.txt ├── launcher.sh ├── domaindownload.py ├── LICENSE └── README.md /requirements.txt: -------------------------------------------------------------------------------- 1 | requests==2.31.0 2 | -------------------------------------------------------------------------------- /launcher.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #To complete 4 | export keyword="google|amazon" #Keywords to complete 5 | mail="hello@world.com" #Email to complete 6 | 7 | python3 domaindownload.py | mail -s "Domain Alerting $keyword" $mail 8 | -------------------------------------------------------------------------------- /domaindownload.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import base64 4 | import os 5 | import re 6 | import requests 7 | 8 | from datetime import datetime, timedelta 9 | from io import BytesIO 10 | from zipfile import ZipFile 11 | 12 | if 'keyword' not in os.environ: 13 | exit('ERROR: Missing \'keyword\' Environment Variable') 14 | 15 | keywords = re.split(r'[^a-z0-9-]', os.environ['keyword']) 16 | 17 | for i in range(4): 18 | f = (datetime.now() - timedelta(days=i)).strftime('%Y-%m-%d') + '.zip' 19 | try: 20 | r = requests.get(f'https://www.whoisds.com/whois-database/newly-registered-domains/{base64.b64encode(f.encode()).decode()}/nrd') 21 | z = ZipFile(BytesIO(r.content)) 22 | for l in z.open('domain-names.txt').readlines(): 23 | if not re.search('({})'.format('|'.join(keywords)), l.decode()): 24 | continue 25 | print(l.decode().strip()) 26 | break 27 | except: 28 | pass 29 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 pixelbubble 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DomainAlerting 2 | Daily alert when a new domain name is registered and contains your keywords. 3 | 4 | ## Description 5 | DomainAlerting tool allows you to perform two main actions (for educational purposes only): 6 | 7 | - ### Download newly registered domains 8 | ![image](https://user-images.githubusercontent.com/75697623/151710260-353f03a2-1b95-4e64-ba1d-6d611da8805a.png) 9 | 10 | - ### Send automatic email alert 11 | You can setup a wordlist and be alerted by email when you have a match (exemple here with "google|amazon"). 12 | ![image](https://user-images.githubusercontent.com/75697623/151715898-d8354308-4ee0-44c3-a7e5-5236a1e1f168.png) 13 | 14 | ## Prerequisite 15 | 16 | ```bash 17 | apt install mailutils 18 | pip3 install -r requirements.txt 19 | ``` 20 | ## Configuration 21 | Inside the file "launcher.sh", complete: 22 | - Your keywords (#Keywords to complete) 23 | - Your receiver (#Email to complete) 24 | 25 | Then, create a daily crontab job: 26 | ```bash 27 | crontab -e #edit user's crontab 28 | 0 8 * * * /path/launcher.sh #set daily crontab (here at 8 am for example) 29 | ``` 30 | 31 | ## Contributing 32 | Feel free to clone this project. For major changes, please open an issue first to discuss what you would like to change. 33 | 34 | ## License 35 | [MIT](https://choosealicense.com/licenses/mit/) 36 | --------------------------------------------------------------------------------