A lightweight Bash utility for scanning IP CIDR ranges, identifying hosts with ports 80 (HTTP) and 443 (HTTPS) open, and recording those that respond with HTTP 403.
This tool is designed for infrastructure audits, CDN/IP range analysis, and security research where quick HTTPS reachability and response-code filtering is required.
- 🚀 High‑performance scanning using masscan
- 🔐 HTTPS validation using curl
- 📄 CSV output for easy post‑processing
- 🧾 Comment‑aware CIDR input file
- ⚙️ Simple, dependency‑light Bash script
- Linux system
masscancurl- Root or sudo access (required by masscan)
# Debian / Ubuntu
sudo apt update && sudo apt install -y masscan curl
# RHEL / CentOS
sudo yum install -y masscan curlCreate a text file (for example cidrs.txt) with one CIDR per line:
# Example CIDRs
192.168.1.0/24
10.0.0.0/16
172.16.5.10/32
- Lines starting with
#are ignored - IPv4 CIDRs only
sudo bash check_ips.sh cidrs.txt- Terminal: live output of IPs returning HTTP 403
- result.csv: CSV file with a single column:
ip
1.2.3.4
5.6.7.8The file is created (or overwritten) in the current working directory.
- masscan scans all provided CIDRs for ports
80and443with a controlled rate - IPs with either port open are extracted
- Each IP is queried via HTTP and HTTPS concurrently using
curl- TLS errors are ignored
- Timeouts are enforced
- Hosts returning HTTP 403 are saved to
result.csv
You can tune the following parameters directly inside check_ips.sh:
| Setting | Default | Description |
|---|---|---|
MASSCAN_RATE |
1000 |
masscan packets per second |
CURL_CONNECT_TIMEOUT |
3 |
curl connection timeout (seconds) |
CURL_MAX_TIME |
5 |
curl max request time (seconds) |
WORKERS |
50 |
number of parallel curl workers |
-p |
80,443 |
ports to scan |
- CDN / WAF IP range validation
- Cloud provider IP inspection
- Security research and filtering
- HTTPS endpoint discovery
Unauthorized scanning may violate laws, provider policies, or acceptable‑use rules.
Licensed under the GNU General Public License v3.0.
See LICENSE for details.
Pull requests are welcome.
If you plan a significant change, please open an issue first to discuss it.
Mohammad Hassan Roohbakhsh
GitHub: https://github.com/roohbakhsh