This README.md provides an overview of two powerful IP tracking scripts:
- Iran IP List Script (
getip.sh) - Focuses on fetching Iranian IPs based on country code or ASN. - IPFinderX (
ipfinderx.sh) - An advanced version that allows users to fetch IPs based on country, ASN, or even company names (e.g., YouTube, Facebook, Telegram).
- Fetches ASN numbers for Iran.
- Downloads BGP route data.
- Filters Iranian ISP-related IPs.
- Summarizes them using
cidr_merge. - Supports automatic updates.
- Fetches ASN numbers for any country.
- Allows searching for ASN based on company name (e.g., Google, YouTube, Facebook).
- Extracts IP ranges for a specific ASN or country.
- Summarizes IPs using
cidr_merge. - Fully automated with interactive user input.
Before running the scripts, ensure you have the following installed:
- Git (
sudo apt install gitorsudo yum install git) - Python 3 (
python3 --version) - Pip & Netaddr library
sudo apt install python3-pip -y pip3 install netaddr
- Curl & Wget (for fetching ASN data)
sudo apt install curl wget -y
- Install Git Bash from git-scm.com
- Install Python 3 from python.org
- Install
netaddr:pip install netaddr
- Use Git Bash or WSL for execution.
git clone https://github.com/sadeghmolaei/IP-Tracker-ASN-Lookup.git
cd ipfinderxchmod +x getip.sh
chmod +x ipfinderx.sh./getip.sh./ipfinderx.shWhen prompted, enter one of the following:
- Country Code (e.g.,
US,IR,DE) - ASN Number (e.g.,
AS12880) - Company Name (e.g.,
Google,Facebook,Telegram)
The script will process and extract the relevant IP ranges.
After execution, the final output will be saved in the files/ directory:
- Full List:
files/final-ip-<timestamp> - Summarized CIDR List:
files/final-summarized-ip-<timestamp>
- Fetches Iran-specific ASNs.
- Downloads latest BGP data.
- Extracts IP addresses related to Iran.
- Summarizes IPs using Python.
- π΄ Supports country-based lookups (e.g.,
IRfor Iran,USfor the USA). - π Supports ASN-based lookups (e.g.,
AS12880). - π’ Supports company-based lookups (e.g.,
Google,Facebook,YouTube). - π§ Intelligent detection: Recognizes if the user input is a country, ASN, or company name.
- π‘ Fetches and processes IPs dynamically.
- π Optimized for speed & accuracy.
To automatically update the IP list every 24 hours, add this to crontab -e:
0 2 * * * /path/to/ipfinderx.sh > /dev/null 2>&1We welcome contributions! If you want to improve the script:
- Fork the repository on GitHub.
- Make changes & commit:
git add . git commit -m "Improved error handling" git push origin main
- Submit a Pull Request (PR).
This project is open-source under the GNU General Public License v3.0.
If you encounter any issues, feel free to open an issue on GitHub or contribute to improving the script.
Now you're all set! π Happy IP filtering!