Skip to content

Instantly share code, notes, and snippets.

@heywoodlh
Created May 24, 2022 19:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save heywoodlh/a504e7f87133435fd0014ccc57bd67d8 to your computer and use it in GitHub Desktop.
Save heywoodlh/a504e7f87133435fd0014ccc57bd67d8 to your computer and use it in GitHub Desktop.
flan-scan () {
if [[ -z "$@" ]] || [[ $1 == '--help' ]]
then
printf 'flan-scan "192.168.0.0/24 192.168.1.0/24"\n'
else
mkdir -p ~/tmp/flan_scan/reports
mkdir -p ~/tmp/flan_scan/xml_files
if [ -e ~/tmp/flan_scan/flan-ips.txt ]
then
rm ~/tmp/flan_scan/flan-ips.txt
fi
for ip in "$@"
do
printf "${ip}\n" >> ~/tmp/flan_scan/flan-ips.txt
done
printf "Reports and XML files will be saved to ~/tmp/flan_scan/\n" &&\
sleep 2
eval docker run --rm --network=host --name flan-scan -v ~/tmp/flan_scan/flan-ips.txt:/shared/ips.txt -v ~/tmp/flan_scan/reports:/shared/reports -v ~/tmp/flan_scan/xml_files:/shared/xml_files -e format=html heywoodlh/flan-scan
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment