#!/bin/bash

# Prompt user for input
echo "What's the IP range of your target?"
read -r target
echo "Which ports? (Comma-separated, e.g., 80,443,995,2082)"
read -r ports
echo "What's the name of your target?"
read -r name

echo "Scanning target: $target on ports: $ports..."

# Convert comma-separated ports into space-separated format
#ports_formatted=$(echo "$ports")

# Define scan types and their corresponding scripts
declare -A scans
scans=(
    [smb-brute]="--script smb-brute.nse"
    [init]=""
    [vulners]="--script vulners --script-args mincvss=5.0"
    [dns-enum]="--script dns-srv-enum --script-args \\"dns-srv-enum.domain\\""
    [exploit]="--script exploit --script-args \\"exploit.intensive\\""
    [http-enum]="--script http-enum --script-args \\"http-enum.category\\""
    [ssh-pubkey]="--script ssh-publickey-acceptance"
)

# Loop through the scans and execute them efficiently
for scan in "${!scans[@]}"; do
    output_xml="vuln.${scan}.${name}.xml"
    output_html="vuln.${scan}.${name}.html"
    
    echo "Running Nmap scan: $scan"
    sudo nmap $target -p $ports_formatted -f -T4 -v5 -sV -sT -O ${scans[$scan]} -oX "$output_xml"
    xsltproc "$output_xml" -o "$output_html"
    rm "$output_xml"
done

echo "All scans completed!"
  

BBOT

FTP