wsshuttle
Tunneling into private networks via WinRM
Usage
python3 -m wsshuttle -u <username> -i <target jump box> -b <ip for wsshuttle to listen on> -m 192.168.24.0/24
How does it work?
- First, wsshuttle establishes a session on the WinRM service indicated
- It then opens a tcp server listening locally on port 6000
- An iptables rule (chain
wsshuttlein tablenetstat) is added that redirects all traffic to the indicated subnet (-moption) - Upon receiving a redirected connection, the original destination of the connection is retrieved, and a TCP listener is opened
- Meanwhile, a small C# program is uploaded, compiled an executed via PowerShell. It connects to the target service, as well as connecting back to the newly opened TCP listener, and relays traffic between the sockets
- Similarly, the TCP listener is connected to the original connection from the user, and the traffic is relayed over multiple hops to the target service
Upon exiting wsshuttle, the wsshuttle iptables chain is set to return instantly, to prevent traffic from being redirected to a closed port.
Error Handling
WinRM does not seem to be suited to long-running sessions. If an error is detected while running a command, wshuttle will throw away the current shell and open a new one. If this fails, the current WinRM session will be discarded, and a new one will be opened. This will be attempted repeatedly - if this process fails 5 times in a row, the connection will be deemed irrecoverable and wsshuttle will exit.
Metadata
Release files for wsshuttle 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| wsshuttle-0.0.1-py3-none-any.whl | Python 3 | none | any | Details for wsshuttle-0.0.1-py3-none-any.whl |
Release files / wsshuttle-0.0.1-py3-none-any.whl
| Download URL | wsshuttle-0.0.1-py3-none-any.whl |
|---|---|
| Size | 7.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3c9321974dc8ef4a434c2ea51e25547453c46a556c7511b2bc60dd4d3db73709
|
|
BLAKE2b-256 checksum How to use checksums |
a630330159e69f7b1e0cea89d9fef436593f8709fc92d6186165450cbb6ac7a3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.2
|
Security for wsshuttle 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.