[Nikto-discuss] Bug: Nikto eating input from non-tty stdin

Serge van den Boom svdb at madison-gurkha.com
Fri Apr 15 08:45:17 CDT 2011


Hi,

Nikto eats characters from stdin, which is undesirable when this is not
a tty. For instance, the following Bourne shell script fragment will not
work:
     generateTargets | while read -r TARGET; do
         nikto.pl -Display V -Format txt -host "$TARGET" -output 
nikto-"$TARGET".txt
     done

After the first host, one or more characters from the beginning of "$TARGET"
may be cut for the following target.

While it could be argued that the shell script should not rely on
external programs such as nikto leaving stdin alone, the current
behaviour is likely to confuse people, as this is not expected from a
tool which appears to be non-interactive.

Suggested solution:
Check whether stdin is a tty, and do not read from it if it is not.
(Alternatively, reopen stdin from /dev/tty.)

Workaround:
Redirect stdin from /dev/null in the invocation of nikto.pl.

Regards,

Serge van den Boom



More information about the Nikto-discuss mailing list