From 674869f5e7335aae42dfe7525dff459c795011f7 Mon Sep 17 00:00:00 2001 From: Postmodern Date: Mon, 24 Jun 2024 18:37:37 -0700 Subject: [PATCH] Install new external dependencies for ronin 2.1.0.rc1 (issue #23). * ronin-nmap-0.1.0.rc1 now requires `nmap`. * ronin-masscan-0.1.0.rc1 now requires `masscan`. * ronin-recon-0.1.0.rc1 now requires `nmap` and GraphViz (`dot`). * ronin-app-0.1.0.rc1 now requires `nmap` and `masscan`. --- ronin-install.sh | 42 ++++++++++++++++++++++++++++++++++++++ test/ronin_install_test.sh | 17 +++++++++++++++ 2 files changed, 59 insertions(+) diff --git a/ronin-install.sh b/ronin-install.sh index ebc6389..ba7c38d 100755 --- a/ronin-install.sh +++ b/ronin-install.sh @@ -419,6 +419,41 @@ function auto_install_zip() 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 || \ + warn "Failed to install nmap. Proceeding anyways ..." + 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 || \ + warn "Failed to install masscan. Proceeding anyways ..." + 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 +} + # # Install runtime dependencies for ronin. # @@ -426,6 +461,13 @@ function install_runtime_dependencies() { auto_install_git auto_install_zip + + # 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 } # 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'