This project helps in cybersecurity tasks by scanning IP ranges to identify the real server behind a domain, bypassing reverse proxies like Cloudflare. It matches the domain's title to confirm the correct server.
- Scans IPs in provided CIDR blocks.
- Checks if a specified domain is hosted on each IP.
- Matches a given string in the title of the webpage.
- Uses concurrent threads for faster scanning.
- Outputs results as it finds matches.
- Python 3.6 or higher
- Required Python libraries:
requests
beautifulsoup4
tqdm
You can install these dependencies by running:
pip install requests beautifulsoup4 tqdm
To use the script, run it from the command line with the following syntax:
python scan_domain.py <domain> <title_match> <ip_blocks...>
<domain>
: The domain to search for (e.g.,example.com
).<title_match>
: A partial or full title of the webpage you want to match (e.g.,"Example Title"
).<ip_blocks...>
: One or more IP blocks in CIDR notation (e.g.,192.168.0.0/24 10.0.0.0/24
).
python scan_domain.py example.com "Example Title" 192.168.0.0/24 10.0.0.0/24
This command will:
- Search for the domain
example.com
- Look for the title
"Example Title"
on pages hosted on IPs in the ranges192.168.0.0/24
and10.0.0.0/24
.
Domain example.com found on 192.168.0.10 with matching title: 'Example Title'
Domain example.com found on 10.0.0.5 with matching title: 'Example Title'
- The script takes the CIDR blocks provided and generates all IPs within those ranges.
- For each IP, it makes an HTTP request to
https://<IP>
with the specified domain name as theHost
header. - It checks the title of the page and compares it with the provided string.
- If a match is found, it outputs the IP and the matching title.
- The script uses HTTPS to attempt a connection to each IP but does not verify SSL certificates due to potential security warnings from the IPs being scanned.
- The scanning is done concurrently using threads to speed up the process.
- The script supports scanning large IP ranges efficiently, using multi-threading to check many IPs at once.
This project is licensed under the MIT License - see the LICENSE file for details.
If you'd like to contribute to this project, feel free to fork it and submit a pull request. Any contributions or suggestions are welcome!
- The
requests
library for handling HTTP requests. beautifulsoup4
for parsing and extracting titles from HTML.tqdm
for providing a progress bar.argparse
for handling command-line arguments.