diff --git a/ronin-install.sh b/ronin-install.sh index ff7a226..2a265a3 100755 --- a/ronin-install.sh +++ b/ronin-install.sh @@ -383,6 +383,39 @@ function install_dependencies() fi } +# +# Install nmap if it's not already installed. +# +function auto_install_nmap() +{ + if ! command -v nmap >/dev/null; then + log "Installing nmap ..." + install_packages nmap || fail "Failed to install nmap!" + fi +} + +# +# Install masscan if it's not already installed. +# +function auto_install_masscan() +{ + if ! command -v masscan >/dev/null; then + log "Installing masscan ..." + install_packages masscan || fail "Failed to install masscan!" + fi +} + +# +# Install GraphViz if it's not already installed. +# +function auto_install_graphviz() +{ + if ! command -v dot >/dev/null; then + log "Installing GraphViz ..." + install_packages graphviz || fail "Failed to install graphviz!" + fi +} + # # Print the --help usage. # @@ -447,6 +480,13 @@ auto_install_pkg_config auto_install_ruby install_dependencies +# TODO: remove prerelease check once ronin-2.1.0 is finally released +if [[ "$prerelease" == "true" ]]; then + auto_install_nmap + auto_install_masscan + auto_install_graphviz +fi + if ! command -v ronin >/dev/null; then if [[ "$prerelease" == "true" ]]; then log "Installing ronin pre-release. This may take a while ..." diff --git a/test/ronin_install_test.sh b/test/ronin_install_test.sh index 839bb39..89c4968 100755 --- a/test/ronin_install_test.sh +++ b/test/ronin_install_test.sh @@ -53,6 +53,23 @@ function test_git_install() assertCommandInstalled "did not successfully install git" 'git' } +# TODO: uncomment when ronin-2.1.0 is finally released. +# +# function test_nmap_install() +# { +# assertCommandInstalled "did not successfully install nmap" 'nmap' +# } +# +# function test_masscan_install() +# { +# assertCommandInstalled "did not successfully install masscan" 'masscan' +# } +# +# function test_graphviz_install() +# { +# assertCommandInstalled "did not successfully install GraphViz" 'dot' +# } + function test_ronin_install() { assertCommandInstalled "did not successfully install ronin" 'ronin'