Download Nessusupdateplugins All20targz Top

When security engineers search for “download nessusupdateplugins all20targz top”, they are typically looking for the top three things:


The command download nessusupdateplugins all20targz top is used within the context of updating Nessus plugins. Let's break it down:

sudo /opt/nessus/sbin/nessuscli --plugins download nessusupdateplugins all20targz top

For MSPs or large enterprises with multiple air-gapped Nessus scanners, manual downloads are unsustainable. Build a cron job that:

#!/usr/bin/env python3
"""
Nessus Plugin Downloader Feature
Downloads the latest Nessus plugins package from Tenable's official source
"""

import os import sys import argparse import requests import hashlib import gzip import tarfile from pathlib import Path from datetime import datetime from typing import Optional, Dict, Any import logging For MSPs or large enterprises with multiple air-gapped

class NessusPluginDownloader: """Handles downloading Nessus plugin updates"""

# Official Tenable download URLs
BASE_URLS = 
    'professional': 'https://www.tenable.com/downloads/api/v1/public/pages/nessus',
    'feed': 'https://plugins.nessus.org/v2/nessus.php',
    'direct': 'https://www.tenable.com/downloads/nessus'
def __init__(self, download_dir: str = '/tmp/nessus_plugins', verify_ssl: bool = True):
    self.download_dir = Path(download_dir)
    self.verify_ssl = verify_ssl
    self.setup_logging()
    self.create_download_directory()
def setup_logging(self):
    """Configure logging"""
    logging.basicConfig(
        level=logging.INFO,
        format='%(asctime)s - %(levelname)s - %(message)s',
        handlers=[
            logging.FileHandler('nessus_downloader.log'),
            logging.StreamHandler()
        ]
    )
    self.logger = logging.getLogger(__name__)
def create_download_directory(self):
    """Create download directory if it doesn't exist"""
    self.download_dir.mkdir(parents=True, exist_ok=True)
    self.logger.info(f"Download directory: self.download_dir")
def download_file(self, url: str, filename: str, chunk_size: int = 8192) -> bool:
    """Download file with progress indication"""
    try:
        self.logger.info(f"Downloading from: url")
headers = 
            'User-Agent': 'Mozilla/5.0 (compatible; NessusUpdater/1.0)'
response = requests.get(url, stream=True, headers=headers, verify=self.verify_ssl)
        response.raise_for_status()
total_size = int(response.headers.get('content-length', 0))
        filepath = self.download_dir / filename
downloaded = 0
        with open(filepath, 'wb') as f:
            for chunk in response.iter_content(chunk_size=chunk_size):
                if chunk:
                    f.write(chunk)
                    downloaded += len(chunk)
                    if total_size > 0:
                        percent = (downloaded / total_size) * 100
                        sys.stdout.write(f"\rProgress: percent:.1f% (downloaded/total_size bytes)")
                        sys.stdout.flush()
print()  # New line after progress
        self.logger.info(f"Successfully downloaded: filepath")
        return True
except requests.RequestException as e:
        self.logger.error(f"Download failed: e")
        return False
def get_latest_plugin_url(self, nessus_version: str = 'latest') -> Optional[str]:
    """Get the download URL for the latest Nessus plugins"""
    try:
        # Tenable's API endpoint for plugin downloads
        api_url = f"https://www.tenable.com/downloads/api/v2/public/nessus"
response = requests.get(api_url, verify=self.verify_ssl)
        response.raise_for_status()
data = response.json()
# Find the plugin update package
        plugin_pattern = 'nessus-update-plugins'
        for release in data.get('releases', []):
            for file in release.get('files', []):
                if plugin_pattern in file.get('name', '').lower() and 'tar.gz' in file.get('name', ''):
                    return file.get('url')
# Fallback to direct URL pattern
        return "https://plugins.nessus.org/v2/nessus.php?f=all-2.0.tar.gz"
except Exception as e:
        self.logger.warning(f"Could not fetch latest URL from API: e")
        # Return default URL
        return "https://plugins.nessus.org/v2/nessus.php?f=all-2.0.tar.gz"
def verify_checksum(self, filepath: Path, expected_md5: Optional[str] = None) -> bool:
    """Verify file integrity using MD5 or SHA256"""
    if not expected_md5:
        self.logger.info("No checksum provided, skipping verification")
        return True
try:
        md5_hash = hashlib.md5()
        with open(filepath, 'rb') as f:
            for chunk in iter(lambda: f.read(4096), b''):
                md5_hash.update(chunk)
file_md5 = md5_hash.hexdigest()
        if file_md5 == expected_md5:
            self.logger.info("Checksum verification passed")
            return True
        else:
            self.logger.error(f"Checksum mismatch: expected expected_md5, got file_md5")
            return False
except Exception as e:
        self.logger.error(f"Checksum verification failed: e")
        return False
def extract_archive(self, filename: str, extract_to: Optional[str] = None) -> bool:
    """Extract the downloaded tar.gz archive"""
    filepath = self.download_dir / filename
if not filepath.exists():
        self.logger.error(f"File not found: filepath")
        return False
extract_path = Path(extract_to) if extract_to else self.download_dir / 'extracted'
    extract_path.mkdir(exist_ok=True)
try:
        self.logger.info(f"Extracting filename to extract_path")
with gzip.open(filepath, 'rb') as f_in:
            with tarfile.open(fileobj=f_in, mode='r') as tar:
                tar.extractall(path=extract_path)
self.logger.info(f"Extraction completed successfully")
        return True
except Exception as e:
        self.logger.error(f"Extraction failed: e")
        return False
def download_plugins(self, version: str = 'all-2.0', extract: bool = False) -> Dict[str, Any]:
    """Main method to download Nessus plugins"""
    result = 
        'success': False,
        'filename': None,
        'filepath': None,
        'size': 0,
        'timestamp': datetime.now().isoformat()
# Construct filename
    filename = f"nessus-update-plugins-version.tar.gz"
# Get download URL
    download_url = self.get_latest_plugin_url()
    if not download_url:
        # Use default pattern
        download_url = f"https://plugins.nessus.org/v2/nessus.php?f=version.tar.gz"
# Download the file
    if self.download_file(download_url, filename):
        filepath = self.download_dir / filename
        result['success'] = True
        result['filename'] = filename
        result['filepath'] = str(filepath)
        result['size'] = filepath.stat().st_size
# Optionally extract
        if extract:
            result['extracted'] = self.extract_archive(filename)
self.logger.info(f"Download complete: filename (result['size'] bytes)")
return result

def main(): """Command-line interface for the downloader""" parser = argparse.ArgumentParser( description='Download Nessus plugin updates', formatter_class=argparse.RawDescriptionHelpFormatter, epilog=""" Examples: %(prog)s --version all-2.0 %(prog)s --version all-2.0 --extract %(prog)s --output-dir ./plugins --no-verify-ssl """ ) download_dir: str = '/tmp/nessus_plugins'

parser.add_argument(
    '--version',
    default='all-2.0',
    help='Plugin version (default: all-2.0)'
)
parser.add_argument(
    '--output-dir',
    default='/tmp/nessus_plugins',
    help='Download directory (default: /tmp/nessus_plugins)'
)
parser.add_argument(
    '--extract',
    action='store_true',
    help='Extract the downloaded archive'
)
parser.add_argument(
    '--no-verify-ssl',
    action='store_true',
    help='Disable SSL verification (not recommended)'
)
parser.add_argument(
    '--verbose',
    action='store_true',
    help='Enable verbose logging'
)
args = parser.parse_args()
# Create downloader instance
downloader = NessusPluginDownloader(
    download_dir=args.output_dir,
    verify_ssl=not args.no_verify_ssl
)
if args.verbose:
    downloader.logger.setLevel(logging.DEBUG)
# Download plugins
print(f"\n'='*60")
print(f"Nessus Plugin Downloader")
print(f"Version: args.version")
print(f"Output Directory: args.output_dir")
print(f"'='*60\n")
result = downloader.download_plugins(
    version=args.version,
    extract=args.extract
)
if result['success']:
    print(f"\n✅ Download successful!")
    print(f"   File: result['filename']")
    print(f"   Size: result['size']:, bytes")
    print(f"   Location: result['filepath']")
    if args.extract and result.get('extracted'):
        print(f"   Extracted: Yes")
    sys.exit(0)
else:
    print(f"\n❌ Download failed!")
    sys.exit(1)

if name == "main": main()

  Feedback