Skip to content

Instantly share code, notes, and snippets.

@leandrosiow
Last active March 12, 2020 23:16
Show Gist options
  • Save leandrosiow/579a6b9bbc54d7573f19ec2e90f71c0c to your computer and use it in GitHub Desktop.
Save leandrosiow/579a6b9bbc54d7573f19ec2e90f71c0c to your computer and use it in GitHub Desktop.
This script curl a URI and returns useful information such as "Source IP", "Dest IP", "HTTP Version" etc.
while true; do date; curl -so /dev/null -w"\nSource IP:\t\t%{local_ip}:%{local_port}\nDest IP:\t\t%{remote_ip}:%{remote_port}\nHTTP Version:\t\t%{http_version}\nHTTP Status Code:\t%{http_code}\nEffective URL:\t\t%{url_effective}\nRedirect URL:\t\t%{redirect_url}\nNum of Redirects:\t%{num_redirects}\nNum of Connects:\t%{num_connects}\nDownload Size:\t\t%{size_download} bytes\nSSL Verify Result:\t%{ssl_verify_result}\nDNS Resolution Time:\t%{time_namelookup}\nTCP Handshake Time:\t%{time_connect}\nSSL Handshake Time:\t%{time_appconnect}\nPre Transfer Time:\t%{time_pretransfer}\nStart Transfer Time:\t%{time_starttransfer}\nTotal Time Spent:\t%{time_total}\n==========================================\n\n" $1; sleep 5; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment