{"id":13400354,"url":"https://github.com/jpillora/chisel","last_synced_at":"2025-05-13T10:54:07.696Z","repository":{"id":27821390,"uuid":"31311037","full_name":"jpillora/chisel","owner":"jpillora","description":"A fast TCP/UDP tunnel over HTTP","archived":false,"fork":false,"pushed_at":"2024-09-28T23:35:13.000Z","size":3389,"stargazers_count":14475,"open_issues_count":244,"forks_count":1467,"subscribers_count":204,"default_branch":"master","last_synced_at":"2025-05-05T20:29:50.542Z","etag":null,"topics":["golang","http","tcp","tunnel"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jpillora.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-02-25T11:42:50.000Z","updated_at":"2025-05-05T18:16:01.000Z","dependencies_parsed_at":"2024-01-01T23:33:13.768Z","dependency_job_id":"fc06274d-9049-4b02-b7fd-c8ae75aab748","html_url":"https://github.com/jpillora/chisel","commit_stats":{"total_commits":207,"total_committers":43,"mean_commits":4.813953488372093,"dds":0.5700483091787439,"last_synced_commit":"3de177432cd23db58e57f376b62ad497cc10840f"},"previous_names":[],"tags_count":35,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpillora%2Fchisel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpillora%2Fchisel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpillora%2Fchisel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpillora%2Fchisel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jpillora","download_url":"https://codeload.github.com/jpillora/chisel/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253929320,"owners_count":21985800,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["golang","http","tcp","tunnel"],"created_at":"2024-07-30T19:00:51.050Z","updated_at":"2025-05-13T10:54:07.637Z","avatar_url":"https://github.com/jpillora.png","language":"Go","readme":"# Chisel\n\n[![GoDoc](https://godoc.org/github.com/jpillora/chisel?status.svg)](https://godoc.org/github.com/jpillora/chisel) [![CI](https://github.com/jpillora/chisel/workflows/CI/badge.svg)](https://github.com/jpillora/chisel/actions?workflow=CI)\n\nChisel 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.\n\n![overview](https://docs.google.com/drawings/d/1p53VWxzGNfy8rjr-mW8pvisJmhkoLl82vAgctO_6f1w/pub?w=960\u0026h=720)\n\n## Table of Contents\n\n- [Features](#features)\n- [Install](#install)\n- [Demo](#demo)\n- [Usage](#usage)\n- [Contributing](#contributing)\n- [Changelog](#changelog)\n- [License](#license)\n\n## Features\n\n- Easy to use\n- [Performant](./test/bench/perf.md)\\*\n- [Encrypted connections](#security) using the SSH protocol (via `crypto/ssh`)\n- [Authenticated connections](#authentication); authenticated client connections with a users config file, authenticated server connections with fingerprint matching.\n- Client auto-reconnects with [exponential backoff](https://github.com/jpillora/backoff)\n- Clients can create multiple tunnel endpoints over one TCP connection\n- Clients can optionally pass through SOCKS or HTTP CONNECT proxies\n- Reverse port forwarding (Connections go through the server and out the client)\n- Server optionally doubles as a [reverse proxy](http://golang.org/pkg/net/http/httputil/#NewSingleHostReverseProxy)\n- Server optionally allows [SOCKS5](https://en.wikipedia.org/wiki/SOCKS) connections (See [guide below](#socks5-guide))\n- Clients optionally allow [SOCKS5](https://en.wikipedia.org/wiki/SOCKS) connections from a reversed port forward\n- Client connections over stdio which supports `ssh -o ProxyCommand` providing SSH over HTTP\n\n## Install\n\n### Binaries\n\n[![Releases](https://img.shields.io/github/release/jpillora/chisel.svg)](https://github.com/jpillora/chisel/releases) [![Releases](https://img.shields.io/github/downloads/jpillora/chisel/total.svg)](https://github.com/jpillora/chisel/releases)\n\nSee [the latest release](https://github.com/jpillora/chisel/releases/latest) or download and install it now with `curl https://i.jpillora.com/chisel! | bash`\n\n### Docker\n\n[![Docker Pulls](https://img.shields.io/docker/pulls/jpillora/chisel.svg)](https://hub.docker.com/r/jpillora/chisel/) [![Image Size](https://img.shields.io/docker/image-size/jpillora/chisel/latest)](https://microbadger.com/images/jpillora/chisel)\n\n```sh\ndocker run --rm -it jpillora/chisel --help\n```\n\n### Fedora\n\nThe package is maintained by the Fedora community. If you encounter issues related to the usage of the RPM, please use this [issue tracker](https://bugzilla.redhat.com/buglist.cgi?bug_status=NEW\u0026bug_status=ASSIGNED\u0026classification=Fedora\u0026component=chisel\u0026list_id=11614537\u0026product=Fedora\u0026product=Fedora%20EPEL).\n\n```sh\nsudo dnf -y install chisel\n```\n\n### Source\n\n```sh\n$ go install github.com/jpillora/chisel@latest\n```\n\n## Demo\n\nA [demo app](https://chisel-demo.herokuapp.com) on Heroku is running this `chisel server`:\n\n```sh\n$ chisel server --port $PORT --proxy http://example.com\n# listens on $PORT, proxy web requests to http://example.com\n```\n\nThis demo app is also running a [simple file server](https://www.npmjs.com/package/serve) on `:3000`, which is normally inaccessible due to Heroku's firewall. However, if we tunnel in with:\n\n```sh\n$ chisel client https://chisel-demo.herokuapp.com 3000\n# connects to chisel server at https://chisel-demo.herokuapp.com,\n# tunnels your localhost:3000 to the server's localhost:3000\n```\n\nand then visit [localhost:3000](http://localhost:3000/), we should see a directory listing. Also, if we visit the [demo app](https://chisel-demo.herokuapp.com) in the browser we should hit the server's default proxy and see a copy of [example.com](http://example.com).\n\n## Usage\n\n\u003c!-- render these help texts by hand,\n  or use https://github.com/jpillora/md-tmpl\n    with $ md-tmpl -w README.md --\u003e\n\n\u003c!--tmpl,code=plain:echo \"$ chisel --help\" \u0026\u0026 go run main.go --help | sed 's#0.0.0-src (go1\\..*)#X.Y.Z#' --\u003e\n``` plain \n$ chisel --help\n\n  Usage: chisel [command] [--help]\n\n  Version: X.Y.Z\n\n  Commands:\n    server - runs chisel in server mode\n    client - runs chisel in client mode\n\n  Read more:\n    https://github.com/jpillora/chisel\n\n```\n\u003c!--/tmpl--\u003e\n\n\n\u003c!--tmpl,code=plain:echo \"$ chisel server --help\" \u0026\u0026 go run main.go server --help | cat | sed 's#0.0.0-src (go1\\..*)#X.Y.Z#' --\u003e\n``` plain \n$ chisel server --help\n\n  Usage: chisel server [options]\n\n  Options:\n\n    --host, Defines the HTTP listening host – the network interface\n    (defaults the environment variable HOST and falls back to 0.0.0.0).\n\n    --port, -p, Defines the HTTP listening port (defaults to the environment\n    variable PORT and fallsback to port 8080).\n\n    --key, (deprecated use --keygen and --keyfile instead)\n    An optional string to seed the generation of a ECDSA public\n    and private key pair. All communications will be secured using this\n    key pair. Share the subsequent fingerprint with clients to enable detection\n    of man-in-the-middle attacks (defaults to the CHISEL_KEY environment\n    variable, otherwise a new key is generate each run).\n\n    --keygen, A path to write a newly generated PEM-encoded SSH private key file.\n    If users depend on your --key fingerprint, you may also include your --key to\n    output your existing key. Use - (dash) to output the generated key to stdout.\n\n    --keyfile, An optional path to a PEM-encoded SSH private key. When\n    this flag is set, the --key option is ignored, and the provided private key\n    is used to secure all communications. (defaults to the CHISEL_KEY_FILE\n    environment variable). Since ECDSA keys are short, you may also set keyfile\n    to an inline base64 private key (e.g. chisel server --keygen - | base64).\n\n    --authfile, An optional path to a users.json file. This file should\n    be an object with users defined like:\n      {\n        \"\u003cuser:pass\u003e\": [\"\u003caddr-regex\u003e\",\"\u003caddr-regex\u003e\"]\n      }\n    when \u003cuser\u003e connects, their \u003cpass\u003e will be verified and then\n    each of the remote addresses will be compared against the list\n    of address regular expressions for a match. Addresses will\n    always come in the form \"\u003cremote-host\u003e:\u003cremote-port\u003e\" for normal remotes\n    and \"R:\u003clocal-interface\u003e:\u003clocal-port\u003e\" for reverse port forwarding\n    remotes. This file will be automatically reloaded on change.\n\n    --auth, An optional string representing a single user with full\n    access, in the form of \u003cuser:pass\u003e. It is equivalent to creating an\n    authfile with {\"\u003cuser:pass\u003e\": [\"\"]}. If unset, it will use the\n    environment variable AUTH.\n\n    --keepalive, An optional keepalive interval. Since the underlying\n    transport is HTTP, in many instances we'll be traversing through\n    proxies, often these proxies will close idle connections. You must\n    specify a time with a unit, for example '5s' or '2m'. Defaults\n    to '25s' (set to 0s to disable).\n\n    --backend, Specifies another HTTP server to proxy requests to when\n    chisel receives a normal HTTP request. Useful for hiding chisel in\n    plain sight.\n\n    --socks5, Allow clients to access the internal SOCKS5 proxy. See\n    chisel client --help for more information.\n\n    --reverse, Allow clients to specify reverse port forwarding remotes\n    in addition to normal remotes.\n\n    --tls-key, Enables TLS and provides optional path to a PEM-encoded\n    TLS private key. When this flag is set, you must also set --tls-cert,\n    and you cannot set --tls-domain.\n\n    --tls-cert, Enables TLS and provides optional path to a PEM-encoded\n    TLS certificate. When this flag is set, you must also set --tls-key,\n    and you cannot set --tls-domain.\n\n    --tls-domain, Enables TLS and automatically acquires a TLS key and\n    certificate using LetsEncrypt. Setting --tls-domain requires port 443.\n    You may specify multiple --tls-domain flags to serve multiple domains.\n    The resulting files are cached in the \"$HOME/.cache/chisel\" directory.\n    You can modify this path by setting the CHISEL_LE_CACHE variable,\n    or disable caching by setting this variable to \"-\". You can optionally\n    provide a certificate notification email by setting CHISEL_LE_EMAIL.\n\n    --tls-ca, a path to a PEM encoded CA certificate bundle or a directory\n    holding multiple PEM encode CA certificate bundle files, which is used to \n    validate client connections. The provided CA certificates will be used \n    instead of the system roots. This is commonly used to implement mutual-TLS. \n\n    --pid Generate pid file in current working directory\n\n    -v, Enable verbose logging\n\n    --help, This help text\n\n  Signals:\n    The chisel process is listening for:\n      a SIGUSR2 to print process stats, and\n      a SIGHUP to short-circuit the client reconnect timer\n\n  Version:\n    X.Y.Z\n\n  Read more:\n    https://github.com/jpillora/chisel\n\n```\n\u003c!--/tmpl--\u003e\n\n\n\u003c!--tmpl,code=plain:echo \"$ chisel client --help\" \u0026\u0026 go run main.go client --help | sed 's#0.0.0-src (go1\\..*)#X.Y.Z#' --\u003e\n``` plain \n$ chisel client --help\n\n  Usage: chisel client [options] \u003cserver\u003e \u003cremote\u003e [remote] [remote] ...\n\n  \u003cserver\u003e is the URL to the chisel server.\n\n  \u003cremote\u003es are remote connections tunneled through the server, each of\n  which come in the form:\n\n    \u003clocal-host\u003e:\u003clocal-port\u003e:\u003cremote-host\u003e:\u003cremote-port\u003e/\u003cprotocol\u003e\n\n    ■ local-host defaults to 0.0.0.0 (all interfaces).\n    ■ local-port defaults to remote-port.\n    ■ remote-port is required*.\n    ■ remote-host defaults to 0.0.0.0 (server localhost).\n    ■ protocol defaults to tcp.\n\n  which shares \u003cremote-host\u003e:\u003cremote-port\u003e from the server to the client\n  as \u003clocal-host\u003e:\u003clocal-port\u003e, or:\n\n    R:\u003clocal-interface\u003e:\u003clocal-port\u003e:\u003cremote-host\u003e:\u003cremote-port\u003e/\u003cprotocol\u003e\n\n  which does reverse port forwarding, sharing \u003cremote-host\u003e:\u003cremote-port\u003e\n  from the client to the server's \u003clocal-interface\u003e:\u003clocal-port\u003e.\n\n    example remotes\n\n      3000\n      example.com:3000\n      3000:google.com:80\n      192.168.0.5:3000:google.com:80\n      socks\n      5000:socks\n      R:2222:localhost:22\n      R:socks\n      R:5000:socks\n      stdio:example.com:22\n      1.1.1.1:53/udp\n\n    When the chisel server has --socks5 enabled, remotes can\n    specify \"socks\" in place of remote-host and remote-port.\n    The default local host and port for a \"socks\" remote is\n    127.0.0.1:1080. Connections to this remote will terminate\n    at the server's internal SOCKS5 proxy.\n\n    When the chisel server has --reverse enabled, remotes can\n    be prefixed with R to denote that they are reversed. That\n    is, the server will listen and accept connections, and they\n    will be proxied through the client which specified the remote.\n    Reverse remotes specifying \"R:socks\" will listen on the server's\n    default socks port (1080) and terminate the connection at the\n    client's internal SOCKS5 proxy.\n\n    When stdio is used as local-host, the tunnel will connect standard\n    input/output of this program with the remote. This is useful when \n    combined with ssh ProxyCommand. You can use\n      ssh -o ProxyCommand='chisel client chiselserver stdio:%h:%p' \\\n          user@example.com\n    to connect to an SSH server through the tunnel.\n\n  Options:\n\n    --fingerprint, A *strongly recommended* fingerprint string\n    to perform host-key validation against the server's public key.\n\tFingerprint mismatches will close the connection.\n\tFingerprints are generated by hashing the ECDSA public key using\n\tSHA256 and encoding the result in base64.\n\tFingerprints must be 44 characters containing a trailing equals (=).\n\n    --auth, An optional username and password (client authentication)\n    in the form: \"\u003cuser\u003e:\u003cpass\u003e\". These credentials are compared to\n    the credentials inside the server's --authfile. defaults to the\n    AUTH environment variable.\n\n    --keepalive, An optional keepalive interval. Since the underlying\n    transport is HTTP, in many instances we'll be traversing through\n    proxies, often these proxies will close idle connections. You must\n    specify a time with a unit, for example '5s' or '2m'. Defaults\n    to '25s' (set to 0s to disable).\n\n    --max-retry-count, Maximum number of times to retry before exiting.\n    Defaults to unlimited.\n\n    --max-retry-interval, Maximum wait time before retrying after a\n    disconnection. Defaults to 5 minutes.\n\n    --proxy, An optional HTTP CONNECT or SOCKS5 proxy which will be\n    used to reach the chisel server. Authentication can be specified\n    inside the URL.\n    For example, http://admin:password@my-server.com:8081\n            or: socks://admin:password@my-server.com:1080\n\n    --header, Set a custom header in the form \"HeaderName: HeaderContent\".\n    Can be used multiple times. (e.g --header \"Foo: Bar\" --header \"Hello: World\")\n\n    --hostname, Optionally set the 'Host' header (defaults to the host\n    found in the server url).\n\n    --sni, Override the ServerName when using TLS (defaults to the \n    hostname).\n\n    --tls-ca, An optional root certificate bundle used to verify the\n    chisel server. Only valid when connecting to the server with\n    \"https\" or \"wss\". By default, the operating system CAs will be used.\n\n    --tls-skip-verify, Skip server TLS certificate verification of\n    chain and host name (if TLS is used for transport connections to\n    server). If set, client accepts any TLS certificate presented by\n    the server and any host name in that certificate. This only affects\n    transport https (wss) connection. Chisel server's public key\n    may be still verified (see --fingerprint) after inner connection\n    is established.\n\n    --tls-key, a path to a PEM encoded private key used for client \n    authentication (mutual-TLS).\n\n    --tls-cert, a path to a PEM encoded certificate matching the provided \n    private key. The certificate must have client authentication \n    enabled (mutual-TLS).\n\n    --pid Generate pid file in current working directory\n\n    -v, Enable verbose logging\n\n    --help, This help text\n\n  Signals:\n    The chisel process is listening for:\n      a SIGUSR2 to print process stats, and\n      a SIGHUP to short-circuit the client reconnect timer\n\n  Version:\n    X.Y.Z\n\n  Read more:\n    https://github.com/jpillora/chisel\n\n```\n\u003c!--/tmpl--\u003e\n\n### Security\n\nEncryption is always enabled. When you start up a chisel server, it will generate an in-memory ECDSA public/private key pair. The public key fingerprint (base64 encoded SHA256) will be displayed as the server starts. Instead of generating a random key, the server may optionally specify a key file, using the `--keyfile` option. When clients connect, they will also display the server's public key fingerprint. The client can force a particular fingerprint using the `--fingerprint` option. See the `--help` above for more information.\n\n### Authentication\n\nUsing the `--authfile` option, the server may optionally provide a `user.json` configuration file to create a list of accepted users. The client then authenticates using the `--auth` option. See [users.json](example/users.json) for an example authentication configuration file. See the `--help` above for more information.\n\nInternally, this is done using the _Password_ authentication method provided by SSH. Learn more about `crypto/ssh` here http://blog.gopheracademy.com/go-and-ssh/.\n\n### SOCKS5 Guide with Docker\n\n1. Print a new private key to the terminal\n\n    ```sh\n    chisel server --keygen -\n    # or save it to disk --keygen /path/to/mykey\n    ```\n\n1. Start your chisel server\n\n    ```sh\n    jpillora/chisel server --keyfile '\u003cck-base64 string or file path\u003e' -p 9312 --socks5\n    ```\n\n1. Connect your chisel client (using server's fingerprint)\n\n    ```sh\n    chisel client --fingerprint '\u003csee server output\u003e' \u003cserver-address\u003e:9312 socks\n    ```\n\n1. Point your SOCKS5 clients (e.g. OS/Browser) to:\n\n    ```\n    \u003cclient-address\u003e:1080\n    ```\n\n1. Now you have an encrypted, authenticated SOCKS5 connection over HTTP\n\n\n#### Caveats\n\nSince WebSockets support is required:\n\n- IaaS providers all will support WebSockets (unless an unsupporting HTTP proxy has been forced in front of you, in which case I'd argue that you've been downgraded to PaaS)\n- PaaS providers vary in their support for WebSockets\n  - Heroku has full support\n  - Openshift has full support though connections are only accepted on ports 8443 and 8080\n  - Google App Engine has **no** support (Track this on [their repo](https://code.google.com/p/googleappengine/issues/detail?id=2535))\n\n## Contributing\n\n- http://golang.org/doc/code.html\n- http://golang.org/doc/effective_go.html\n- `github.com/jpillora/chisel/share` contains the shared package\n- `github.com/jpillora/chisel/server` contains the server package\n- `github.com/jpillora/chisel/client` contains the client package\n\n## Changelog\n\n- `1.0` - Initial release\n- `1.1` - Replaced simple symmetric encryption for ECDSA SSH\n- `1.2` - Added SOCKS5 (server) and HTTP CONNECT (client) support\n- `1.3` - Added reverse tunnelling support\n- `1.4` - Added arbitrary HTTP header support\n- `1.5` - Added reverse SOCKS support (by @aus)\n- `1.6` - Added client stdio support (by @BoleynSu)\n- `1.7` - Added UDP support\n- `1.8` - Move to a `scratch`Docker image\n- `1.9` - Bump to Go 1.21. Switch from `--key` seed to P256 key strings with `--key{gen,file}` (by @cmenginnz)\n- `1.10` - Bump to Go 1.22. Add `.rpm` `.deb` and `.akp` to releases. Fix bad version comparison.\n\n## License\n\n[MIT](https://github.com/jpillora/chisel/blob/master/LICENSE) © Jaime Pillora\n","funding_links":[],"categories":["Go","Popular","HarmonyOS","\u003ca id=\"1a9934198e37d6d06b881705b863afc8\"\u003e\u003c/a\u003e通信\u0026\u0026代理\u0026\u0026反向代理\u0026\u0026隧道","Uncategorized","Command and Control","Go (531)","\u003ca id=\"01e6651181d405ecdcd92a452989e7e0\"\u003e\u003c/a\u003e工具","golang","http","Overview","红队\u0026渗透测试"],"sub_categories":["Windows Manager","\u003ca id=\"56acb7c49c828d4715dce57410d490d1\"\u003e\u003c/a\u003e未分类-Proxy","Uncategorized","\u003ca id=\"9d6789f22a280f5bb6491d1353b02384\"\u003e\u003c/a\u003e隧道\u0026\u0026穿透","Networking"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjpillora%2Fchisel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjpillora%2Fchisel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjpillora%2Fchisel/lists"}