Skip to content

Commit f743a6b

Browse files
committed
Update README.md
1 parent 144ed94 commit f743a6b

File tree

1 file changed

+28
-16
lines changed

1 file changed

+28
-16
lines changed

README.md

Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,21 @@
1-
# WinSocat [![Testing](https://github.com/firejox/WinSocat/actions/workflows/unit-test.yml/badge.svg)](https://github.com/firejox/WinSocat/actions/workflows/unit-test.yml) [![](https://img.shields.io/github/v/release/firejox/WinSocat?include_prereleases)](https://github.com/firejox/WinSocat/releases/latest)
1+
# WinSocat [![Testing][ci-badge]][ci] [![Release][release-badge]][release] [![Nuget][nuget-badge]][nuget]
22

3-
WinSocat is a socat-like program specific on Windows platform. It can bridge Windows named pipe and other general I/O, e.g., STDIO, TCP, the STDIO of Process.
4-
5-
## Prerequisite
3+
[ci]: https://github.com/firejox/WinSocat/actions/workflows/unit-test.yml
4+
[ci-badge]: https://github.com/firejox/WinSocat/actions/workflows/unit-test.yml/badge.svg
5+
[release]: https://github.com/firejox/WinSocat/releases
6+
[release-badge]: https://img.shields.io/github/v/release/firejox/WinSocat?include_prereleases
7+
[nuget]: https://www.nuget.org/packages/winsocat
8+
[nuget-badge]: https://img.shields.io/nuget/vpre/winsocat
69

7-
WinSocat is built under .Net 6.0. Make sure the corresponding .Net runtime is installed before using it.
10+
WinSocat is a socat-like program specific on Windows platform. It can bridge Windows named pipe and other general I/O, e.g., STDIO, TCP, the STDIO of Process.
811

912
## Installation
1013

11-
You can download binary from [release](https://github.com/firejox/WinSocat/releases), or build from source.
14+
[Install .NET 6 or newer](https://get.dot.net) and install via `dotnet tool`
15+
16+
```
17+
dotnet tool install -g winsocat
18+
```
1219

1320
## Command Form
1421

@@ -18,41 +25,46 @@ The WinSocat is accept two address pattern
1825
winsocat.exe [address1] [address2]
1926
```
2027

21-
The `address1` can accept `STDIO`, `TCP-LISTEN`, `TCP`, `NPIPE`, `NPIPE-LISTEN`, `EXEC`, `WSL` socket types.
28+
The `address1` can accept `STDIO`, `TCP-LISTEN`, `TCP`, `NPIPE`, `NPIPE-LISTEN`, `EXEC`, `WSL`, `UNIX`, `UNIX-LISTEN` socket types.
2229

23-
The `address2` can accept `STDIO`, `TCP`, `NPIPE`, `EXEC`, `WSL` socket types.
30+
The `address2` can accept `STDIO`, `TCP`, `NPIPE`, `EXEC`, `WSL`, `UNIX` socket types.
2431

2532
## Examples
2633

2734
* It can bridge standard input/output and tcp connection to address **127.0.0.1** on port **80**.
2835
```
29-
winsocat.exe STDIO TCP:127.0.0.1:80
36+
winsocat STDIO TCP:127.0.0.1:80
3037
```
3138

3239
* It can forward from Windows named pipe to remote tcp socket.
3340
```
34-
winsocat.exe NPIPE-LISTEN:myPipe TCP:127.0.0.1:80
41+
winsocat NPIPE-LISTEN:myPipe TCP:127.0.0.1:80
3542
```
3643

3744
* It can use Windows named pipe for network connection
3845
```
39-
winsocat.exe NPIPE:RemoteServer:RemotePipe STDIO
46+
winsocat NPIPE:RemoteServer:RemotePipe STDIO
4047
```
4148

4249
* It can create reverse shell.
4350
```
44-
winsocat.exe EXEC:C:\Windows\syetem32\cmd.exe TCP:127.0.0.1:8000
51+
winsocat EXEC:C:\Windows\syetem32\cmd.exe TCP:127.0.0.1:8000
52+
```
53+
54+
* It can bridge Windows named pipe and [unix socket on Windows](https://devblogs.microsoft.com/commandline/af_unix-comes-to-windows/)
55+
```
56+
winsocat NPIPE-LISTEN:fooPipe UNIX:foo.sock
4557
```
4658

4759
### Interact with WSL(Windows Subsystem for Linux)
4860

4961
WinSocat provide the syntax sugar for WSL program. Hence, this example
5062
```
51-
winsocat.exe STDIO WSL:cat,distribution=Ubuntu,user=root
63+
winsocat STDIO WSL:cat,distribution=Ubuntu,user=root
5264
```
5365
would be equivalent to
5466
```
55-
winsocat.exe STDIO EXEC:"C:\Windows\System32\wsl.exe -d Ubuntu -u root cat"
67+
winsocat STDIO EXEC:"C:\Windows\System32\wsl.exe -d Ubuntu -u root cat"
5668
```
5769
if `wsl.exe` is located on `C:\Windows\System32`.
5870

@@ -61,10 +73,10 @@ You can combine the `socat` of WSL distribution for the communication between WS
6173

6274
* Windows named pipe forwarding to WSL Unix Socket
6375
```
64-
winsocat.exe NPIPE-LISTEN:fooPipe WSL:"socat STDIO unix-connect:foo.sock"
76+
winsocat NPIPE-LISTEN:fooPipe WSL:"socat STDIO unix-connect:foo.sock"
6577
```
6678

6779
* WSL Unix Socket forwarding to Windows named pipe
6880
```
69-
socat unix-listen:foo.sock EXEC:"/path/to/winsocat.exe STDIO NPIPE:fooPipe"
81+
socat unix-listen:foo.sock,fork EXEC:"/path/to/winsocat.exe STDIO NPIPE:fooPipe"
7082
```

0 commit comments

Comments
 (0)