1. Áttekintés1. Overview
- Kliens modul (
SentinelShield.dll, 32 bites) – a játékkal fut, figyeli a folyamatot és a kliensfájlokat. Ha a kliensed Python 2.7-et tartalmaz, ass_python.cppadaptert is a kliensedbe fordítod. - Client module (
SentinelShield.dll, 32 bit) – runs with the game and watches the process and the client files. If your client embeds Python 2.7, you also compile thess_python.cppadapter into it. - Szerver őr (
sentinel-gate) – a játékszervereden fut; csak az igazolt klienseket engedi a játék portjaira, a csalót kidobja és kitiltja. - Server gate (
sentinel-gate) – runs on your game server; only verified clients reach the game ports, cheaters are kicked and banned. - Központ (
sentinelshield.eu) – licenc, vezérlőpult, csalásnapló, bizonyítékok, közös feketelista, letöltések. - Hub (
sentinelshield.eu) – licence, dashboard, cheat log, evidence, shared blacklist, downloads.
A kliens indításkor ECDH P-256 kulcscserét végez az őrrel; az őr a saját, csak nálad lévő kulcsával aláírt kézfogással igazolja magát, utána minden üzenet AES-256-GCM titkosítású. Az őr szívverést vár, és memória-kérdéseket küld a kliens exe és a modul futó kódjáról, ezért egy átírt vagy leállított modul nem tud válaszolni.
On start-up the client performs an ECDH P-256 key exchange with the gate; the gate proves itself with a handshake signed by its own key (which only you have), and every message after that is encrypted with AES-256-GCM. The gate expects heartbeats and sends memory challenges over the running code of the client exe and the module, so a patched or stopped module cannot answer.
2. Követelmények2. Requirements
- 32 bites Windows játékkliens, amelynek a forráskódja nálad van (például Visual Studio 2022).
- A 32-bit Windows game client whose source you own (for example Visual Studio 2022).
- Játékszerver FreeBSD-n (pf) vagy Linuxon (ipset + iptables), root jogosultsággal.
- A game server on FreeBSD (pf) or Linux (ipset + iptables), with root access.
- Python 3.9 vagy újabb (
pymysql,cryptography) és MySQL / MariaDB a szerveren. - Python 3.9 or newer (
pymysql,cryptography) and MySQL / MariaDB on the server. - Egy szabad TCP port az őrnek (alapértelmezés: 10050).
- One free TCP port for the gate (default: 10050).
3. Az őr telepítése3. Installing the gate
Egy paranccsal: a csomag install.sh szkriptje mindent elvégez (Python-csomagok, adatbázis és felhasználó, beállítás, kulcs, szolgáltatás, tűzfalszabály):
With one command: the package's install.sh does everything (Python packages, database and user, settings, key, service, firewall rule):
tar -xzf sentinel-gate-1.2.tar.gz && cd sentinel-gate
sh install.sh --licence ssk_… --game-ports 13000-13099 --exe client.exe
# a tűzfalszabályt kiírja; ha jó, töltsd be / review the rules, then load them:
sh install.sh --licence ssk_… --game-ports 13000-13099 --exe client.exe --apply-firewall
Kézi telepítés lépésenként:
Manual installation step by step:
# FreeBSD (Linux: /opt/sentinel-gate)
mkdir -p /usr/local/sentinel-gate
tar -xzf sentinel-gate-1.0.tar.gz -C /usr/local/sentinel-gate
cd /usr/local/sentinel-gate
pip install -r requirements.txt
mysql < schema.sql # database "sentinel"
cp sentinel-gate.json.sample sentinel-gate.json
python3 sentinel_gate.py keygen # -> gate_public_key.h (for your client)
A sentinel-gate.json fontosabb beállításai:
The most important settings in sentinel-gate.json:
| KulcsKey | JelentésMeaning |
|---|---|
listen_port | az őr portja, ide csatlakoznak a kliensekthe gate port clients connect to |
exe_name | a kliens exe neve a kiadásokbanyour client exe name in the releases |
firewall | pf | ipset | none |
pf_table / ipset_name | a tábla, amibe az igazolt címek kerülnek (alap: sentinel)the table of verified addresses (default sentinel) |
db_socket, db_user, db_password | MySQL kapcsolatMySQL connection |
account_ban_sql … | a játék fióktáblája a kitiltáshoz (üresen: csak az őr saját tiltólistája)your game's account table for bans (empty: only the gate's own ban list) |
require_python_scan | true, ha a Python adapter be van fordítvatrue if the Python adapter is compiled in |
hub_url, hub_licence | https://sentinelshield.eu és a licenckulcsod a vezérlőpultrólhttps://sentinelshield.eu and your licence key from the dashboard |
SzolgáltatáskéntAs a service
# FreeBSD
cp sentinel_gate.rc /usr/local/etc/rc.d/sentinel_gate
chmod 755 /usr/local/etc/rc.d/sentinel_gate
sysrc sentinel_gate_enable=YES
service sentinel_gate start
# Linux
cp sentinel-gate.service /etc/systemd/system/
systemctl enable --now sentinel-gate
Az őr induláskor és óránként lekérdezi a licencet, és a központ által aláírt licenc-tokent továbbítja a klienseknek. A kliens modul csak érvényes, a te őr-kulcsodhoz kiadott tokennel ellenőriz. Lejárat után 3 napig minden működik tovább; utána a védelem kikapcsol (a játék megy tovább). Ha a központ nem érhető el, a token még 72 óráig érvényes, és az őr később elküldi a naplót. A licenc az első őr-kulcshoz kötődik; új kulcsnál a vezérlőpulton oldhatod fel a kötést.
The gate checks the licence at start-up and every hour and passes the licence token signed by the hub to the clients. The client module only checks with a valid token issued for your gate key. After expiry everything keeps working for 3 days; after that the protection switches off (the game keeps running). If the hub is unreachable, the token stays valid for 72 hours and the gate sends the log later. The licence binds to the first gate key; release the binding on the dashboard when you change the key.
4. Tűzfal4. Firewall
Az őr az igazolt kliensek címét (alapból a /24-es tartományát) beírja a táblába; a játék portjaira csak a táblában szereplő címek juthatnak be. A példában a játék portjai 13000–13099, az őré 10050.
The gate writes the address (by default the /24 range) of every verified client into the table; only addresses in the table can reach the game ports. In the example the game ports are 13000–13099 and the gate uses 10050.
FreeBSD – pf
table <sentinel> persist
pass in quick proto tcp to port 10050
pass in quick proto tcp from <sentinel> to port 13000:13099
block in quick proto tcp to port 13000:13099
Linux – ipset + iptables
ipset create sentinel hash:net -exist
iptables -A INPUT -p tcp --dport 10050 -j ACCEPT
iptables -A INPUT -p tcp --dport 13000:13099 -m set --match-set sentinel src -j ACCEPT
iptables -A INPUT -p tcp --dport 13000:13099 -j DROP
A tűzfal módosítása előtt mindig legyen kiút (konzol vagy engedélyezett SSH). Az SSH portját soha ne tedd a védett portok közé.
Before changing the firewall, always keep a way back in (console or an allowed SSH rule). Never put your SSH port among the protected ports.
5. Kliens: a DLL beépítése5. Client: adding the DLL
- Az SDK-ból add a projekthez az
include/sentinel_shield.h-t és alib/SentinelShield.lib-et; abin/SentinelShield.dlla kliens exe mellé kerül. - From the SDK add
include/sentinel_shield.handlib/SentinelShield.libto your project;bin/SentinelShield.dllgoes next to the client exe. - Másold be a szerveren generált
gate_public_key.h-t. - Copy in the
gate_public_key.hgenerated on your server. - Ha a kliensed Python 2.7-et tartalmaz: fordítsd bele az
adapter/ss_python.cpp-t (az eleje leírja, mit kell a saját csomagkezelődhöz igazítani). - If your client embeds Python 2.7: compile
adapter/ss_python.cppinto it (its header comment says what to adapt to your pack manager).
6. Kliens API6. Client API
// 1) a játék ablakának létrehozása után / after the game window exists
#include "sentinel_shield.h"
#include "gate_public_key.h"
SS_Config cfg = {};
cfg.apiVersion = SS_API_VERSION;
cfg.gateHost = "play.example.net"; // your game server
cfg.gatePort = 10050;
cfg.gatePublicKey = g_abSentinelGateKey;
cfg.gatePublicKeyLen = sizeof(g_abSentinelGateKey);
cfg.clientBuild = 1; // the build you register on the server
cfg.gameWindow = hWnd;
cfg.messageTitle = "My Server";
if (!SS_Init(&cfg))
ExitProcess(1); // show an error first
SS_SetPythonScanner(SentinelPythonScan); // only with ss_python.cpp
// 2) belépés után / after login
SS_SetAccount(login);
// 3) karakterválasztáskor / on character select
SS_SetCharacter(name);
// 4) a fő ciklusban / every frame on the main thread
SS_Tick();
// 5) kilépéskor / on exit
SS_Shutdown();
| FüggvényFunction | Mit csinálWhat it does |
|---|---|
SS_Init | elindítja a figyelést és a titkosított kapcsolatot; 1 = elindultstarts monitoring and the encrypted channel; 1 = started |
SS_SetAccount / SS_SetCharacter | a munkamenetet a fiókhoz és karakterhez köti (gyanúszint, napló, kitiltás)binds the session to the account and character (suspicion level, log, ban) |
SS_Tick | könnyű hívás a fő szálon; a Python adapter ezen keresztül futlight call on the main thread; the Python adapter runs through it |
SS_IsVerified | 1, ha az őr elfogadta a klienst1 when the gate accepted the client |
SS_Shutdown | leállítja a modultstops the module |
A cheatMessage mezőben saját szöveget adhatsz a csalás miatti bezáráshoz. Az allowedClientFiles mezőben megadhatod a kliensmappa engedélyezett dll / asi / mix fájljainak SHA-256 listáját; ha üres, az indításkor ott lévő fájlok engedélyezettek, a később odakerülők nem.
Use cheatMessage for your own text when the game closes because of a cheat. allowedClientFiles can list the SHA-256 of the allowed dll / asi / mix files of the client folder; when empty, the files present at start-up are allowed and anything added later is not.
7. Kiadás7. Releasing a client
Minden új kliens-buildet regisztrálj a szerveren. Az őr csak a regisztrált buildeket engedi be, és ezekből számolja a memória-kérdések válaszait.
Register every new client build on the server. The gate only accepts registered builds and computes the memory challenge answers from them.
python3 sentinel_gate.py release 2 ./client.exe ./SentinelShield.dll
python3 sentinel_gate.py release-remove 1 # régi build tiltása / drop an old build
8. Ellenőrzés8. Verification
- Indítsd a klienst: belépés után a címednek meg kell jelennie a
sentineltáblában (pfctl -t sentinel -T show/ipset list sentinel). - Start the client: after login your address should appear in the
sentineltable (pfctl -t sentinel -T show/ipset list sentinel). - Indítsd a klienst a modul nélkül: a játék portjához nem szabad kapcsolódnia.
- Start the client without the module: it must not be able to connect to the game port.
- A vezérlőpulton (Szervereim) látszik, mikor jelentkezett az őr, és minden esemény.
- The dashboard (Servers) shows when the gate last reported and every event.
- Parancssorból:
python3 sentinel_gate.py list,files,player <fiók>,unban. - From the shell:
python3 sentinel_gate.py list,files,player <account>,unban.
Kérdésed van? Írj nekünk.
Questions? Get in touch.