Skip to content

Instantly share code, notes, and snippets.

@directentis1
Last active July 7, 2023 03:28
Show Gist options
  • Save directentis1/5dc79a9f8115d00daa518ffc0768ae2f to your computer and use it in GitHub Desktop.
Save directentis1/5dc79a9f8115d00daa518ffc0768ae2f to your computer and use it in GitHub Desktop.
the script to download latest version of nmap from its primarily website
#!/usr/bin/bash
# Fetch the latest version number from the Nmap website
latest_version=$(curl -s https://nmap.org/dist/ | grep -oP 'nmap-\K([\d\.]+)' | head -n 1)
# Create a directory to store the downloaded RPMs
mkdir -p nmap_rpms
cd nmap_rpms
# Download the latest versions of Nmap, Nping, and Ncat
wget "https://nmap.org/dist/nmap-${latest_version}-1.x86_64.rpm"
wget "https://nmap.org/dist/nping-0.${latest_version}-1.x86_64.rpm"
wget "https://nmap.org/dist/ncat-${latest_version}-1.x86_64.rpm"
wget "https://nmap.org/dist/zenmap-${latest_version}-1.noarch.rpm"
# Return to the original directory
cd ..
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment