Overview
CoD4 Unleashed includes a built-in web server that provides browser-based server administration. The web admin interface allows you to manage players, execute commands, and monitor server status from any web browser.The web admin requires admin authentication with username and password. It uses session-based authentication with SHA-256 security.
Features
Real-time Server Status
View connected players with scores, ping, and team information
Console Command Execution
Execute any server command remotely through the web interface
Player Management
Kick and ban players directly from the web interface
Admin List
View all registered administrators and their power levels
Accessing Web Admin
Web Admin URL
The web admin is accessible at:The port number depends on your HTTP server configuration. The default port is typically configured in your server setup.
Public Status Page
A public server status page is available without authentication:- Current map name
- Connected players and their stats
- Team composition
- Ping and scores
- Short GUID (last 8 characters)
webadmin.c:718-724
Authentication
Login System
The web admin uses session-based authentication with the following features:- Session IDs: 64-character SHA-256 hashes
- Password Security: Salted SHA-256 password hashing
- Brute Force Protection: IP-based temporary bans after failed attempts
- Automatic Logout: Session management with logout capability
webadmin.c:796-844, sv_auth.c:80-94
Login Form
To access the web admin, you must login with admin credentials: Required credentials:- Username (created with
AdminAddAdminWithPassword) - Password (minimum 6 characters)
webadmin.c:582-605, webadmin.c:816-820
Login Flow
Source:webadmin.c:796-844
Web Admin Interface
Main Dashboard
After login, the main interface displays: Header:- Server version (CoD4U v1.7a / v1.8)
- Server hostname (with color codes rendered)
- Current map name
- Logged in username
- Logout link
- Real-time player list
- Team organization (Axis/Allies/Spectators)
- Client ID, Name, UID/GUID, Power, Score, Ping
- Command input form
- Command execution output
- Quick action buttons
webadmin.c:629-716
Server Status View
Detailed player information table:- Client ID (slot number)
- Player name with color code rendering
- UID (if authenticated) or GUID
- Admin power level
- Current score
- Ping in milliseconds
- For team gametypes, players are grouped by team
- Team names (Axis: Opfor/Spetsnaz, Allies: Marines/S.A.S.)
- Spectators listed separately
webadmin.c:181-438
Console Command Interface
Execute server commands remotely: Form fields:- Text input for command
- “Send Command” button
- Command output display area
Commands are executed with the logged-in admin’s power level. Insufficient permissions will be rejected.
- Command power level validation
- Separator character filtering (
;,\n,\r) - Maximum command length: 960 characters
- Buffer overflow protection
webadmin.c:521-580, webadmin.c:686-694
Player Management
Kick Player
Kick a player via web interface: HTTP Request:Client slot number (0-63)
Kick reason (defaults to “The admin has no reason given”)
kick command
Source: webadmin.c:440-462, webadmin.c:703-704
Ban Player
Permanently ban a player: HTTP Request:Client slot number for online player
Player UID for offline ban
Player GUID (32 characters) for offline ban
Ban reason (required)
permban command
Source: webadmin.c:464-503, webadmin.c:700-701
Admin List View
View registered administrators: URL:- Admin username (with color codes)
- UID
- Power level
AdminListAdmins command (typically 80)
Example table:
webadmin.c:123-163, webadmin.c:655-657
Color Code Rendering
The web admin renders CoD4 color codes as HTML: Color code mapping:webadmin.c:25-66
Static Files
The web admin serves static assets from:webadmin.css- Stylesheet- Bootstrap CSS (referenced in HTML)
Static file paths are validated to prevent directory traversal attacks. Paths containing
.. or :: are rejected.webadmin.c:759-777
API Reference
URL Actions
The web admin supports these query string actions:| Action | Method | Description |
|---|---|---|
sendcmd | POST | Execute console command |
logout | GET | End admin session |
banclient | POST | Ban a player |
kickclient | POST | Kick a player |
listadmins | GET | View admin list |
webadmin.c:686-706
POST Data Format
The web admin uses URL-encoded form data:Webadmin_GetPostVal()- Extract POST valuesWebadmin_GetUrlVal()- Extract URL parametersHTTP_DecodeURLFormData()- Decode URL encoding
webadmin.c:69-121
Security Features
Session Security
SHA-256 Sessions
Session IDs are 64-character SHA-256 hashes generated from random data
Session Validation
All requests validate session ID against stored admin sessions
Logout Support
Sessions can be invalidated with explicit logout action
IP Ban Protection
Failed login attempts trigger temporary IP bans
sv_auth.c:59-94, webadmin.c:698-699
Command Injection Prevention
Security measures:- Command separator filtering (
;,\n,\r) - Maximum command length (960 chars)
- Power level validation before execution
- No shell access - commands executed internally
webadmin.c:542-544
Directory Traversal Prevention
Static file access is protected:webadmin.c:765-767
Response Format
The web admin generates HTML responses: HTML structure:webadmin.c:619-648
Message Building
The web admin uses XML-style helpers for HTML generation: Macros:XO(tag)- Open tagXC- Close tagXA(text)- Append textXO1(tag, attr, val)- Open tag with attribute
webadmin.c:12-23
Configuration
Server Hostname Display
The web admin displays your configured server hostname:webadmin.c:642-643
Network Address
The footer displays your server’s network address:webadmin.c:737-738
Best Practices
Strong Passwords
Use passwords with minimum 12 characters, mixed case, and symbols
Limit Access
Only grant web admin access to trusted administrators
HTTPS Recommended
Use reverse proxy with HTTPS for production environments
Regular Monitoring
Review web admin access logs for suspicious activity
Related Topics
Authentication System
UID system and admin account management
Server Commands
Complete console command reference
Security Features
Server security and ban management
Configuration
Server configuration and settings