{"id":20910764,"url":"https://github.com/danielcba/abuseip-to-csv","last_synced_at":"2025-12-28T05:34:16.706Z","repository":{"id":260197702,"uuid":"880593240","full_name":"danielcba/abuseip-to-csv","owner":"danielcba","description":"This Python script uses the AbuseIPDB API to query information about suspicious IP addresses and log the number of abuse reports associated with each IP in a CSV file.","archived":false,"fork":false,"pushed_at":"2025-01-07T04:39:56.000Z","size":46,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-19T15:29:44.505Z","etag":null,"topics":["abuseipdb","csv","python3"],"latest_commit_sha":null,"homepage":"https://www.abuseipdb.com/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/danielcba.png","metadata":{"files":{"readme":"README-EN.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-30T01:55:01.000Z","updated_at":"2025-01-07T04:39:59.000Z","dependencies_parsed_at":"2025-01-01T23:25:30.990Z","dependency_job_id":"53f7a0af-c0a0-4e09-b4f5-a7efc79f2efa","html_url":"https://github.com/danielcba/abuseip-to-csv","commit_stats":null,"previous_names":["danielcba/abuseip-to-csv"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielcba%2Fabuseip-to-csv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielcba%2Fabuseip-to-csv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielcba%2Fabuseip-to-csv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielcba%2Fabuseip-to-csv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danielcba","download_url":"https://codeload.github.com/danielcba/abuseip-to-csv/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243301113,"owners_count":20269286,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["abuseipdb","csv","python3"],"created_at":"2024-11-18T14:17:04.337Z","updated_at":"2025-12-28T05:34:16.673Z","avatar_url":"https://github.com/danielcba.png","language":"Python","readme":"# IP Checker with AbuseIPDB\n\nThis Python script uses the [AbuseIPDB API](https://www.abuseipdb.com) to query information about suspicious IP addresses and log the number of abuse reports associated with each IP in a CSV file.\n\n## Description\n\nThe script reads a text file (`equipos.csv`) containing a list of IP addresses and queries the AbuseIPDB API to get data on the number of abuse reports recorded for each IP in the past 60 days. The results are saved in a CSV file (`resultado.csv`) with the columns:\n- `IP Address`\n- `Number of Reports`\n\nThis script is ideal for system administrators and security professionals who need to analyze potentially dangerous IP addresses and determine their abuse report history.\n\n## Requirements\n\n- Python 3.x\n- [requests](https://docs.python-requests.org/en/master/) library to make HTTP requests\n- [csv](https://docs.python.org/3/library/csv.html) library (included in Python) to handle CSV files\n\nYou can install `requests` if you don’t have it by running:\n```bash\npip install requests\n```\n\n## Setup\n\n1. Clone this repository:\n   ```bash\n    git clone https://github.com/danielcba/abuseip-to-csv.git\n    cd abuseip-to-csv\n   ```\n\n2. Replace the API key in the Python file with your own AbuseIPDB API key. You can obtain an API key by registering at [AbuseIPDB](https://www.abuseipdb.com/register).\n\n3. Make sure you have a `equipos.txt` file in the same directory with the following structure:\n   ```\n   addresses\n   192.168.1.1\n   203.0.113.5\n   ...\n   ```\n\n## Usage\n\nTo run the script and generate the `resultado.csv` file, use the following command:\n```bash\npython abuseip-to-csv.py\n```\n\n## Code Explanation\n\n1. **API Connection**: The script uses the API key and AbuseIPDB URL to authenticate the request and access IP information.\n\n2. **Query Parameters**:\n   - `ipAddress`: IP address to be queried.\n   - `maxAgeInDays`: Limits the reports to the last 60 days to obtain recent data (adjustable value).\n\n3. **Response Handling**: The script processes the JSON response, extracts the number of abuse reports associated with the IP, and logs them in a CSV file. If there is an error in the request or response, the script displays a message indicating the issue.\n\n## Example Output\n\nThe output of the script is a `resultado.csv` file with the following format:\n```csv\nDirección IP, Cantidad de Reportes\n192.168.1.1, 15\n203.0.113.5, 42\n...\n```\n\nAdditionally, the script displays a message on the console like:\n```\nPara la IP 192.168.1.1, tiene estos reportes: 15\nPara la IP 203.0.113.5, tiene estos reportes: 42\n```\n\n## AbuseIPDB Documentation\n\n[AbuseIPDB](https://www.abuseipdb.com) is a collaborative database that collects reports of malicious IP address activities, helping identify and block suspicious IPs. The AbuseIPDB API allows various queries, such as:\n- **IP Check** (`check`): queries an IP's report history.\n- **Blacklist** (`blacklist`): provides a list of IPs in the database with high report counts.\n- **IP Reports** (`report`): lets users report a specific IP if they have detected suspicious activity.\n\nFor more information, see the [official AbuseIPDB API documentation](https://docs.abuseipdb.com/#introduction).\n\n## Security Notes\n\nDo not include your API key directly in the code if you plan to share the repository publicly. Instead, use environment variables to handle API keys securely:\n```python\nimport os\napi_key = os.getenv(\"ABUSEIPDB_API_KEY\")\n```\n\n## License\n\nThis project is licensed under the MIT License. See the `LICENSE` file for more details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielcba%2Fabuseip-to-csv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanielcba%2Fabuseip-to-csv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielcba%2Fabuseip-to-csv/lists"}