#!/bin/bash
UA='Mozilla/5.0'
for ip in 172.105.70.168; do
  echo "== CSA $ip version check =="
  curl -sk -m 12 -A "$UA" -o /tmp/csa.txt "https://$ip/"
  grep -aoiE 'version[^"<>]{0,30}|build[^"<>]{0,20}|4\.6[^"<>]{0,10}|5\.0[^"<>]{0,10}' /tmp/csa.txt | head -5
  echo '-- login assets:'
  grep -aoiE 'src="[^"]+"' /tmp/csa.txt | head -6
  echo '-- pulse/ivanti hints in hitsB line:'
  grep -a "$ip" /root/recon/hitsB.tsv | cut -c1-160
done
