iT邦幫忙

2025 iThome 鐵人賽

DAY 22
0
佛心分享-IT 人自學之術

從基礎開始—web學習之路系列 第 22

web基本認識-Wireshark 教學-get post cookie

  • 分享至 

  • xImage
  •  

常用 display filter 欄

只看 HTTP GET:

http.request.method == "GET"

只看 HTTP POST:

http.request.method == "POST"

找有 Cookie 的 HTTP 請求(request header 裡的 Cookie):

http.cookie

找回應裡的 Set-Cookie(伺服器設定 cookie):

http.set_cookie

只看某個 host(例如 example.com)的 HTTP:

http.host == "example.com"

同時看 GET 或 POST 並限定 host:

(http.request.method == "GET" || http.request.method == "POST") && http.host == "example.com"

若只想看 port 80(非 HTTPS)流量tcp.port == 80,在封包中找 GET / POST 與 Cookie(逐步)
套用上面的 filter(例如 http.request.method == "POST"),然後點選某個 HTTP 請求封包(Packet List)。最後在中間的 Packet Details 區塊展開 Hypertext Transfer Protocol 條目,會有GET /path HTTP/1.1

Host: example.com

Cookie: session=abcd; request 的 cookie
POST 的話,Header 下方或同一節會顯示 request body(例如 application/x-www-form-urlencoded 的 key=value)。但如果你要看整個對話(request+response)右鍵該封包 → Follow → TCP Stream(或 Wireshark 有的版本可用 Follow → HTTP Stream)。他會用 ASCII 顯示整段 HTTP 對話,能很直觀的去看 header 與 body。
看 Set-Cookie(伺服器回應)

Filter:http.set_cookie。

選 response 封包,展開 Hypertext Transfer Protocol,找 Set-Cookie: 欄位(會包含 cookie 名、值、path、domain、Expires、HttpOnly、Secure 等)。


上一篇
web基本認識-Wireshark 教學
系列文
從基礎開始—web學習之路22
圖片
  熱門推薦
圖片
{{ item.channelVendor }} | {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言