Skip to content

Instantly share code, notes, and snippets.

@pythoninthegrass
Last active September 11, 2024 18:47
Show Gist options
  • Save pythoninthegrass/0a57637e380dbe0717331ed9bfbf0de4 to your computer and use it in GitHub Desktop.
Save pythoninthegrass/0a57637e380dbe0717331ed9bfbf0de4 to your computer and use it in GitHub Desktop.
nikto docker shim
#!/usr/bin/env bash
set -e
help() {
cat <<- DESCRIPTION >&2
Shim to run nikto in a container.
SETUP
git clone https://github.com/sullo/nikto
cd nikto/program
docker build -t sullo/nikto .
USAGE
$(basename "$0") -h <IP|DOMAIN> Run nikto against an IP (port is optional via ':<PORT>') or domain
$(basename "$0") -Help Built-in help
DESCRIPTION
}
if [ "$#" -eq 0 ]; then
help
fi
image="sullo/nikto"
case "$1" in
-h)
docker run -it --rm "${image}" "$@"
;;
--help)
help
;;
-Help)
docker run -it --rm "${image}" -Help
;;
*)
help
exit 1
;;
esac
@pythoninthegrass
Copy link
Author

pythoninthegrass commented Sep 11, 2024

build nikto docker container

git clone https://github.com/sullo/nikto.git
cd nikto
docker build -t sullo/nikto .
# Call it without arguments to display the full help
docker run --rm sullo/nikto
# Basic usage
docker run --rm sullo/nikto -h http://www.example.com
# To save the report in a specific format, mount /tmp as a volume:
docker run --rm -v $(pwd):/tmp sullo/nikto -h http://www.example.com -o /tmp/out.json

See: https://github.com/sullo/nikto

clone gist and create symlink

git clone git@gist.github.com:0a57637e380dbe0717331ed9bfbf0de4.git my-nikto && cd $_
ln -s $(pwd)/nikto.sh ~/.local/bin/nikto

usage

nikto -h <IP|URL><:8000>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment