Chisel은 빠른 TCP/UDP 터널이며 SSH를 통해 HTTP를 통해 운송됩니다. 클라이언트와 서버를 포함한 단일 실행 가능. GO (Golang)로 작성되었습니다. Chisel은 주로 방화벽을 통과하는 데 유용하지만 네트워크에 안전한 엔드 포인트를 제공하는 데 사용될 수도 있습니다.
crypto/ssh
통해)ssh -o ProxyCommand
지원하는 stdio에 대한 클라이언트 연결 HTTP를 통해 ssh를 제공합니다. curl https://i.jpillora.com/chisel! | bash
docker run --rm -it jpillora/chisel --help
패키지는 페도라 커뮤니티에서 유지 관리합니다. RPM 사용과 관련된 문제가 발생하면이 문제 추적기를 사용하십시오.
sudo dnf -y install chisel
$ go install github.com/jpillora/chisel@latest
Heroku의 데모 앱 이이 chisel server
실행 중입니다.
$ chisel server --port $PORT --proxy http://example.com
# listens on $PORT, proxy web requests to http://example.com
이 데모 앱은 또한 :3000
에서 간단한 파일 서버를 실행하고 있으며, 일반적으로 Heroku의 방화벽으로 인해 접근 할 수 없습니다. 그러나 다음과 함께 터널을 사용하는 경우
$ chisel client https://chisel-demo.herokuapp.com 3000
# connects to chisel server at https://chisel-demo.herokuapp.com,
# tunnels your localhost:3000 to the server's localhost:3000
그런 다음 LocalHost : 3000을 방문하면 디렉토리 목록이 표시됩니다. 또한 브라우저에서 데모 앱을 방문하면 서버의 기본 프록시를 치고 example.com의 사본을 볼 수 있습니다.
$ 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
Signals:
The chisel process is listening for:
a SIGUSR2 to print process stats, and
a SIGHUP to short-circuit the client reconnect timer
Version:
X.Y.Z
Read more:
https://github.com/jpillora/chisel
$ chisel client --help
Usage: chisel client [options] <server> <remote> [remote] [remote] ...
<server> is the URL to the chisel server.
<remote>s are remote connections tunneled through the server, each of
which come in the form:
<local-host>:<local-port>:<remote-host>:<remote-port>/<protocol>
■ local-host defaults to 0.0.0.0 (all interfaces).
■ local-port defaults to remote-port.
■ remote-port is required*.
■ remote-host defaults to 0.0.0.0 (server localhost).
■ protocol defaults to tcp.
which shares <remote-host>:<remote-port> from the server to the client
as <local-host>:<local-port>, or:
R:<local-interface>:<local-port>:<remote-host>:<remote-port>/<protocol>
which does reverse port forwarding, sharing <remote-host>:<remote-port>
from the client to the server's <local-interface>:<local-port>.
example remotes
3000
example.com:3000
3000:google.com:80
192.168.0.5:3000:google.com:80
socks
5000:socks
R:2222:localhost:22
R:socks
R:5000:socks
stdio:example.com:22
1.1.1.1:53/udp
When the chisel server has --socks5 enabled, remotes can
specify "socks" in place of remote-host and remote-port.
The default local host and port for a "socks" remote is
127.0.0.1:1080. Connections to this remote will terminate
at the server's internal SOCKS5 proxy.
When the chisel server has --reverse enabled, remotes can
be prefixed with R to denote that they are reversed. That
is, the server will listen and accept connections, and they
will be proxied through the client which specified the remote.
Reverse remotes specifying "R:socks" will listen on the server's
default socks port (1080) and terminate the connection at the
client's internal SOCKS5 proxy.
When stdio is used as local-host, the tunnel will connect standard
input/output of this program with the remote. This is useful when
combined with ssh ProxyCommand. You can use
ssh -o ProxyCommand='chisel client chiselserver stdio:%h:%p'
[email protected]
to connect to an SSH server through the tunnel.
Options:
--fingerprint, A *strongly recommended* fingerprint string
to perform host-key validation against the server's public key.
Fingerprint mismatches will close the connection.
Fingerprints are generated by hashing the ECDSA public key using
SHA256 and encoding the result in base64.
Fingerprints must be 44 characters containing a trailing equals (=).
--auth, An optional username and password (client authentication)
in the form: "<user>:<pass>". These credentials are compared to
the credentials inside the server's --authfile. defaults to the
AUTH environment variable.
--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).
--max-retry-count, Maximum number of times to retry before exiting.
Defaults to unlimited.
--max-retry-interval, Maximum wait time before retrying after a
disconnection. Defaults to 5 minutes.
--proxy, An optional HTTP CONNECT or SOCKS5 proxy which will be
used to reach the chisel server. Authentication can be specified
inside the URL.
For example, http://admin:[email protected]:8081
or: socks://admin:[email protected]:1080
--header, Set a custom header in the form "HeaderName: HeaderContent".
Can be used multiple times. (e.g --header "Foo: Bar" --header "Hello: World")
--hostname, Optionally set the 'Host' header (defaults to the host
found in the server url).
--sni, Override the ServerName when using TLS (defaults to the
hostname).
--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).
--pid Generate pid file in current working directory
-v, Enable verbose logging
--help, This help text
Signals:
The chisel process is listening for:
a SIGUSR2 to print process stats, and
a SIGHUP to short-circuit the client reconnect timer
Version:
X.Y.Z
Read more:
https://github.com/jpillora/chisel
암호화는 항상 활성화됩니다. Chisel Server를 시작하면 Memory Inmory ECDSA Public/Private Key 쌍이 생성됩니다. 서버가 시작될 때 공개 키 지문 (Base64 인코딩 된 SHA256)이 표시됩니다. 임의의 키를 생성하는 대신 서버는 --keyfile
옵션을 사용하여 선택적으로 키 파일을 지정할 수 있습니다. 클라이언트가 연결되면 서버의 공개 키 지문도 표시됩니다. 클라이언트는 --fingerprint
옵션을 사용하여 특정 지문을 강제 할 수 있습니다. 자세한 내용은 위의 --help
헬프를 참조하십시오.
--authfile
옵션을 사용하여 서버는 선택적으로 user.json
구성 파일을 제공하여 허용 된 사용자 목록을 작성할 수 있습니다. 그런 다음 클라이언트는 --auth
옵션을 사용하여 인증합니다. 인증 구성 파일 예제는 user.json을 참조하십시오. 자세한 내용은 위의 --help
헬프를 참조하십시오.
내부적으로 이것은 SSH에서 제공하는 비밀번호 인증 방법을 사용하여 수행됩니다. crypto/ssh
에 대해 자세히 알아보십시오.
새로운 개인 키를 터미널에 인쇄하십시오
chisel server --keygen -
# or save it to disk --keygen /path/to/mykey
Chisel 서버를 시작하십시오
jpillora/chisel server --keyfile ' <ck-base64 string or file path> ' -p 9312 --socks5
Chisel 클라이언트 연결 (서버의 지문 사용)
chisel client --fingerprint ' <see server output> ' < server-address > :9312 socks
Socks5 클라이언트 (예 : OS/브라우저)를 다음과 같이 지적하십시오.
<client-address>:1080
이제 http에 대한 암호화 된 인증 된 Socks5 연결이 있습니다.
Websockets 지원이 필요하기 때문에 :
github.com/jpillora/chisel/share
에는 공유 패키지가 포함되어 있습니다github.com/jpillora/chisel/server
에는 서버 패키지가 포함되어 있습니다github.com/jpillora/chisel/client
에는 클라이언트 패키지가 포함되어 있습니다 1.0
초기 릴리스1.1
ECDSA SSH의 간단한 대칭 암호화를 대체했습니다1.2
추가 된 Socks5 (Server) 및 HTTP Connect (클라이언트) 지원1.3
리버스 터널링 지지대가 추가되었습니다1.4
임의의 HTTP 헤더 지원이 추가되었습니다1.5
추가 된 리버스 양말 지지대 (@AUS)1.6
추가 된 클라이언트 Stdio 지원 (@Boleynsu에 의해)1.7
UDP 지원이 추가되었습니다1.8
scratch
Docker 이미지로 이동하십시오1.9
-Go 1.21 범프. --key{gen,file}
(@cmenginnz)을 사용하여 --key
seed에서 p256으로 전환하십시오.1.10
-Go 1.22 범프. 릴리스에 .rpm
.deb
및 .akp
추가하십시오. 나쁜 버전 비교를 수정하십시오. MIT © Jaime Pillora