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

Statistical inaccuracy #1113

Open
zlgxzswjy opened this issue Jun 12, 2024 · 6 comments
Open

Statistical inaccuracy #1113

zlgxzswjy opened this issue Jun 12, 2024 · 6 comments
Assignees
Labels
Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors.

Comments

@zlgxzswjy
Copy link

zlgxzswjy commented Jun 12, 2024

Naabu version: 2.3.1

Current Behavior:

I made an ip x.x.x.x using-host and enabled the-stats -mp 63636 parameter,But when I request http://localhost:63636/metrics , the json returned prompts me that the number of "hosts": 2

Expected Behavior:

Number of hosts should be 1

Steps To Reproduce:

Example: steps to reproduce the behavior:

  1. Run 'naabu -host 47.101.211.147 -p - -stats -mp 63636'
  2. curl http://localhost:63636/metrics|jq

% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 169 100 169 0 0 19580 0 --:--:-- --:--:-- --:--:-- 21125
{
"total": 393210,
"packets": 3500,
"hosts": 2,
"retries": 3,
"errors": 0,
"startedAt": "2024-06-12T15:45:55.953068423+08:00",
"hosts_with_port": 0,
"ports": 65535,
"duration": "0:00:07"
}

Anything else:

@zlgxzswjy zlgxzswjy added the Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors. label Jun 12, 2024
@dogancanbakir dogancanbakir self-assigned this Jun 12, 2024
@zlgxzswjy
Copy link
Author

zlgxzswjy commented Jun 12, 2024

When I add-Pn, The command becomes: naabu -host 47.101.211.147 -Pn -p - -stats -mp 63636。the statistics are correct.
So is it just a statistical error, or are there really a lot of duplicate requests?

*Switch to version 2.1.6 for testing, regardless of whether there is a-Pn parameter, the statistical results are correct, and obviously much faster

@dogancanbakir
Copy link
Member

Can you retry with dev branch? Thanks

go install -v github.com/projectdiscovery/naabu/v2/cmd/naabu@dev

@Mzack9999
Copy link
Member

Just guessing, but that's possible that statistics are wrongly incremented during host-discovery phase. Whereas if we have both service-discovery + port-scan probably we should consider only portscan as relevant, or split the statistics in two parts for the respective phases.

@zlgxzswjy
Copy link
Author

Can you retry with dev branch? Thanks

go install -v github.com/projectdiscovery/naabu/v2/cmd/naabu@dev

I try this dev branch with the same commad,the json also returned prompts me : "hosts": 2

@dogancanbakir
Copy link
Member

I couldn't repro this issue - used the dev branch for testing.

$ go run . -host 47.101.211.147 -p - -stats -mp 63636

                  __
  ___  ___  ___ _/ /  __ __
 / _ \/ _ \/ _ \/ _ \/ // /
/_//_/\_,_/\_,_/_.__/\_,_/

                projectdiscovery.io

[INF] Current naabu version 2.3.1 (latest)
[INF] Running CONNECT scan with non root privileges
Target: 47.101.211.147/32, Target Count: 1
47.101.211.147:32080
47.101.211.147:43080
$ curl -s http://localhost:63636/metrics | jq .hosts
1

@zlgxzswjy
Copy link
Author

zlgxzswjy commented Jul 1, 2024

This may be a problem with my cloud service provider. I scan the same ip on my local arch linux,hosts is indeed 1, but when placed on my Aliyun ECS, hosts is still 3 or 2,And debug output the following information:

[DBG] Can not send packet to ffff:ffff:800:4514:28:0:4000:f706:32748 port: Invalid source IPv6 address (wrong length of 0 bytes instead of 16)
[DBG] Can not send packet to ffff:ffff:800:4514:28:0:4000:f706:44512 port: Invalid source IPv6 address (wrong length of 0 bytes instead of 16)
[DBG] Can not send packet to ffff:ffff:800:4514:28:0:4000:f706:35597 port: Invalid source IPv6 address (wrong length of 0 bytes instead of 16)
[DBG] Can not send packet to ffff:ffff:800:4514:28:0:4000:f706:15332 port: Invalid source IPv6 address (wrong length of 0 bytes instead of 16)
[DBG] Can not send packet to ffff:ffff:800:4514:28:0:4000:f706:11172 port: Invalid source IPv6 address (wrong length of 0 bytes instead of 16)
[DBG] Can not send packet to ffff:ffff:800:4514:28:0:4000:f706:24343 port: Invalid source IPv6 address (wrong length of 0 bytes instead of 16)
[DBG] Can not send packet to ffff:ffff:800:4514:28:0:4000:f706:58715 port: Invalid source IPv6 address (wrong length of 0 bytes instead of 16)
[DBG] Can not send packet to ffff:ffff:800:4514:28:0:4000:f706:9790 port: Invalid source IPv6 address (wrong length of 0 bytes instead of 16)
[DBG] Can not send packet to ffff:ffff:800:4514:28:0:4000:f706:9793 port: Invalid source IPv6 address (wrong length of 0 bytes instead of 16)
[DBG] Can not send packet to ffff:ffff:800:4514:28:0:4000:f706:44531 port: Invalid source IPv6 address (wrong length of 0 bytes instead of 16)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors.
Projects
None yet
Development

No branches or pull requests

3 participants