friendly-bits / geoip-shell Goto Github PK
View Code? Open in Web Editor NEWUser-friendly and flexible geoip blocker for Linux
License: GNU General Public License v3.0
User-friendly and flexible geoip blocker for Linux
License: GNU General Public License v3.0
Kindly evaluate and see if you can support the free list from IP2Location.com.
I have run the setup script with no issues on a Debian 12 Azure VM but run into the issue there is no internet connectivity, please can you advise?
Hi,
Yesterday I installed it to test on a VPS under Ubuntu.
You did a great job!
This morning I wanted to check if the cron went well and I got this error:
cat /var/log/syslog | grep geoip-shell
Mar 7 04:15:01 ivozprovider CRON[346770]: (root) CMD ("/usr/bin/geoip-shell-run.sh" update -a 1>/dev/null 2>/dev/null # geoip-shell-autoupdate)
Mar 7 04:15:01 ivozprovider geoip-shell-run.sh: Error: neither nftables nor iptables found.
Thanks again for your work!!
geoip-shell status -v
Geoip blocking status report:
Geoip blocking mode: whitelist
Ip lists source: ripe
Country codes in the whitelist: FR BE IT ES ✔
IP families in firewall rules: ipv4 ipv6 ✔
Geoip rules applied to network interfaces: ens3
Protocols:
tcp: Geoip applied to all ports
udp: Geoip applied to all ports
Geoip firewall chain (ipv4): enabled ✔
Whitelist blocking rule (ipv4): ✔
Firewall rules in the GEOIP-SHELL chain (ipv4):
--------------------------------------------------------------------------------------------------------------------------------------------------------------
pkts bytes target prot opt in out source destination
--------------------------------------------------------------------------------------------------------------------------------------------------------------
24677 58M ACCEPT all -- any any anywhere anywhere ctstate RELATED,ESTABLISHED /* geoip-shell_aux_rel-est */
7634 246K ACCEPT all -- any any anywhere anywhere match-set geoip-shell_FR_ipv4 src /* geoip-shell_FR_ipv4 */
0 0 ACCEPT all -- any any anywhere anywhere match-set geoip-shell_BE_ipv4 src /* geoip-shell_BE_ipv4 */
5 252 ACCEPT all -- any any anywhere anywhere match-set geoip-shell_IT_ipv4 src /* geoip-shell_IT_ipv4 */
5 264 ACCEPT all -- any any anywhere anywhere match-set geoip-shell_ES_ipv4 src /* geoip-shell_ES_ipv4 */
23207 1141K DROP all -- any any anywhere anywhere /* geoip-shell_whitelist_block */
Geoip firewall chain (ipv6): enabled ✔
Whitelist blocking rule (ipv6): ✔
Firewall rules in the GEOIP-SHELL chain (ipv6):
--------------------------------------------------------------------------------------------------------------------------------------------------------------
pkts bytes target prot opt in out source destination
--------------------------------------------------------------------------------------------------------------------------------------------------------------
0 0 ACCEPT all any any anywhere anywhere ctstate RELATED,ESTABLISHED /* geoip-shell_aux_rel-est */
44 2816 ACCEPT all any any anywhere anywhere match-set geoip-shell_FR_ipv6 src /* geoip-shell_FR_ipv6 */
0 0 ACCEPT all any any anywhere anywhere match-set geoip-shell_BE_ipv6 src /* geoip-shell_BE_ipv6 */
0 0 ACCEPT all any any anywhere anywhere match-set geoip-shell_IT_ipv6 src /* geoip-shell_IT_ipv6 */
0 0 ACCEPT all any any anywhere anywhere match-set geoip-shell_ES_ipv6 src /* geoip-shell_ES_ipv6 */
456 32568 DROP all any any anywhere anywhere /* geoip-shell_whitelist_block */
Ip ranges count in active geoip sets:
FR: ipv4 - 4490, ipv6 - 1379
BE: ipv4 - 938, ipv6 - 327
IT: ipv4 - 3468, ipv6 - 1042
ES: ipv4 - 3626, ipv6 - 959
Total number of ip ranges: 16229
Cron system service: ✔
Autoupdate cron job: ✔
Autoupdate schedule: '15 4 * * *'
Persistence cron job: ✔
No problems detected.
iptables -L
Chain INPUT (policy DROP)
target prot opt source destination
f2b-nginx-404 all -- anywhere anywhere
f2b-nginx-dos all -- anywhere anywhere
f2b-sshd tcp -- anywhere anywhere multiport dports ssh
f2b-freeswitch-ip all -- anywhere anywhere
f2b-sshd all -- anywhere anywhere
DROP tcp -- anywhere anywhere tcp dpt:5080 STRING match "VaxIPUserAgent" ALGO name bm TO 65535
DROP udp -- anywhere anywhere udp dpt:5080 STRING match "VaxSIPUserAgent" ALGO name bm TO 65535
DROP udp -- anywhere anywhere udp dpt:sip STRING match "VaxIPUserAgent" ALGO name bm TO 65535
DROP tcp -- anywhere anywhere tcp dpt:sip STRING match "VaxSIPUserAgent" ALGO name bm TO 65535
DROP udp -- anywhere anywhere udp dpt:5080 STRING match "friendly-scanner" ALGO name bm TO 65535
DROP udp -- anywhere anywhere udp dpt:sip STRING match "friendly-scanner" ALGO name bm TO 65535
DROP tcp -- anywhere anywhere tcp dpt:5080 STRING match "friendly-scanner" ALGO name bm TO 65535
DROP tcp -- anywhere anywhere tcp dpt:sip STRING match "friendly-scanner" ALGO name bm TO 65535
f2b-freeswitch-ip all -- anywhere anywhere
f2b-sshd all -- anywhere anywhere
f2b-sshd tcp -- anywhere anywhere multiport dports ssh
sip-auth-fail all -- anywhere anywhere
sip-auth-ip all -- anywhere anywhere
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
DROP udp -- anywhere anywhere udp dpts:sip:5091 STRING match "friendly-scanner" ALGO name bm TO 65535 ICASE
DROP tcp -- anywhere anywhere tcp dpts:sip:5091 STRING match "friendly-scanner" ALGO name bm TO 65535 ICASE
DROP udp -- anywhere anywhere udp dpts:sip:5091 STRING match "sipcli/" ALGO name bm TO 65535 ICASE
DROP tcp -- anywhere anywhere tcp dpts:sip:5091 STRING match "sipcli/" ALGO name bm TO 65535 ICASE
DROP udp -- anywhere anywhere udp dpts:sip:5091 STRING match "VaxSIPUserAgent/" ALGO name bm TO 65535 ICASE
DROP tcp -- anywhere anywhere tcp dpts:sip:5091 STRING match "VaxSIPUserAgent/" ALGO name bm TO 65535 ICASE
DROP udp -- anywhere anywhere udp dpts:sip:5091 STRING match "pplsip" ALGO name bm TO 65535 ICASE
DROP tcp -- anywhere anywhere tcp dpts:sip:5091 STRING match "pplsip" ALGO name bm TO 65535 ICASE
DROP udp -- anywhere anywhere udp dpts:sip:5091 STRING match "exec." ALGO name bm TO 65535 ICASE
DROP tcp -- anywhere anywhere tcp dpts:sip:5091 STRING match "exec." ALGO name bm TO 65535 ICASE
DROP udp -- anywhere anywhere udp dpts:sip:5091 STRING match "system " ALGO name bm TO 65535 ICASE
DROP tcp -- anywhere anywhere tcp dpts:sip:5091 STRING match "system " ALGO name bm TO 65535 ICASE
DROP udp -- anywhere anywhere udp dpts:sip:5091 STRING match "multipart/mixed;boundary" ALGO name bm TO 65535 ICASE
DROP tcp -- anywhere anywhere tcp dpts:sip:5091 STRING match "multipart/mixed;boundary" ALGO name bm TO 65535 ICASE
ACCEPT tcp -- anywhere anywhere tcp dpt:ssh
ACCEPT tcp -- anywhere anywhere tcp dpt:http
ACCEPT tcp -- anywhere anywhere tcp dpt:https
ACCEPT tcp -- anywhere anywhere tcp dpt:7443
ACCEPT tcp -- anywhere anywhere tcp dpts:sip:5091
ACCEPT udp -- anywhere anywhere udp dpts:sip:5091
ACCEPT udp -- anywhere anywhere udp dpts:16384:32768
ACCEPT icmp -- anywhere anywhere icmp echo-request
ACCEPT udp -- anywhere anywhere udp dpt:openvpn
Chain FORWARD (policy DROP)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Chain f2b-freeswitch-ip (2 references)
target prot opt source destination
RETURN all -- anywhere anywhere
Chain f2b-nginx-404 (1 references)
target prot opt source destination
RETURN all -- anywhere anywhere
Chain f2b-nginx-dos (1 references)
target prot opt source destination
RETURN all -- anywhere anywhere
Chain f2b-sshd (4 references)
target prot opt source destination
Chain sip-auth-fail (1 references)
target prot opt source destination
Chain sip-auth-ip (1 references)
target prot opt source destination
Hello I was wondering is it possible to build a set for a single state instead of the whole country?
Hi,
I was wondering if it was possible to put by network instead of the country:
ARIN
RIPE
LACNIC
APNIC
AFRINIC
Thanks again for your work!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.