RDP scan fails with nsock read timeout

Open
#94 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
c, linux
Domain
networking

Research direction

The report names no source file or test. Start by reproducing the RDP timeout with the provided Ncrack command, then inspect the RDP service handling and nsock read timeout path; the build error also points to nsock/src/nsock_pcap.h and a missing pcap.h dependency. Done means identifying and fixing the cause of the RDP scan timeout, with a regression check showing the scan proceeds against a working RDP target.

Written by the indexing model from the issue text.

Description

Situation:
Testing security hardware/software from a virtual machine to a different virtual machine behind the device. I can log in to the target virtual machine from my attacker virtual machine using either xfreerdp or rdesktop, so I know RDP is working. From a Kali virtual box, I run (obviously, the command is anonymized):

ncrack -vv -d9 -user vagrant -P <password list, generated by rockyou.txt> -p rdp: 10.x.y.z -T5

The debug info shows (obviously, this is one of many iterations of the same read timeout):
rdp://10.201.200.200:33890 Pool: extract 'vagrant' 'butterfly'
rdp://10.201.200.200:33890 (EID 100) Initiating new Connection
rdp://10.201.200.200:33890 pushed to list FULL
rdp://10.201.200.200:33890 Pool: Append 'vagrant' 'justin'
rdp://10.201.200.200:33890 (EID 49) nsock READ timeout!
rdp://10.201.200.200:33890 popped from list FULL
rdp://10.201.200.200:33890 (EID 49) Attempts: total 0 completed 0 supported 0 --- rate 0.00

This is using the version of ncrack that comes with Kali Linux rolling. I tried installing the new version 0.8 by git cloning it and running the configure. When I try to make, it fails on nsock with the following errors:

In file included from nsock_core.c:86:
nsock_pcap.h:64:10: fatal error: pcap.h: No such file or directory
64 | #include "pcap.h"
| ^~~~~~~~
compilation terminated.
make[1]: *** [Makefile:48: nsock_core.o] Error 1
make[1]: Leaving directory '/home/vagrant/ncrack/nsock/src'
make: *** [Makefile:83: nsock_build] Error 2

I tried just doing the nsock/src configure and build, but got the same errors.

NOTE!!! I might just be being an idiot. This might be a simple thing I'm missing. While this is always a possibility for any user, it is a stronger likelihood with me, as I am the anti-Yogi. I am significantly dumber than the average Bear. (And also old enough to make Hannah Barbera jokes...) But any help you can offer would be deeply appreciated. Thank you.

Dominant language
C
Stars
1.2k
Forks
275
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from nmap/ncrack

All issues in nmap/ncrack

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.