To offline update the Nmap Script Database (NSE) on Kali Linux, you need to manually
download the latest script updates and then replace or update the local database on your
system. Here are the steps you can follow:
1. Download the Latest Nmap Script Database
You can get the latest scripts from the official Nmap repository. Here's how:
Go to the Nmap GitHub repository.
Download the latest version of the scripts folder as a .zip file or clone the
repository using Git if you're comfortable with it.
Using git (recommended method):
If you have Git installed on another machine (with internet access), you can use this
method to download the scripts.
git clone https://github.com/nmap/nmap.git
This will download the full Nmap repository, including the latest scripts, to a folder
called nmap.
Alternatively, download the ZIP:
If you prefer to download it manually:
1. Visit the Nmap Scripts repository.
2. Click on "Code" and choose "Download ZIP".
3. Extract the ZIP file to a location on your system.
2. Transfer the Script Files to Kali Linux
If you downloaded the scripts on another machine, transfer them to your Kali Linux
system using methods like scp, a USB drive, or another file transfer method.
3. Locate the Current Script Database on Kali Linux
On your Kali system, Nmap's script database is typically stored in:
/usr/share/nmap/scripts/
This is the directory where you will need to replace or update the existing scripts with the
new ones you downloaded.
4. Backup and Replace the Existing Scripts
It’s a good idea to back up your current script database before replacing it. Run the
following commands:
sudo cp -r /usr/share/nmap/scripts /usr/share/nmap/scripts_backup
Now, move the new scripts into the Nmap script folder:
1. If you're using Git, copy the scripts from nmap/scripts/ into
/usr/share/nmap/scripts/.
2. If you downloaded a ZIP, simply extract the contents into
/usr/share/nmap/scripts/.
5. Update the Nmap Script Database
After replacing or adding new scripts, you can update the script database to ensure Nmap
recognizes the new scripts:
sudo nmap --script-updatedb
This command updates the Nmap script database to make sure the new or updated scripts
are recognized by Nmap.
6. Verify the Update
You can verify that the new scripts have been added by running a simple Nmap script
scan. For example:
nmap --script=default <target>
Or to list available scripts:
nmap --script-help
This should show the scripts that are available after the update.
7. Troubleshooting
If you encounter any issues:
Make sure you have proper permissions to write to /usr/share/nmap/scripts/.
Ensure that the Nmap version you are using supports the new scripts (though most
recent versions should).
That’s it! You’ve successfully updated the Nmap Script Database offline on Kali Linux.