projectdiscovery / naabu

A fast port scanner written in go with a focus on reliability and simplicity. Designed to be used in combination with other tools for attack surface discovery in bug bounties and pentests
https://projectdiscovery.io
MIT License
4.69k stars 547 forks source link

-display-cdn option creates issue while toolchaining with httpx #907

Closed praveenroot03 closed 8 months ago

praveenroot03 commented 9 months ago

Current Behavior:

While using the Naabu with the option -display-cdn with the silent mode created a additional field denoting CDN of the host. host:port [CDN] Due to this behavior while toolchaining Naabu with httpx fails, because httpx cannot parse the input that contains additional CDN field.

`echo cloudflare.com | naabu -pf top-web-port.txt -verify -sa -o open-ports.txt -c 75 -rate 3000 -display-cdn -silent | httpx -title -status-code -web-server -vhost -screenshot -o http-probe-url.txt -v

[DBG] Store response directory not specified, using "output" [DBG] Failed '/cloudflare.com:8443 [cloudflare]': unsupported protocol scheme "" [DBG] Failed '/cloudflare.com:443 [cloudflare]': unsupported protocol scheme "" [DBG] Failed '/cloudflare.com:80 [cloudflare]': unsupported protocol scheme "" [DBG] Failed '/cloudflare.com:8080 [cloudflare]': unsupported protocol scheme ""`

Expected Behavior:

It is expected to only pipe the output of host:port

Mzack9999 commented 8 months ago

This seems the expected behavior as you are using the display-cdn flag. If for any reason these are flags you can't avoid. You can truncate the output by using sed within the pipe:

naabu ... | sed 's/\[[^]]*\]//g' | httpx ...