2

I'm trying to use multiple Nmap --script-args at the same time.

$ nmap -vv -p80,443 --script http-errors --script-args "httpspider.url=/,httpspider.maxpagecount=3,httpspider.maxdepth=1" website.com

I tried encasing the args in double quotes, single quotes, no quotes, and quoting the values after each = sign. But the scan always returns the same "maxpagecount":

PORT    STATE SERVICE REASON
443/tcp open  https   syn-ack
| http-errors: 
| Spidering limited to: maxpagecount=40; withinhost=website.com
|   Found the following error pages: 
|   
|   Error Code: 403
|_      https://website.com:443/

specs:

$ nmap --version

Nmap version 7.70 ( https://nmap.org )
Platform: x86_64-pc-linux-gnu
Compiled with: liblua-5.3.3 openssl-1.1.0h libssh2-1.8.0 libz-1.2.11 libpcre-8.39 nmap-libpcap-1.7.3 nmap-libdnet-1.12 ipv6
Compiled without:
Available nsock engines: epoll poll select

$ lsb_release -a

No LSB modules are available.
Distributor ID: Kali
Description:    Kali GNU/Linux Rolling
Release:    kali-rolling
Codename:   kali-rolling

Am I doing something incorrectly or could this be a bug in Nmap?

  • I'm looking into it. Seems like a bug or at least confusing behavior: the library's maxpagecount is being overridden by the script's. Try --script-args maxpagecount=3 instead. That should let the script retrieve the argument value and use it. I'll make an answer later when I've sorted it all out. – bonsaiviking Sep 10 '18 at 21:08
1

The script will always have that line as the default is 40 pages. See the manual page you linked. Specifically:

The script, by default, spiders and searches within forty pages. For large web applications make sure to increase httpspider's maxpagecount value. Please, note that the script will become more intrusive though.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.