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?