What does it do, what technologies and concepts are used and how does it reach its goal.…
- User
What does it do, what technologies and concepts are used and how does it reach its goal. Step by step by step, divide these contents into smaller parts and explain.A fast TCP/UDP tunnel over HTTP
Chisel is a fast TCP/UDP tunnel, transported over HTTP, secured via SSH. Single executable including both client and server. Written in Go (golang). Chisel is mainly useful for passing through firewalls, though it can also be used to provide a secure endpoint into your network.
Easy to use Performant* Encrypted connections using the SSH protocol (via crypto/ssh) Authenticated connections; authenticated client connections with a users config file, authenticated server connections with fingerprint matching. Client auto-reconnects with exponential backoff Clients can create multiple tunnel endpoints over one TCP connection Clients can optionally pass through SOCKS or HTTP CONNECT proxies Reverse port forwarding (Connections go through the server and out the client) Server optionally doubles as a reverse proxy Server optionally allows SOCKS5 connections (See guide below) Clients optionally allow SOCKS5 connections from a reversed port forward Client connections over stdio which supports ssh -o ProxyCommand providing SSH over HTTP
$ chisel --help
Usage: chisel [command] [--help]
Version: X.Y.Z
Commands: server - runs chisel in server mode client - runs chisel in client mode
Read more: https://github.com/jpillora/chisel $ chisel server --help
Usage: chisel server [options]
Options:
--host, Defines the HTTP listening host – the network interface (defaults the environment variable HOST and falls back to 0.0.0.0). --port, -p, Defines the HTTP listening port (defaults to the environment variable PORT and fallsback to port 8080). --key, (deprecated use --keygen and --keyfile instead) An optional string to seed the generation of a ECDSA public and private key pair. All communications will be secured using this key pair. Share the subsequent fingerprint with clients to enable detection of man-in-the-middle attacks (defaults to the CHISEL_KEY environment variable, otherwise a new key is generate each run). --keygen, A path to write a newly generated PEM-encoded SSH private key file. If users depend on your --key fingerprint, you may also include your --key to output your existing key. Use - (dash) to output the generated key to stdout. --keyfile, An optional path to a PEM-encoded SSH private key. When this flag is set, the --key option is ignored, and the provided private key is used to secure all communications. (defaults to the CHISEL_KEY_FILE environment variable). Since ECDSA keys are short, you may also set keyfile to an inline base64 private key (e.g. chisel server --keygen - | base64). --authfile, An optional path to a users.json file. This file should be an object with users defined like: { "<user:pass>": ["<addr-regex>","<addr-regex>"] } when <user> connects, their <pass> will be verified and then each of the remote addresses will be compared against the list of address regular expressions for a match. Addresses will always come in the form "<remote-host>:<remote-port>" for normal remotes and "R:<local-interface>:<local-port>" for reverse port forwarding remotes. This file will be automatically reloaded on change. --auth, An optional string representing a single user with full access, in the form of <user:pass>. It is equivalent to creating an authfile with {"<user:pass>": [""]}. If unset, it will use the environment variable AUTH. --keepalive, An optional keepalive interval. Since the underlying transport is HTTP, in many instances we'll be traversing through proxies, often these proxies will close idle connections. You must specify a time with a unit, for example '5s' or '2m'. Defaults to '25s' (set to 0s to disable). --backend, Specifies another HTTP server to proxy requests to when chisel receives a normal HTTP request. Useful for hiding chisel in plain sight. --socks5, Allow clients to access the internal SOCKS5 proxy. See chisel client --help for more information. --reverse, Allow clients to specify reverse port forwarding remotes in addition to normal remotes. --tls-key, Enables TLS and provides optional path to a PEM-encoded TLS private key. When this flag is set, you must also set --tls-cert, and you cannot set --tls-domain. --tls-cert, Enables TLS and provides optional path to a PEM-encoded TLS certificate. When this flag is set, you must also set --tls-key, and you cannot set --tls-domain. --tls-domain, Enables TLS and automatically acquires a TLS key and certificate using LetsEncrypt. Setting --tls-domain requires port 443. You may specify multiple --tls-domain flags to serve multiple domains. The resulting files are cached in the "$HOME/.cache/chisel" directory. You can modify this path by setting the CHISEL_LE_CACHE variable, or disable caching by setting this variable to "-". You can optionally provide a certificate notification email by setting CHISEL_LE_EMAIL. --tls-ca, a path to a PEM encoded CA certificate bundle or a directory holding multiple PEM encode CA certificate bundle files, which is used to validate client connections. The provided CA certificates will be used instead of the system roots. This is commonly used to implement mutual-TLS. --pid Generate pid file in current working directory -v, Enable verbose logging --help, This help text - Assistant
- User
so then how this work? ### Server Setup:
- Check Open Ports on Your Server:
Connect to your server via SSH and check which ports are open and listening. Ensure port 80 is not being used by another service:
ssh <PRESIDIO_ANONYMIZED_EMAIL_ADDRESS> netstat -tulnp
If another service is using port 80, consider changing its configuration to free up the port.
- Assistant
- User
so i have a socks proxy or open vpn or wirguad proxy setup on my server , is it possible that i incorporated them in to Chisel tunnel ?
- Assistant
- User
What Chisel difference with http proxy then?
- Assistant
- User
i mean gfw see it as a shh or as a http traffic?
- Assistant
The Great Firewall of China (GFW), known for its advanced filtering and traffic analysis techniques, aims to identify and block traffic that it deems unauthorized or undesirable. Whether the GFW sees traffic as SSH or HTTP when using a tool like Chisel depends on how the tool is being used and configured.
- User
encryption vs obfuscation
- Assistant
- User
so gfw can not know that in this http tunnel the ssh encyption mehod is used?
- Assistant
- User
so its could be SSH IN TLS ?
- Assistant
Yes, when using Chisel or similar tools that tunnel SSH over HTTPS, you are effectively encapsulating SSH within TLS (Transport Layer Security). Here's how the layered approach works:
-
SSH: This is the innermost layer, providing a secure method for creating an encrypted communication channel over an insecure network. SSH includes features like strong encryption, integrity checking, and authentication.
-
- User
is it https or http then?
- Assistant
When you tunnel SSH over Chisel and use TLS, the resulting traffic appears as HTTPS, not HTTP.
HTTPS (HTTP over TLS):
- HTTP (Hypertext Transfer Protocol) is the foundational protocol used by the web to transmit data between a client (like a web browser) and a server. HTTP traffic is unencrypted, which makes it vulnerable to eavesdropping and man-in-the-middle attacks.
- HTTPS (HTTP Secure) is essentially HTTP traffic encrypted by TLS (Transport Layer Security). TLS establishes a secure session by performing a handshake between the client and server, ensuring that all data passed between them is encrypted and secure.
When using Chisel with TLS encryption enabled, the SSH traffic is encapsulated within the encrypted HTTPS traffic. This makes it indistinguishable from regular web traffic to passive observers and automated systems designed to analyze network packets, such as the GFW. Thus, it should be referred to as HTTPS rather than HTTP, emphasizing the encryption and secure nature of the connection.
- User
--tls-ca, An optional root certificate bundle used to verify the chisel server. Only valid when connecting to the server with "https" or "wss". By default, the operating system CAs will be used.
--tls-skip-verify, Skip server TLS certificate verification of chain and host name (if TLS is used for transport connections to server). If set, client accepts any TLS certificate presented by the server and any host name in that certificate. This only affects transport https (wss) connection. Chisel server's public key may be still verified (see --fingerprint) after inner connection is established. --tls-key, a path to a PEM encoded private key used for client authentication (mutual-TLS). --tls-cert, a path to a PEM encoded certificate matching the provided private key. The certificate must have client authentication enabled (mutual-TLS). - Assistant
- User
- Assistant