TLS
Implementation specification & reference for TLS
GoNetSim can run HTTPS (and any TLS-wrapped custom listener) using either:
- A user-provided certificate/key (configured in
https.cert/https.key), or - An auto-generated certificate/key.
Auto-generated TLS
Section titled “Auto-generated TLS”When https.cert/https.key are not set, GoNetSim will use a persisted, auto-generated keypair stored next to the active config.toml.
The following files are created in the same directory as config.toml if they don’t already exist:
gonetsim-cert.pem: server certificate PEMgonetsim-key.pem: server private key PEMgonetsim-ca.pem: CA certificate PEM
On subsequent starts, if gonetsim-cert.pem and gonetsim-key.pem exist, GoNetSim reuses them. This keeps the server certificate stable across restarts, and is useful for malware which pin certificates.
Trusting the CA certificate
Section titled “Trusting the CA certificate”To avoid TLS warnings in tools/browsers, install the CA certificate (gonetsim-ca.pem) into your analysis VM.
-
Copy
gonetsim-ca.pemto your local user’s CA certificates directoryTerminal window sudo cp ~/.config/gonetsim/gonetsim-ca.pem /usr/local/share/ca-certificates/gonetsim-ca.crt -
Update the CA certificates
Terminal window sudo update-ca-certificates
-
Open
certmgr.msc -
Import
gonetsim-ca.peminto Trusted Root Certification Authorities (Local Computer or Current User, depending on your tooling)
Regenerating the auto-generated certificates
Section titled “Regenerating the auto-generated certificates”-
Run the
tls --forcecommandTerminal window gonetsim tls --force
-
Delete the persisted files next to
config.tomlgonetsim-cert.pemgonetsim-key.pemgonetsim-ca.pem
-
Restart GoNetSim
Validating TLS
Section titled “Validating TLS”You can verify the TLS certificates with the tls --verify-only flag
gonetsim tls --verify-onlyFurther reading
Section titled “Further reading”- See the basic configuration guide for a walkthrough on configuration
- See the HTTPS reference for HTTPS-specific TLS options
- See the listeners reference for TLS options on custom listeners
