diff --git a/config.yaml b/config.yaml index 4696bdf39..2bc9b9ffe 100644 --- a/config.yaml +++ b/config.yaml @@ -120,10 +120,10 @@ beef: dns_hostname_lookup: false # IP Geolocation - # NOTE: requires MaxMind database. Run ./updated-geoipdb to install. geoip: enable: true - database: '/opt/GeoIP/GeoLite2-City.mmdb' + # GeoLite2 City database created by MaxMind, available from https://www.maxmind.com + database: '/usr/share/GeoIP/GeoLite2-City.mmdb' # Integration with PhishingFrenzy # If enabled BeEF will try to get the UID parameter value from the hooked URI, as this is used by PhishingFrenzy diff --git a/core/main/geoip.rb b/core/main/geoip.rb index b07a057e2..fbe33ab99 100644 --- a/core/main/geoip.rb +++ b/core/main/geoip.rb @@ -19,7 +19,6 @@ module Core unless File.exists? geoip_file print_error "[GeoIP] Could not find MaxMind GeoIP database: '#{geoip_file}'" - print_more "Run ./update-geoipdb to install" @enabled = false return end diff --git a/install b/install index 4e2b976e2..8cca1cd77 100755 --- a/install +++ b/install @@ -252,7 +252,7 @@ finish () { echo "Next steps:" echo echo "* Change the default password in config.yaml" - echo "* Run ./update-geoipdb to install the Maxmind GeoIP database" + echo "* Configure geoipupdate to update the Maxmind GeoIP database." echo "* Review the wiki for important configuration information:" echo " https://github.com/beefproject/beef/wiki/Configuration" echo diff --git a/update-geoipdb b/update-geoipdb deleted file mode 100755 index 1166a3b96..000000000 --- a/update-geoipdb +++ /dev/null @@ -1,83 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2006-2022 Wade Alcorn - wade@bindshell.net -# Browser Exploitation Framework (BeEF) - http://beefproject.com -# See the file 'doc/COPYING' for copying permission -# - -# Install the MaxMind GeoIP database - -set -euo pipefail -IFS=$'\n\t' - -GEOIP_PATH="/opt/GeoIP" - -info() { echo -e "\\033[1;36m[INFO]\\033[0m $*"; } -warn() { echo -e "\\033[1;33m[WARNING]\\033[0m $*"; } -fatal() { echo -e "\\033[1;31m[FATAL]\\033[0m $*"; exit 1 ; } - -command_exists () { - command -v "${1}" >/dev/null 2>&1 -} - -get_permission () { - warn "This script will install the MaxMind GeoLite database in ${GEOIP_PATH}" - - read -rp "Are you sure you wish to continue (Y/n)? " - if [ "$(echo "${REPLY}" | tr "[:upper:]" "[:lower:]")" = "n" ] ; then - fatal 'Installation aborted' - fi -} - -check_deps() { - if ! command_exists /usr/bin/curl - then - fatal "/usr/bin/curl is not installed" - fi - if ! command_exists /bin/gunzip - then - fatal "/bin/gunzip is not installed" - fi - if ! command_exists /bin/tar - then - fatal "/bin/tar is not installed" - fi -} - -check_perms() { - /bin/mkdir -p "${GEOIP_PATH}" - - if ! [ -w "${GEOIP_PATH}" ] - then - fatal "${GEOIP_PATH} is not writable" - fi -} - -install() { - info 'Downloading MaxMind GeoLite2-City database ...' - #/usr/bin/curl -O https://geolite.maxmind.com/download/geoip/database/GeoLite2-City.tar.gz - /usr/bin/curl -O https://web.archive.org/web/20191227182209/https://geolite.maxmind.com/download/geoip/database/GeoLite2-City.tar.gz - - info 'Extracting GeoLite2-City.tar.gz ...' - /bin/gunzip GeoLite2-City.tar.gz - /bin/tar xvf GeoLite2-City.tar - - info "Installing to ${GEOIP_PATH} ..." - /bin/mv GeoLite2-City_*/* "${GEOIP_PATH}" - - info 'Cleaning up ...' - /bin/rm GeoLite2-City.tar - /bin/rmdir GeoLite2-City_* - - info 'Done!' -} - -main() { - get_permission - check_deps - check_perms - install -} - -main "$@" -