I am working on NIKTO automation. I have a text file contains list of IP addresses along with their ports open. I have already made nikto script.

Script functionality - it takes IP addresses and then run nikto on it.

Question : I want to make intelligent nikto. Problem is that, sometimes single IP does have 80 and 443 open ports however application only runs either on 443 or 80. How do I tell my scanner that only run scan against this port along with that particular IP without testing both 80 and 443?

Try 1: Initially I thought that, I will use curl to check the response on both port with that IP. If response code is 200 OK then do scan and if 302, 301 and 404 then skip it. Its failed as many applications which provides 404 page with 200 OK response.

Try 2: I assumed that IPs which runs on both port 80 and 443 will definitely run on 443 at least.So I implemented if else condition in such a way that if IP has 80 and 443 open then skip 80 and run scan against 443.

Is my try 2 logic is correct? Are there any other options/alternatives?

1 Answer 1


I would recommend looking into how niktohelper accomplishes the same task. In this case first you can run an nmap scan across a range, then parse the output (thus knowing every web port that is open, and which ones use https) and run nitko appropriately.

Doing this yourself your essentially reinventing some nmap functions that are really great. Plus what about non-standard(ish) web ports such as 8000,8080,8181,8443 etc ?

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .