Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/egorsmkv/fail2ban-scripts
This is a simple python code to get the list of banned IP addresses from Fail2ban
https://github.com/egorsmkv/fail2ban-scripts
Last synced: 25 days ago
JSON representation
This is a simple python code to get the list of banned IP addresses from Fail2ban
- Host: GitHub
- URL: https://github.com/egorsmkv/fail2ban-scripts
- Owner: egorsmkv
- License: other
- Created: 2021-08-30T15:45:19.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2021-08-30T20:05:02.000Z (about 3 years ago)
- Last Synced: 2023-03-05T22:54:55.750Z (over 1 year ago)
- Language: Python
- Size: 8.79 KB
- Stars: 9
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Fail2ban Scripts
## Usage `banned_list.py`
This script tries to get the banned list of IP addresses by Fail2ban for the service `freeswitch`.
You can modify the service name if you want to.
```bash
python ./banned_list.py freeswitch
```In the response you will get JSON output with the following (data can be different, of course):
```json
{"currently_banned": 11, "total_banned": 15, "banned_ips": ["185.108.106.105", "193.46.255.195", "193.46.255.214", "196.196.203.86", "52.232.132.24", "103.145.13.81", "23.148.145.210", "103.145.13.247", "141.98.10.188", "45.34.5.54", "40.86.206.158"]}
```## Usage `unban.py`
This script tries to unban an IP address.
You can modify the IP address if you want to.
```bash
python ./unban.py 185.108.106.105
```In the response you will get JSON output with the following (data can be different, of course):
```json
{"success": true}
```or this (if the IP address is incorrect):
```json
{"error": true, "reason": "it seems IP does not exist"}
```