Curl, Wget and Open SSL

Curl with UA

curl -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.89 Safari/537.36' -H 'host: domain.com' 192.168.0.1 -kIL

Check cache with wget

wget -O /dev/null -S https://domain.com/wp-admin 2>&1 | grep 'cache'

Cache check – x9 with 2 second intervals

for i in {1..9}; do date; curl -skIL https://domain.com/somepath.html | grep -i "cache"; echo "=> 2s delay"; sleep 2; done

Cache check x3 repeat x4 wait 60 seconds repeat with time

for i in {1..4}; do curl -sIL "https://domain.com/somepath.html" | grep -i "cache" && date; done && printf "nWaiting 60s...nn" && sleep 61 && for i in {1..4}; do curl -sIL "https://domain.com/somepath.html" | grep -i "cache" && date; done

Check SSL cert, set IP – show subject, issuer and dates

openssl s_client -servername domain.com -connect 192.160.0.1:443 2>/dev/null | openssl x509 -noout -subject -issuer -dates;
curl -vvI --silent https://domain.com 2>&1 | grep 'issuer|start date|expire date|subject'

Check SSL all servers on Sucuri cluster – show subject, issuer and dates

DOMAINTOBETESTED="domain.com" CLUSTER="11"; for i in {11..21}; do echo && echo "cloudproxy${i}0${CLUSTER}" && echo | openssl s_client -servername $DOMAINTOBETESTED -connect cloudproxy${i}0${CLUSTER}.sucuri.net:443 2>/dev/null | openssl x509 -noout -subject -issuer -dates; done

Check SSL certs – verbose output

openssl s_client -showcerts -servername domain.com -connect 192.124.249.9:443

Check HTTP response all servers on Sucuri cluster

for i in {11..21}; do echo -n "cloudproxy${i}011: "; curl -sI -H 'Host: domain.com' https://cloudproxy${i}011.sucuri.net| grep ^HTTP; done

Compare md5sum of resource all servers in Sucuri Cluster (compare cache)

for i in {11..21}; do echo -n "cluster ${i}011 response: " && curl -k -s -H 'Host:300m.com' https://cloudproxy${i}011.sucuri.net/wp-content/uploads/2014/10/MARC-e1460004841534.jpg | md5sum;done

Check HTTP version

curl -I --resolve 300m.com:443:192.168.0.1 https://192.168.0.1 -ks | grep -i http

Response code & cache status all servers in Sucuri Cluster

for i in {11..21}; do echo -n "cluster ${i}011 response: " && curl -sH "host: 300m.com" https://cloudproxy${i}011.sucuri.net -kIL | grep -i "HTTP/|x-sucuri-cache" | tr 'rn' ' ' && echo; done

Check HTTP response from list of domains

for i in $(cat domains.txt); do curl -I https://${i} -L | grep ^HTTP; done

Extract Cert and Key from .PFX

openssl pkcs12 -in domain.pfx -nocerts -out domain.key
openssl pkcs12 -in domain.pfx -clcerts -nokeys -out domain.crt
openssl rsa -in domain.key -out domain.key

Extract Cert from PKCS7

openssl pkcs7 -print_certs -in domain-com.p7b -out domain-com.cer

CISSP CISM PMP