Crash if the correct password is at the end of the list

Open
#69 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

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

Research direction

The report reproduces a segmentation fault in Ncrack 0.7 when a password succeeds at the end of a list; it also notes the same behavior with -P. Start by reproducing the two-password command and tracing how successful authentication affects later connection scheduling. Done means both examples finish without a crash while reporting the discovered credentials.

Written by the indexing model from the issue text.

Description

Crash if the correct password is at the end of the list
➜   ncrack --user root --pass WongPassword,CorrectPassword ssh://172.16.178.177 -d9

Starting Ncrack 0.7 ( http://ncrack.org ) at 2019-11-20 16:20 CST

ssh://172.16.178.177:22 (EID 1) Initiating new Connection
ssh://172.16.178.177:22 pushed to list FULL
ssh://172.16.178.177:22 (EID 1) Login failed: 'root' 'WongPassword'
Discovered credentials on ssh://172.16.178.177:22 'root' 'CorrectPassword'
ssh://172.16.178.177:22 popped from list FULL
ssh://172.16.178.177:22 (EID 1) Attempts: total 2 completed 2 supported 2 --- rate 0.90
ssh://172.16.178.177:22 (EID 2) Initiating new Connection
ssh://172.16.178.177:22 (EID 3) Initiating new Connection
ssh://172.16.178.177:22 (EID 4) Initiating new Connection
ssh://172.16.178.177:22 (EID 5) Initiating new Connection
ssh://172.16.178.177:22 (EID 6) Initiating new Connection
ssh://172.16.178.177:22 (EID 7) Initiating new Connection
ssh://172.16.178.177:22 (EID 8) Initiating new Connection
ssh://172.16.178.177:22 (EID 9) Initiating new Connection
ssh://172.16.178.177:22 (EID 10) Initiating new Connection
ssh://172.16.178.177:22 (EID 11) Initiating new Connection
ssh://172.16.178.177:22 pushed to list FULL
[1]    25596 segmentation fault  ncrack --user root --pass WongPassword,CorrectPassword ssh://172.16.178.177 -d9
➜  ncrack --user root --pass WongPassword,CorrectPassword,WongPassword2 ssh://172.16.178.177 -d9

Starting Ncrack 0.7 ( http://ncrack.org ) at 2019-11-20 16:20 CST

ssh://172.16.178.177:22 (EID 1) Initiating new Connection
ssh://172.16.178.177:22 pushed to list FULL
ssh://172.16.178.177:22 (EID 1) Login failed: 'root' 'WongPassword'
Discovered credentials on ssh://172.16.178.177:22 'root' 'CorrectPassword'
ssh://172.16.178.177:22 popped from list FULL
ssh://172.16.178.177:22 (EID 1) Attempts: total 2 completed 2 supported 2 --- rate 0.82
ssh://172.16.178.177:22 (EID 2) Initiating new Connection
ssh://172.16.178.177:22 Password list finished!
ssh://172.16.178.177:22 pushed to list FINISHING
ssh://172.16.178.177:22 (EID 2) Login failed: 'root' 'WongPassword2'
ssh://172.16.178.177:22 last: 0.00 current 0.44 parallelism 10
ssh://172.16.178.177:22 Increasing connection limit to: 13
ssh://172.16.178.177:22 pushed to list FINISHED
ssh://172.16.178.177:22 finished.
ssh://172.16.178.177:22 (EID 2) Attempts: total 3 completed 3 supported 2 --- rate 0.67
nsock_loop returned 3

Discovered credentials for ssh on 172.16.178.177 22/tcp:
172.16.178.177 22/tcp ssh: 'root' 'CorrectPassword'

Ncrack done: 1 service scanned in 6.01 seconds.
Probes sent: 2 | timed-out: 0 | prematurely-closed: 0

Ncrack finished.
-P is the same
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.