Information Technology Grimoire

Version .0.0.1

IT Notes from various projects because I forget, and hopefully they help you too.

View HTTP Headers With wget

wget -SO- -T 5 -t 1 http://google.com
wget -SO- -T 5 -t 1 http://google.com 2>&1 | egrep "expression"

Get Headers with wget

wget --spider -S https://google.com                     
Spider mode enabled. Check if remote file exists.
--2024-01-21 09:03:42--  https://google.com/
Resolving google.com (google.com)... 142.250.114.113, 142.250.114.138, 142.250.114.139, ...
Connecting to google.com (google.com)|142.250.114.113|:443... connected.
HTTP request sent, awaiting response... 
  HTTP/1.1 301 Moved Permanently
  Location: https://www.google.com/
  Content-Type: text/html; charset=UTF-8
  Content-Security-Policy-Report-Only: object-src 'none';base-uri 'self';script-src 'nonce-gXjvqHSb_mSifqL0WdXpjQ' 'strict-dynamic' 'report-sample' 'unsafe-eval' 'unsafe-inline' https: http:;report-uri https://csp.withgoogle.com/csp/gws/other-hp
  Date: Sun, 21 Jan 2024 15:03:42 GMT
  Expires: Tue, 20 Feb 2024 15:03:42 GMT
  Cache-Control: public, max-age=2592000
  Server: gws
  Content-Length: 220
  X-XSS-Protection: 0
  X-Frame-Options: SAMEORIGIN
  Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
Location: https://www.google.com/ [following]
Spider mode enabled. Check if remote file exists.
--2024-01-21 09:03:42--  https://www.google.com/
Resolving www.google.com (www.google.com)... 142.250.113.105, 142.250.113.106, 142.250.113.147, ...
Connecting to www.google.com (www.google.com)|142.250.113.105|:443... connected.
HTTP request sent, awaiting response... 
  HTTP/1.1 200 OK
  Content-Type: text/html; charset=ISO-8859-1
  Content-Security-Policy-Report-Only: object-src 'none';base-uri 'self';script-src 'nonce-7J0VBAthjHvSwCE-3Rs7iQ' 'strict-dynamic' 'report-sample' 'unsafe-eval' 'unsafe-inline' https: http:;report-uri https://csp.withgoogle.com/csp/gws/other-hp
  P3P: CP="This is not a P3P policy! See g.co/p3phelp for more info."
  Date: Sun, 21 Jan 2024 15:03:42 GMT
  Server: gws
  X-XSS-Protection: 0
  X-Frame-Options: SAMEORIGIN
  Transfer-Encoding: chunked
  Expires: Sun, 21 Jan 2024 15:03:42 GMT
  Cache-Control: private
  Set-Cookie: 1P_JAR=2024-01-21-15; expires=Tue, 20-Feb-2024 15:03:42 GMT; path=/; domain=.google.com; Secure
  Set-Cookie: AEC=Ae3NU9NagG3xx46JjY_XXiMFC-P0UAm-_wqpmS5yapU-6n84l27XE2tp6Q; expires=Fri, 19-Jul-2024 15:03:42 GMT; path=/; domain=.google.com; Secure; HttpOnly; SameSite=lax
  Set-Cookie: NID=511=C8rRTTIW2eMTlhkaReviz0cNaEvYJu0oH01lYGzszFP_xPTbLAnoZFP_O7hGabtvlP3h88sBfWgJ1bAJQtNFjgtvWg-kiyNcO9g9cMzj3Z0OveKwry1VoalYKA7D04RjHzbNsTVqSyVySFgPuj0QbcxpM9heD8kcxhq-NrMjcu8; expires=Mon, 22-Jul-2024 15:03:42 GMT; path=/; domain=.google.com; HttpOnly
  Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
Length: unspecified [text/html]
Remote file exists and could contain further links,
but recursion is disabled -- not retrieving.

HTTP Status Code with wget

wget --spider -S https://google.com 2>&1 | grep HTTP
HTTP request sent, awaiting response... 
  HTTP/1.1 301 Moved Permanently
HTTP request sent, awaiting response... 
  HTTP/1.1 200 OK
Last updated on 5 Mar 2019
Published on 5 Mar 2019