Overview
CoD4 Unleashed includes comprehensive security features to protect your server from malicious players, including a sophisticated ban system, IP-based temporary bans, and built-in brute-force protection.The server uses a dual-layer ban system: persistent UID/GUID bans stored in a file, and temporary IP bans stored in memory.
Ban System Architecture
Persistent Bans (Banlist)
Persistent bans are stored in a file and survive server restarts. Ban structure:sv_banlist.c:67-75
Temporary IP Bans
IP bans are temporary and stored in memory (up to 32 concurrent). IP ban structure:sv_banlist.c:51-63
Configuration
Ban System CVars
Filename for storing the persistent banlist
Maximum minutes to keep an IP ban active (default: 4 hours)Range: 0-20160 (0 to 14 days)
URL displayed to banned players for ban appeals
Minimum hours remaining on ban before showing appeal URLRange: 0-336 (0 to 14 days)
sv_banlist.c:540-550
Initialization
Ban system initialization:sv_banlist.c:537-560
Ban Management
Adding Bans
Permanent Bans
Using thepermban command adds a persistent ban:
uid- Player UID (preferred)auid- Admin UID issuing the banguid- PunkBuster GUID (8 chars)name- Player nameexpire- Unix timestamp, or-1for permanentbanreason- Reason string (max 126 chars)
- Reload banlist from file
- Check for duplicate entry
- Add/modify ban record
- Write banlist to file
sv_banlist.c:583-661
Temporary IP Bans
Automatic IP bans for enforcement:- Maximum 32 concurrent IP bans
- Oldest bans replaced when limit reached
- Duration limited by
banlist_maxipbantime - Used for ban enforcement and brute-force protection
sv_banlist.c:332-390
Removing Bans
- UID
- GUID (8 characters)
- Player name
- Reload banlist
- Find matching entries
- Set expire time to 0
- Remove corresponding IP bans
- Write updated banlist
sv_banlist.c:663-738
Viewing Bans
Dump all active bans:sv_banlist.c:740-772
Ban Checking
Connection Ban Check
Every player connection is checked against bans:- UID-based persistent ban (if uid > 0)
- GUID-based persistent ban (if guid exists)
- Returns NULL if not banned, or message if banned
- Creating temporary IP ban
- Returning formatted disconnect message
- Including appeal URL if configured
sv_banlist.c:429-535
IP Ban Check
- Compares base address against all IP bans
- Validates expiration time
- Returns formatted message with:
- Ban type (permanent/temporary)
- Remaining time (for temp bans)
- UID or GUID
- Banning admin UID
- Ban reason
- Appeal URL (if applicable)
sv_banlist.c:262-329
Ban Messages
Permanent Ban Message
Temporary Ban Message
sv_banlist.c:290-323, sv_banlist.c:453-488
Banlist File Format
Storage Format
Bans are stored as infostring lines:uid- Player UID (preferred identifier)guid- 8-character GUID (alternative identifier)nick- Player nicknamersn- Ban reasonexp- Expiration Unix timestamp (-1= never)create- Creation Unix timestampauid- Admin UID who created the ban
sv_banlist.c:239-253
Loading Banlist
- Expired bans automatically skipped
- Duplicate entries rejected
- Maximum 32 errors before abort
sv_banlist.c:172-212
Saving Banlist
sv_banlist.c:214-259
Brute-Force Protection
Failed Login Protection
The server automatically protects against brute-force attacks: Web Admin:webadmin.c:814-820
RCON (HL2Rcon):
hl2rcon.c:217-221
In-Game Login Protection
Failed in-game admin login:sv_auth.c:620-623
IP Ban Management
Maximum IP Ban Duration
IP bans are limited to prevent blocking shared IPs:Reason: Carrier-grade NAT and shared IPs mean multiple users can share the same IP address. Limiting IP ban duration prevents innocent users from being blocked.
sv_banlist.c:382-385
IP Ban Replacement
When IP ban limit reached:- Tracks
systime(Sys_Milliseconds()) - Replaces ban with lowest systime value
sv_banlist.c:356-364
Removing IP Bans
- By UID (if uid > 0)
- By GUID (if guid exists)
- By IP address (if remote != NULL)
sv_banlist.c:392-427
Appeal System
Appeal URL Configuration
Configure ban appeal URL:Appeal URL Display Logic
Appeal URLs are only shown if the remaining ban time exceeds the minimum hours. This prevents appeals for very short bans.
- 7-day ban with 4-hour minimum: URL shown immediately
- 2-hour ban with 4-hour minimum: URL never shown
- 6-hour ban with 4-hour minimum: URL shown first 2 hours only
sv_banlist.c:311-314, sv_banlist.c:476-479, sv_banlist.c:518-521
Ban Expiration
Automatic Cleanup
On load: Expired bans are skipped when loading from file:sv_banlist.c:126-128
On save:
Only active bans are written:
sv_banlist.c:237
Time Display Format
Remaining time formatted as days, hours, minutes:sv_banlist.c:305-309, sv_banlist.c:470-474, sv_banlist.c:512-516
Security Best Practices
Use UID Bans
Prefer UID-based bans over GUID for better reliability and player tracking
Configure Appeals
Set up appeal URL for legitimate players to contest false bans
Review Regularly
Periodically review active bans with
dumpbanlistModerate IP Duration
Keep IP ban duration reasonable (4-24 hours) to avoid shared IP issues
Admin Guidelines
Related Topics
Server Commands
Ban/kick/tempban command reference
Authentication
UID system and admin management
Web Admin
Web-based ban management interface
Configuration
Configure server security settings