64 Commits

Author SHA1 Message Date
guangwu dca1156401 chore: remove refs to deprecated io/ioutil (#459)
thanks @testwill
2023-10-19 22:58:31 +11:00
Jaime Pillora 69093be1d9 Bump to Go 1.21 (#440)
Co-authored-by: cmeng <cmenginnz@gmail.com>
2023-08-19 11:00:41 +10:00
Guillaume SMAHA e78ccc3497 Fix missing NetDialContext: c.config.DialContext (#398) 2023-01-28 08:00:02 +11:00
zuzgon 200a8e25d7 Providing chisel's client with a logger level (#281)
Co-authored-by: Barak Sharoni <barak.sharoni@velocity.tech>
Co-authored-by: barak-sharoni-velocity <81081183+barak-sharoni-velocity@users.noreply.github.com>
2022-10-31 15:56:27 +11:00
ip-rw a64df5e37c Set ServerName (SNI) to *hostname. Useful for spoofing our way through restrictive gateways. 2022-08-26 20:41:34 +01:00
Ayelet Ackerfeld 2f82e23498 fix retry mechanism 2022-05-25 18:11:08 +03:00
pg dev d17765d425 Fix keepalive
Pass the client config keepalive to the tunnel config.
2021-11-27 13:37:17 -05:00
Jaime Pillora 6ddc09d281 document udp, log client connection failures, expose more settings via env-vars 2020-11-17 04:53:43 +11:00
Simon Rüegg 2d6c5cba61 Update client to fall-back to MD5 fingerprints
Signed-off-by: Simon Rüegg <simon@rueggs.ch>
2020-11-10 08:44:36 +01:00
Jaime Pillora a9cecff823 support android retries 2020-10-19 04:53:48 +11:00
Jaime Pillora 59d78358cc merge mtls (thanks @wxia20) 2020-09-03 07:08:55 +10:00
Jaime Pillora 0edc0e5399 Merge remote-tracking branch 'wxia/mTLS_authentication' 2020-09-01 07:08:18 +10:00
Will Xia 3542fb8e85 address PR code review feedback 2020-08-30 08:18:26 -04:00
Jaime Pillora 798ec04a6b fix stdio "cannot listen", fix udp goroutine leak 2020-08-29 01:27:08 +10:00
Will Xia 7ca9034c47 mTLS authentication feature.
1. Adding client cert and key to Chisel client.
2. Adding trusted CAs to Chisel server.
3. Adding TLS/mTLS e2e test case and test certs and keys.
4. Adding flag and help comments.
2020-08-24 18:17:38 -04:00
Jaime Pillora 4f33489f62 fix multiple getters panic 2020-08-22 22:29:13 +10:00
Jaime Pillora 7c997d2db8 added client tls skip-verify and ca flags (closes #129 closes #116)
thanks to @mvladev and @alfonso-presa, I couldn't merge your PRs since I've done a massive refactor, though I borrowed snippets from them
2020-07-23 07:12:49 +10:00
Jaime Pillora e3abdc607e udp listener cleanup, add early port listen checks 2020-07-23 01:26:47 +10:00
Jaime Pillora 33fa2010ab refactor 2020-07-20 20:17:24 +10:00
Jaime Pillora edad853073 improved teardown and logging 2020-07-19 04:46:49 +10:00
Jaime Pillora 53e72fe2ba add udp support, massive refactor and more (see below)
* split out share/ package into multiple subpackages
* added share/compat.go to keep backward compatibility(ish)
* moved shared tunnelling logic from client/server packages into share/tunnel/
* added remote protocol "<host>:<port>/<protocol>", currently supporting tcp and udp
* added an end-to-end test suite
* added TODO e2e tests as contribution targets
* added deep context integration for improved cleanup and cancellation
2020-07-18 11:05:53 +10:00
Jaime Pillora 591f95885f merge client stdio support (closes #166 thanks @BoleynSu!) 2020-06-17 21:44:37 +10:00
Boleyn Su a16c592dc8 This commit implements Feature Request #59
Now we can use the following command to connect to an SSH server through a chisel tunnel.
```bash
ssh -o ProxyCommand='/path/to/chisel client https://chisel.boleyn.su stdio:%h:%p' me@boleyn.su
```
2020-06-13 20:20:43 +09:00
Jaime Pillora 7aa0da95db doc changes, fixed docker auto-build, moved licence to standalone file 2020-05-20 22:08:17 +10:00
Jaime Pillora 68050d031a merge client reverse+socks PR by @aus (closes #78)
- @aus's branch also includes PR for
custom headers, thanks @AkeemMcLennon  (closes #90)
- support client connections via socks
- add more architectures to the built releases
- remove vendor (go.sum will enforce correct deps)
2020-05-20 21:13:48 +10:00
Jaime Pillora 04d4f30dd6 upgrade deps, rename test/ to bench/, add goreleaser 2020-04-02 01:31:42 +11:00
aus 3f2899c789 derp 2019-08-28 17:04:35 -05:00
aus 1427263568 merge http header PR 2019-08-28 17:00:57 -05:00
aus fc9f50a1a6 expose NetDialContext 2019-08-28 12:15:23 -05:00
aus c95714667e fix Client struct 2019-08-28 12:01:32 -05:00
aus a8075a0d69 merge PRs 2019-08-28 11:57:47 -05:00
aus 6d83df33d1 Merge branch 'client-socks' of https://github.com/aus/chisel into red 2019-08-28 11:46:40 -05:00
aus c9b6bf910c change import url to aus/chisel 2019-08-28 11:44:25 -05:00
Meteorite fc1a0c0622 say explicitly that only socks5h:// socks proxy variant is supported, and socks:// defaults to socks5h:// 2019-08-27 22:01:56 +03:00
Akeem McLennon 078007ee13 Add support for custom headers 2019-03-27 19:14:59 -05:00
aus 0791425d44 add nil check for c.socksServer 2019-02-24 17:47:24 -06:00
aus 8607fa10b4 rework to support remote R:socks syntax 2019-02-23 15:09:25 -06:00
Meteorite 622272bf2e format recent changes with go fmt 2019-02-10 12:35:23 +03:00
Meteorite 7497a3acca add support for connecting to chisel server via socks5 proxy in client 2019-02-09 22:58:05 +03:00
aus 7eba7410fd add client-outbound SOCKS support 2019-02-02 22:06:16 -06:00
Jaime Pillora ee6601a6bb update help text 2019-01-28 20:22:58 +11:00
Nathan cefd86aab8 Add HOST header 2019-01-19 18:50:35 +00:00
Jaime Pillora d96b66e70b merged #72 which adds reverse tunnelling (thanks @sunshineco!), fixed potential race, USR2 to print go stats, many small cleanups 2018-12-29 22:51:40 +11:00
Eric Sunshine 8724c90273 support reverse port forwarding
Normal port forwarding shares server ports to the client, allowing the
client to access ports on the server (or ports on other machines
accessible from the server). Sometimes, however, it is necessary to
share ports in the opposite direction, allowing the server to access
ports on the client (or ports on other machines accessible from the
client). Reverse port forwarding is analogous to ssh's -R forwarding
which complements normal -L forwarding.

Reverse port forwarding remotes are specified as
"R:<local-interface>:<local-port>:<remote-host>:<remote-port>", where
<local-interface> and <local-port> refer to the server side, and
<remote-host> and <remote-port> refer to the client side. For instance,
"R:2222:localhost:22" forwards port 2222 on the server to port 22 on the
client.
2018-12-23 16:25:44 -05:00
Eric Sunshine 5b5e3fafb9 remote: introduce notation for reverse port forwarding
An upcoming enhancement will add reverse port forwarding support (client
sharing its ports to the server) to complement the existing port
forwarding (server sharing its ports to the client). As a first step,
introduce notation for specifying a remote for reverse port forwarding;
i.e. "R:<local-interface>:<local-port>:<remote-host>:<remote-port>".

At this stage, reverse port forwarding remotes are recognized but never
actually created. A subsequent change will flesh out the functionality.
2018-12-23 16:25:44 -05:00
Eric Sunshine 58a7bc5518 proxy: support cancellation via context.Context
Once started, a TCPProxy never stops listening on the specified port.
This typically isn't a problem for the command-line chisel client since
the only time a proxy should stop listening is when the client itself
terminates. However, it will become a problem when chisel eventually
supports reverse port forwarding since the proxy will instead be running
on the server side, and the server will need to tear down those
listeners when the client disconnects. Therefore, teach TCPProxy to
shutdown via context.Context cancellation.
2018-12-23 16:25:44 -05:00
Eric Sunshine 25d9ab6293 proxy: relocate from client/ to share/
chclient.tcpProxy is sufficiently general to handle TCP port
forwarding for both client and server. Therefore, move it to share/ so
it can be re-used by the server when chisel learns to support reverse
port forwarding, in which case the proxy will be listening on the
server rather than the client as with normal port forwarding.
2018-12-23 16:25:44 -05:00
Eric Sunshine 666acf8424 client/proxy: divorce from chclient.Client
Aside from minor dependencies upon chclient.Client, chclient.tcpProxy is
sufficiently general to handle TCP port forwarding beyond the client
itself. For instance, when chisel learns to support reverse port
forwarding, in which case the proxy will be listening on the server
rather than the client, it will make sense to re-use the existing proxy
code rather than duplicating it. Therefore, divorce the proxy code from
chclient.Client, freeing it up for use by the server too.
2018-12-23 16:25:44 -05:00
Eric Sunshine a3be26f9c5 client: stop leaking "keep-alive" go-routine
When keep-alive is enabled, Client.loop() creates a go-routine to
provide the functionality, however, the go-routine never exits, not even
when the client's SSH connection to the server has been torn down, thus
leaking the go-routine.

This typically isn't a problem for the command-line chisel client since
it is single-use; the SSH connection is torn down only when the client
is terminating anyway. However, such a go-routine leak could become
problematic if the client ever learns to manage multiple SSH connections
(perhaps, say, via an interactive mode) or when chisel is used as a
library by some other program which manages multiple connections.
Therefore, ensure that the go-routine terminates when the SSH connection
is torn down.
2018-12-23 16:25:44 -05:00
Eric Sunshine 7cfb8e424c fix documentation, comment, status message typos 2018-12-23 16:25:44 -05:00