curlでアクセスの詳細を確認する
詳細表示
-v オプション
verbose(詳細表示)
アクセス処理を順番に表示する
code: (sh)
# 名前解決
* Host yobo.temonalab.com:443 was resolved.
* IPv6: (none)
* IPv4: xxx
* Trying xxx:443...
# TCP接続
* Connected to yobo.temonalab.com (xxx) port 443
* ALPN: curl offers h2,http/1.1
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* CAfile: /etc/ssl/certs/ca-certificates.crt
* CApath: /etc/ssl/certs
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS handshake, Finished (20):
# SSL/TLS接続
* SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384 / prime256v1 / rsaEncryption
* ALPN: server did not agree on a protocol. Uses default.
* Server certificate:
* subject: CN=yobo.temonalab.com
* start date: May 27 23:40:27 2026 GMT
* expire date: Aug 25 23:40:26 2026 GMT
* subjectAltName: host "yobo.temonalab.com" matched cert's "yobo.temonalab.com"
* issuer: C=US; O=Let's Encrypt; CN=R12
# SSL証明書確認
* SSL certificate verify ok.
* Certificate level 0: Public key type RSA (2048/112 Bits/secBits), signed using sha256WithRSAEncryption
* Certificate level 1: Public key type RSA (2048/112 Bits/secBits), signed using sha256WithRSAEncryption
* Certificate level 2: Public key type RSA (4096/152 Bits/secBits), signed using sha256WithRSAEncryption
* using HTTP/1.x
# リクエストヘッダ
GET /request/list HTTP/1.1
Host: yobo.temonalab.com
User-Agent: curl/8.5.0
Accept: */*
# レスポンスヘッダ
< HTTP/1.1 401 Unauthorized
< Date: Thu, 11 Jun 2026 09:43:27 GMT
< WWW-Authenticate: Basic realm="Authorization"
< Status: 401 Unauthorized # ステータスコード
< X-Runtime: 0.00046
< Cache-Control: no-cache, max-age=900
< Content-Type: text/html; charset=utf-8
< Content-Length: 1
< Expires: Thu, 11 Jun 2026 09:58:27 GMT
< Vary: Accept-Encoding,User-Agent
< Set-Cookie: ...; path=/;secure;SameSite=None;
< x-frame-options: SAMEORIGIN
< x-xss-protection: 1;mode=block
< x-content-type-options: nosniff
< strict-transport-security: max-age=31536000
<
* Connection #0 to host yobo.temonalab.com left intact 以下のような状態なのが分かる
code:_
DNS OK
↓
TCP OK
↓
SSL OK
↓
webサーバ OK
↓
アプリ到達
↓
401
↓
Basic認証で停止
リダイレクト追跡
-L オプション
Locationを自動追跡する
code: (sh)
...
# リダイレクト元
GET / HTTP/1.1
< HTTP/1.1 301 Moved Permanently
* Issue another request to this URL:
GET / HTTP/1.1
Host: www.example.com
# リダイレクト先
< HTTP/1.1 200 OK
< Content-Type: text/html
以下のように追跡する
code:_
example.com
↓ 301
www.example.com
↓
200 OK
レスポンスヘッダのみ確認
-I オプション
code: (sh)
HTTP/2 200
date: Thu, 11 Jun 2026 10:00:33 GMT
content-type: text/html
server: cloudflare
last-modified: Wed, 10 Jun 2026 20:50:18 GMT
allow: GET, HEAD
accept-ranges: bytes
age: 3911
cf-cache-status: HIT
cf-ray: a09fc4f6bb17f601-NRT
Hostヘッダ偽装
-H オプション
ヘッダを偽装することでwebサーバを通さずAPサーバを直叩きできる
認証情報を付与することで認証を突破できる
Basic認証を突破
code: (sh)
curl \
-H "Authorization: Basic xxxxx" \
ホストヘッダを指定
code: (sh)
curl -v \
-H "Host: example.com" \
APサーバ直叩き
`sh
curl -v \
-H "X_FORWARDED_PROTO: https" \