S
S
Sergey2018-02-24 18:01:20
Debian
Sergey, 2018-02-24 18:01:20

Filtering incoming (connecting) IP addresses with scripted validation (Linux)?

Good day, dear experts.
I'm racking my brains on one question, but I just can't understand how this can be implemented and whether it is possible at all.
The situation is as follows:
1. OS: Debian 8.7;
2. A game server is running on the server, which accepts incoming connections from clients (players) via TCP and UDP to game ports 12001, 12002, 12003, 12004;
3. Also, there is a simple bash script that uses curl to check the IP for proxying using proxy.mind-media.com/block ;
4. When a player connects to the server, from the player's side, in the game client, when connecting, a window like "Connecting to server" appears and hangs for 5-6 seconds, at this moment, of course, a connection is established with the server part of the game.
The task is to ensure that at the moment the player connects to the server (5-6 seconds), the server somehow checks its IP address for proxying using a script or something else (?). If the person is using a proxy, the connection is dropped and the IP address is added to the block using iptables. If not, the person successfully enters the game.
And as far as I understand, logically, some service or utility should monitor incoming IP addresses on game ports and feed them to the script for verification.
Is it possible to implement such a system? In which direction to study this question?
Thank you for attention.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
ky0, 2018-02-24
@Sviteneg

Make tail-fa connection log or cron periodically grapple the addresses from which you are connected and set the output on your script, in which, if the answer is positive, add the creation of a deny rule for iptables. Instead of sending it directly to the firewall, you can write "bad" IPs to a separate file, for which you can configure a more intelligent parser, for example fail2ban.
If I understand you correctly, of course.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question