#!/bin/bash
cd /root/recon
fg=$(head -1 lists/fortinet.txt | cut -f1,2,3)
sw=$(head -1 lists/sonicwall.txt | cut -f1,2,3)
pl=$(head -1 lists/zimbra.txt | cut -f1,2,3)
read -r ip port sc <<< "$fg"; echo "#### FORTI $ip:$port"
curl -g -skL -m 8 "$sc://$ip:$port/remote/login?lang=en" -o /tmp/f.html
grep -a -o -E "v=[0-9]+\.[0-9]+\.[0-9]+|fortios|FortiGate[- ][0-9.]+|version[^,;\"<>]{0,30}" /tmp/f.html | sort -u | head -10
echo "--- head of body ---"
sed 's/></>\n</g' /tmp/f.html | grep -a -i -E "version|script src" | head -12
read -r ip port sc <<< "$sw"; echo "#### SONIC $ip:$port"
curl -g -skL -m 8 "$sc://$ip:$port/" -o /tmp/s.html
grep -a -o -E "[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+-[0-9a-z]+|SonicOS[^<\"]{0,20}|version[^,;\"<>]{0,30}" /tmp/s.html | head -8
sed 's/></>\n</g' /tmp/s.html | grep -a -i -E "version|script src|firmware" | head -12
read -r ip port sc <<< "$pl"; echo "#### PLESK $ip:$port"
curl -g -skL -m 8 -D /tmp/ph.txt "$sc://$ip:$port/" -o /tmp/p.html
grep -a -i -E "^location" /tmp/ph.txt | head -3
grep -a -o -E "<title>[^<]*|Plesk[^<\"]{0,40}" /tmp/p.html | head -6
