A Python automation tool that creates multiple cloud droplets and searches for a specific IP range.
The script repeatedly creates DigitalOcean droplets, checks their assigned public IP addresses and determines if they fall within a desired CIDR range. When a matching IP is found, it is saved and the process stops.
This can be useful for cloud infrastructure experiments, networking research and automated IP allocation testing.
- ☁️ Automatically creates multiple DigitalOcean droplets
- 🔍 Checks whether droplet IPs fall within a target CIDR range
- ⚡ Fully automated droplet creation and deletion loop
- 🧵 Handles multiple droplets simultaneously
- 💾 Saves matching IPs to
live.txt - 🗑 Includes a script to delete droplets automatically
digitalocean-ip-finder/
│
├── create.py
├── delete.py
├── live.txt
└── README.md
- Python 3.7+
Python packages:
python-digitalocean
requests
Install dependencies:
pip install python-digitalocean requests
Create a DigitalOcean API token from your account dashboard.
Set it as an environment variable:
export DO_TOKEN=your_api_token
Update the script to use the token:
token = os.getenv("DO_TOKEN")Or use the script like that with the inbiult API {NOTE: edit the API with your own to use the script directly}
python create.py
The script will:
- Create multiple droplets
- Wait for them to become active
- Check their public IP addresses
- Compare them against the target CIDR range
- Save a matching IP to
live.txt
Example output:
Droplet: droplet-1, IP: 137.184.137.22
Droplet: droplet-2, IP: 137.184.138.10
Found valid IP: 137.184.138.10
To remove droplets created by the script:
python delete.py
Example output:
Successfully deleted droplet id: 123456789
Successfully deleted droplet id: 123456790
- Create droplets using the DigitalOcean API
- Wait until each droplet becomes active
- Retrieve the public IP address
- Check if the IP belongs to a target CIDR range
- Save valid IPs
- Delete droplets and repeat if no match is found
This tool is intended for:
- Cloud automation experiments
- Networking research
- Educational purposes
Always ensure you understand cloud provider pricing and API limits before running automated infrastructure scripts.
Contributions are welcome.
Possible improvements:
- Support for multiple regions
- Faster droplet provisioning
- Automatic droplet tagging
- Multi-threaded droplet management
- Improved error handling
- Proxy / API rate-limit handling
Planned improvements:
- 🌍 Multi-region droplet creation
- ⚡ Parallel droplet creation
- 📊 Real-time droplet status dashboard
- 🔐 Secure environment variable token handling
- 📁 JSON export of results
- 🧠 Automatic CIDR range configuration
- 🧵 Improved concurrency
MIT License