This repository has been archived on 2025-02-13. You can view files and clone it, but cannot push or open issues or pull requests.
lanScan2/init.sh
2023-04-13 15:46:47 +02:00

20 lines
453 B
Bash
Executable File

#!/usr/bin/env bash
###
#
# Scan un réseau avec nmap pour créer un fichier de configuration
#
###
DIR="$(dirname -- "$0")"
echo "Nom du site ?"
read site
filename="${site/ /_}"
echo "Adresse réseau CIDR (xxx.xxx.xxx.xxx/xx) ?"
read network
nmap --script smb-enum-shares.nse -oX "scans/$filename.xml" $network
xsltproc --stringparam site "$site" --stringparam network $network to_yaml.xsl "$DIR/scans/$filename.xml" > "$DIR/confs/$filename.yaml"