Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a list of supported netcat implementations #66

Open
solusipse opened this issue Oct 30, 2017 · 2 comments
Open

Create a list of supported netcat implementations #66

solusipse opened this issue Oct 30, 2017 · 2 comments

Comments

@solusipse
Copy link
Owner

In the past, we've received some reports of issues that were caused by using netcat implementations incompatible with fiche (e.g. #14, #45). It would be nice to give users a list of those that are recommended.

Please feel free to add your recommendations in the comments.

Supported netcat implementations

@dashezup
Copy link

dashezup commented Nov 19, 2020

I tried to test some netcat implementation on my server and nc on macOS, here is the result. (may does not make much sense to compare accurate result, but check which cost less than 1 second and which cost more than 5 seconds is enough)

nc (GNU) 5.342
openbsd-nc 5.324
openbsd-nc -N 0.232
ncat 0.267
libressl-nc 5.234
libressl-nc -N 0.219
nc (macOS) 0.893

I just create alias and run it

$ alias tb="uname | nc termbin.com 9999"
$ time tb

slow as for reach the timeout to finish, since the default timeout is 5 seconds which set on server, it cost more than 5 seconds to finish. fast as for expected speed usually finish in 1 second.

As someone mentioned that in 2015 the GNU netcat seems send the end of stream by default, it was fast at that time. I guess it was changed since then, GNU netcat does not similar option of BSD version's -N, that's why it's slow.

implementation slow fast
nc (GNU netcat) (0.7.1) default
libressl-netcat (3.1.4) default -N
openbsd-netcat (1.217) default -N
ncat (nmap) (7.91) --no-shutdown default
nc on macOS default

both of this pure bash/zsh way are slow, I didn't figure out a way to solve this.

# bash
alias tb="(exec 3<>/dev/tcp/termbin.com/9999; cat >&3; cat <&3; exec 3<&-)"
# zsh
tb() { zmodload zsh/net/tcp; ztcp ezup.dev 9999; cat >&$REPLY; cat <&$REPLY; ztcp -c $REPLY }

@jsarenik
Copy link

busybox nc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants