Information Technology Grimoire

Version .0.0.1

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

curl

Troubleshooting:

To see header information.

Try from the host itself

  • curl localhost
  • curl local ip
  • curl public ip
  • curl hostname
  • curl https://hostname

Try from another host:

  • curl public ip
  • curl hostname
  • curl https://hostname

curl -s checkip.dyndns.org|sed -e ’s/.Current IP Address: //’ -e ’s/<.$//'

Examine a URL

$ curl -sI http://proxy/ HTTP/1.1 302 Found Location: http://proxy/?cfru=aHR0cDovL3Byb3h5Lw Cache-Control: no-cache Pragma: no-cache Content-Type: text/html; charset=utf-8 Proxy-Connection: close Connection: close Content-Length: 1097

Use a Proxy, and review

$ curl -x proxy:80 -U james http://clickable.biz/keywords -Is Enter proxy password for user ‘james’: HTTP/1.1 302 Found Date: Thu, 30 Sep 2010 23:14:45 GMT Server: Apache Location: https://adwords.google.com/select/KeywordToolExternal?forceLegacy=true Content-Type: application/octet-stream Proxy-Connection: Keep-Alive Connection: Keep-Alive

Use Proxy, See Content

$ curl -x proxy:80 -U james http://google.com Enter proxy password for user ‘james’:

301 Moved

301 Moved

The document has moved here.

Use Proxy, Just the header

$ curl -x proxy:80 -U james http://google.com -Is Enter proxy password for user ‘james’: HTTP/1.1 301 Moved Permanently Location: http://www.google.com/ Content-Type: text/html; charset=UTF-8 Date: Thu, 30 Sep 2010 23:20:20 GMT Expires: Sat, 30 Oct 2010 23:20:20 GMT Cache-Control: public, max-age=2592000 Server: gws X-XSS-Protection: 1; mode=block Content-Length: 219 Proxy-Connection: Keep-Alive Connection: Keep-Alive

Complete Headers

root@followupemails:~# curl -sIv https://perfectvacationpackages.com
*   Trying 52.15.70.99:443...
* Connected to perfectvacationpackages.com (52.15.70.99) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
*  CAfile: /etc/ssl/certs/ca-certificates.crt
*  CApath: /etc/ssl/certs
* TLSv1.0 (OUT), TLS header, Certificate Status (22):
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS header, Certificate Status (22):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS header, Finished (20):
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* TLSv1.3 (IN), TLS handshake, Finished (20):
* TLSv1.2 (OUT), TLS header, Finished (20):
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.2 (OUT), TLS header, Supplemental data (23):
* TLSv1.3 (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
* ALPN, server accepted to use http/1.1
* Server certificate:
*  subject: CN=perfectvacationpackages.com
*  start date: Jan 13 05:21:20 2023 GMT
*  expire date: Apr 13 05:21:19 2023 GMT
*  subjectAltName: host "perfectvacationpackages.com" matched cert's "perfectvacationpackages.com"
*  issuer: C=US; O=Let's Encrypt; CN=R3
*  SSL certificate verify ok.
* TLSv1.2 (OUT), TLS header, Supplemental data (23):
> HEAD / HTTP/1.1
> Host: perfectvacationpackages.com
> User-Agent: curl/7.81.0
> Accept: */*
>
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* old SSL session ID is stale, removing
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
HTTP/1.1 200 OK
< Date: Sun, 22 Jan 2023 02:27:11 GMT
Date: Sun, 22 Jan 2023 02:27:11 GMT
< Server: Apache
Server: Apache
< X-XSS-Protection: 1; mode=block
X-XSS-Protection: 1; mode=block
< x-Frame-Options: SAMEORIGIN
x-Frame-Options: SAMEORIGIN
< X-Content-Type-Options: nosniff
X-Content-Type-Options: nosniff
< Strict-Transport-Security: max-age=63072000; includeSubDomains; preload
Strict-Transport-Security: max-age=63072000; includeSubDomains; preload
< Referrer-Policy: strict-origin-when-cross-origin
Referrer-Policy: strict-origin-when-cross-origin
< Content-Security-Policy: upgrade-insecure-requests; report-uri https://perfectvacationpackages.com
Content-Security-Policy: upgrade-insecure-requests; report-uri https://perfectvacationpackages.com
< Permissions-Policy: accelerometer=(), autoplay=(), camera=(), fullscreen=*, geolocation=(self), gyroscope=(), microphone=(), payment=*
Permissions-Policy: accelerometer=(), autoplay=(), camera=(), fullscreen=*, geolocation=(self), gyroscope=(), microphone=(), payment=*
< X-XSS-Protection: 1; mode=block
X-XSS-Protection: 1; mode=block
< Access-Control-Allow-Origin: null
Access-Control-Allow-Origin: null
< Access-Control-Allow-Methods: GET,PUT,POST,DELETE
Access-Control-Allow-Methods: GET,PUT,POST,DELETE
< Access-Control-Allow-Headers: Content-Type, Authorization
Access-Control-Allow-Headers: Content-Type, Authorization
< X-Content-Security-Policy: img-src *; media-src * data:;
X-Content-Security-Policy: img-src *; media-src * data:;
< X-Content-Type-Options: nosniff
X-Content-Type-Options: nosniff
< Content-Security-Policy: report-uri https://perfectvacationpackages.com
Content-Security-Policy: report-uri https://perfectvacationpackages.com
< Referrer-Policy: strict-origin-when-cross-origin
Referrer-Policy: strict-origin-when-cross-origin
< Cross-Origin-Embedder-Policy-Report-Only: unsafe-none; report-to="default"
Cross-Origin-Embedder-Policy-Report-Only: unsafe-none; report-to="default"
< Cross-Origin-Embedder-Policy: unsafe-none; report-to="default"
Cross-Origin-Embedder-Policy: unsafe-none; report-to="default"
< Cross-Origin-Opener-Policy-Report-Only: same-origin; report-to="default"
Cross-Origin-Opener-Policy-Report-Only: same-origin; report-to="default"
< Cross-Origin-Resource-Policy: cross-origin
Cross-Origin-Resource-Policy: cross-origin
< X-Frame-Options: SAMEORIGIN
X-Frame-Options: SAMEORIGIN
< Permissions-Policy: accelerometer=(), autoplay=(), camera=(), cross-origin-isolated=(), document-domain=(), encrypted-media=(), fullscreen=*, geolocation=(self), gyroscope=(), keyboard-map=(), magnetometer=(), microphone=(), midi=(), payment=*, picture-in-picture=(), publickey-credentials-get=(), screen-wake-lock=(), sync-xhr=(self), usb=(), xr-spatial-tracking=(), gamepad=(), serial=(), window-placement=()
Permissions-Policy: accelerometer=(), autoplay=(), camera=(), cross-origin-isolated=(), document-domain=(), encrypted-media=(), fullscreen=*, geolocation=(self), gyroscope=(), keyboard-map=(), magnetometer=(), microphone=(), midi=(), payment=*, picture-in-picture=(), publickey-credentials-get=(), screen-wake-lock=(), sync-xhr=(self), usb=(), xr-spatial-tracking=(), gamepad=(), serial=(), window-placement=()
< Feature-Policy: display-capture 'self'
Feature-Policy: display-capture 'self'
< X-Permitted-Cross-Domain-Policies: none
X-Permitted-Cross-Domain-Policies: none
< Strict-Transport-Security: max-age=63072000; includeSubDomains; preload
Strict-Transport-Security: max-age=63072000; includeSubDomains; preload
< Link: <https://perfectvacationpackages.com/wp-json/>; rel="https://api.w.org/"
Link: <https://perfectvacationpackages.com/wp-json/>; rel="https://api.w.org/"
< Link: <https://perfectvacationpackages.com/wp-json/wp/v2/pages/9>; rel="alternate"; type="application/json"
Link: <https://perfectvacationpackages.com/wp-json/wp/v2/pages/9>; rel="alternate"; type="application/json"
< Link: <https://perfectvacationpackages.com/>; rel=shortlink
Link: <https://perfectvacationpackages.com/>; rel=shortlink
< Content-Type: text/html; charset=UTF-8
Content-Type: text/html; charset=UTF-8

<
* Connection #0 to host perfectvacationpackages.com left intact