Troubleshooting Guide
This guide provides solutions to common problems you might encounter while using Virga.
1. Server Startup & Configuration Issues
Problems related to starting the virga-server.
Fatal error: config validation failed
This is the most common startup error. It means your config.yaml file has an issue. The server performs several checks upon loading the configuration.
database path is required: Yourconfig.yamlis missing thedatabase.pathfield. Add it under thedatabasesection.yamldatabase: path: "data/virga.db" type: "sqlite3"at least one listener is required: You must define at least one listener under thelisteners:section.listener[0]: name is required: Every listener in your list must have anamefield.listener[0]: invalid port number: Theportfor a listener must be a valid number (e.g., 1-65535).listener[0]: SSL enabled but missing cert/key: If you setuse_ssl: truefor a listener, you must provide valid paths for bothssl.certandssl.key.
Address already in use
This error means another process is already using the port specified for a listener or the admin interface.
- Solution: Identify and stop the conflicting process, or change the
portin yourconfig.yamlto an unused one.
2. Beacon Generation Issues
Problems encountered when using the generate beacon command in the CLI.
LLM model or library not found
This is the most common issue when generating an AI-enabled beacon.
- Symptom: The command fails with an error message like
llama library not foundorllama model not found. - Cause: The required AI model and platform-specific libraries have not been downloaded.
- Solution: Run the following command from the project's root directory on the machine running the Virgaer:bash
make download-llama-deps
Cross-Compilation Errors (CGO)
- Symptom: The build fails with CGO-related errors, especially when generating a beacon for a different operating system (e.g., building a Windows beacon from Linux).
- Cause: Generating a beacon with AI features (
--enable-llama) requires CGO. Cross-compiling CGO applications requires a specific toolchain. - Solution: Install the appropriate cross-compiler on your system. For example, to build for Windows from a Debian/Ubuntu system, you need
mingw-w64:bashsudo apt install mingw-w64
3. Beacon Runtime & Connectivity Issues
Problems after a beacon has been generated and deployed to a target.
Beacon does not connect / No session appears
- Connectivity: Ensure the target machine can reach the C2 server and port specified during beacon generation. Check firewalls, network ACLs, and routing.
- Listener Mismatch: Double-check that a listener is active on the server that matches the protocol, port, and host embedded in the beacon.
- Encryption Key Mismatch: The encryption key is set on the listener in the server's
config.yaml. The beacon will be generated to use this key. If you change the key on the server, you must regenerate the beacon. - SSL/TLS Errors: If using an
httpslistener, ensure the target machine trusts the SSL certificate used by the server. For testing, self-signed certificates will often cause the connection to fail unless the beacon is specifically configured to ignore certificate errors (a feature not yet implemented).
AI Features Fail on Target
- Symptom: The beacon connects, but
llamacommands fail or the AI does not behave as expected. - Cause 1: The beacon was not built with AI capabilities.
- Solution: Ensure you generated the beacon using the
--enable-llamaflag or withllama.enabled: truein yourbeacon.yaml.
- Solution: Ensure you generated the beacon using the
- Cause 2: Insufficient memory on the target machine.
- Solution: The AI model requires at least 2-4 GB of free RAM to load. The beacon may crash if the target does not have enough memory.
4. CLI Usage Issues
Cannot connect to server
- Symptom: The CLI fails to connect, showing a connection refused error.
- Cause: You might be trying to connect to a listener port instead of the admin port.
- Solution: Ensure the
--hostand--portflags for the CLI point to theadmin_portdefined in the server'sconfig.yaml(default: 8443), not a beacon listener port (like 80 or 443).
"No active session" error
- Symptom: Commands like
execorlsfail with this error. - Cause: These commands operate within the context of a specific session. You have not selected one yet.
- Solution: First, list the available sessions with
sessions list. Then, select one to interact with usinginteract <session_id>.