DEV Community

Wincent Balin
Wincent Balin

Posted on • Originally published at ofdigitalwater.postach.io on

1 1

Static netcat .exe files

Today we are going to create static .exe binaries for netcat.

While there are many ports and reimplementations of netcat, we are going to stick with win32 ports for netcat 1.11 or netcat 1.12 (the latter one enables sending CRLF line endings instead of CR using command line option -c).

We will use MXE as our cross-compilation environment. Compile the cc package as described in the tutorial. Add the directory with cross-compilers to your PATH.

Then download and unpack the source from the win32 ports above and issue the following commands:

i686-w64-mingw32.static-gcc -DNDEBUG -DWIN32 -D_CONSOLE -DTELNET -DGAPING_SECURITY_HOLE getopt.c doexec.c netcat.c -O2 -s -static -lkernel32 -luser32 -lwsock32 -lwinmm -o nc.exe
Enter fullscreen mode Exit fullscreen mode

and

x86_64-w64-mingw32.static-gcc -DNDEBUG -DWIN32 -D_CONSOLE -DTELNET -DGAPING_SECURITY_HOLE getopt.c doexec.c netcat.c -O2 -s -static -lkernel32 -luser32 -lwsock32 -lwinmm -o nc64.exe
Enter fullscreen mode Exit fullscreen mode

to compile the 32-bit and 64-bit version respectively.

I compiled netcat 1.12 for you and placed it into a Dropbox folder.

If you decide to use them, here are the MD5 checksums:

f630164e41932360440f43602f670d21 nc64.exe
bc3029d3e79265f9ab2e906009adb196 nc.exe
Enter fullscreen mode Exit fullscreen mode

Here is the list with the netcat tutorials:

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay