Skip to content

Commit ff1f970

Browse files
committed
Land verified note refinements batch
1 parent 29f84d3 commit ff1f970

9 files changed

Lines changed: 421 additions & 373 deletions

File tree

TryHackMe/40-networking/network-fundamentals/04-packets-&-frames.md

Lines changed: 37 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,29 @@
1-
# Networking Fundamentals – Packets, TCP/UDP and Ports
1+
---
2+
type: resource-note
3+
status: done
4+
created: 2026-03-11
5+
updated: 2026-03-11
6+
tags: [security-writeup, tryhackme, networking, packets]
7+
source: TryHackMe - Packets & Frames
8+
platform: tryhackme
9+
room: Packets & Frames
10+
slug: packets-and-frames
11+
path: TryHackMe/40-networking/network-fundamentals/04-packets-&-frames.md
12+
topic: 40-networking
13+
domain: [networking]
14+
skills: [tcp-udp, ports, pcap]
15+
artifacts: [concept-notes]
16+
sanitized: true
17+
---
18+
19+
# Packets, TCP/UDP and Ports
220

321
> Source: Security Blue Team / networking module
422
> Scope: packets & frames, TCP three‑way handshake, UDP basics, ports 101 (practical)
523
624
---
725

8-
## 1. Packets and Frames
26+
## Summary
927

1028
### 1.1 Core definitions
1129

@@ -54,9 +72,11 @@ Some important header fields:
5472

5573
---
5674

57-
## 2. TCP/IP and the Three‑Way Handshake
75+
## Key Concepts
76+
77+
### 2. TCP/IP and the Three‑Way Handshake
5878

59-
### 2.1 TCP/IP model refresher
79+
#### 2.1 TCP/IP model refresher
6080

6181
TCP/IP is a practical networking model with **four layers**:
6282

@@ -67,7 +87,7 @@ TCP/IP is a practical networking model with **four layers**:
6787

6888
Like the OSI model, each layer adds its own headers → **encapsulation**. Removing them on the way up the stack is **decapsulation**.
6989

70-
### 2.2 TCP characteristics
90+
#### 2.2 TCP characteristics
7191

7292
* **Connection‑oriented** – must establish a connection **before** data transfer.
7393
* **Reliable** – guarantees ordered, loss‑free delivery (or signals failure).
@@ -83,7 +103,7 @@ Like the OSI model, each layer adds its own headers → **encapsulation**. Remov
83103
* Requires a stable connection between both hosts.
84104
* Extra handshakes and checks make it **slower** and more resource‑intensive than UDP.
85105

86-
### 2.3 Key TCP header fields
106+
#### 2.3 Key TCP header fields
87107

88108
* **Source Port** – ephemeral port chosen by the client (0–65535, unused at that moment).
89109
* **Destination Port** – port where a service is listening on the server (e.g. 80 for HTTP).
@@ -93,7 +113,7 @@ Like the OSI model, each layer adds its own headers → **encapsulation**. Remov
93113
* **Checksum** – integrity check over header + data.
94114
* **Flags** – bits that describe control information (SYN, ACK, FIN, RST, etc.).
95115

96-
### 2.4 The TCP three‑way handshake
116+
#### 2.4 The TCP three‑way handshake
97117

98118
Goal: establish a shared sequence‑number space and confirm both sides are ready.
99119

@@ -118,7 +138,7 @@ After this, both sides agree on:
118138

119139
Then the connection switches to normal **DATA** transfer.
120140

121-
### 2.5 Closing a TCP connection
141+
#### 2.5 Closing a TCP connection
122142

123143
* When one side is done sending data, it sends **FIN**.
124144
* The other side replies with **ACK**, then usually sends its own **FIN** when it is also done.
@@ -134,9 +154,9 @@ A **RST** flag can be sent by either side to **abruptly reset** a connection whe
134154

135155
---
136156

137-
## 3. UDP/IP
157+
### 3. UDP/IP
138158

139-
### 3.1 UDP characteristics
159+
#### 3.1 UDP characteristics
140160

141161
* **User Datagram Protocol (UDP)** – a simple, **connectionless** transport protocol.
142162
* No three‑way handshake, no synchronisation, no built‑in reliability.
@@ -155,7 +175,7 @@ A **RST** flag can be sent by either side to **abruptly reset** a connection whe
155175

156176
Use‑cases: where some loss is acceptable, or latency is more critical than reliability – e.g. **video/voice streaming, online games, DNS lookups**.
157177

158-
### 3.2 Typical UDP headers
178+
#### 3.2 Typical UDP headers
159179

160180
UDP segments are simpler than TCP segments, but seen at the IP layer they still sit inside an IP packet.
161181

@@ -172,9 +192,9 @@ There is **no handshake / ACK sequence** – the sender simply transmits datagra
172192

173193
---
174194

175-
## 4. Ports 101
195+
### 4. Ports 101
176196

177-
### 4.1 What is a port?
197+
#### 4.1 What is a port?
178198

179199
* Conceptually: a **numbered endpoint** on a host used by applications to send/receive data.
180200
* Range: `0–65535` (16‑bit unsigned integer).
@@ -185,7 +205,7 @@ Why standardise?
185205
* If every service used random ports, clients would not know where to connect.
186206
* So common protocols have **well‑known ports**; software defaults to these.
187207

188-
### 4.2 Common ports (well‑known 0–1024)
208+
#### 4.2 Common ports (well‑known 0–1024)
189209

190210
Some important defaults:
191211

@@ -200,13 +220,13 @@ Some important defaults:
200220

201221
> Note: services **can** run on non‑standard ports (e.g. HTTP on 8080). In that case the client must specify `host:port` explicitly.
202222
203-
### 4.3 Why ports matter in practice
223+
#### 4.3 Why ports matter in practice
204224

205225
* Ports allow multiple networked applications to coexist on one IP address.
206226
* Firewalls, IDS/IPS, and security policies often match on **port numbers** to allow/deny traffic.
207227
* Enumeration of open ports (e.g. with nmap) is a key recon step in security testing.
208228

209-
### 4.4 Practical challenge (from the room)
229+
#### 4.4 Practical challenge (from the room)
210230

211231
> Connect to IP `8.8.8.8` on port `1234` via the provided site to receive a flag.
212232
@@ -217,7 +237,7 @@ This exercise reinforces that:
217237

218238
---
219239

220-
## 5. Concept map
240+
### 5. Concept map
221241

222242
```mermaid
223243
flowchart LR

TryHackMe/40-networking/wireshark-the-basics.md

Lines changed: 31 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,44 @@
11
---
2-
2+
type: resource-note
3+
status: done
4+
created: 2026-01-31
5+
updated: 2026-03-11
6+
tags: [security-writeup, tryhackme, wireshark, networking]
7+
source: "TryHackMe - Wireshark: The Basics"
38
platform: tryhackme
49
room: "Wireshark: The Basics"
510
slug: wireshark-the-basics
6-
path: notes/TryHackMe/40-networking/wireshark-the-basics.md
11+
path: TryHackMe/40-networking/wireshark-the-basics.md
712
topic: 40-networking
8-
domain: DFIR, Networking
9-
skills: wireshark, pcap-analysis, display-filters
10-
artifacts: concept-notes, cookbook
11-
status: done
12-
date: 2026-01-31
13+
domain: [forensics, networking]
14+
skills: [wireshark, pcap, display-filters]
15+
artifacts: [concept-notes, cookbook]
16+
sanitized: true
1317
---
1418

15-
0. Summary
19+
# Wireshark: The Basics
20+
21+
## Summary
1622

1723
* Wireshark is a packet analyzer (network traffic analyser / 网络流量分析器) for live capture and offline PCAP inspection.
1824
* The UI is organized to support fast triage: Packet List → Packet Details → Packet Bytes (hex/ASCII).
1925
* Your basic analysis loop is: load PCAP → navigate packets → dissect layers → filter down → reconstruct streams → extract artifacts.
2026
* Two filter planes exist: capture filters (what you collect) vs display filters (what you view). This room focuses on display filters.
2127

22-
1. Key Concepts
28+
## Key Concepts
2329

24-
1.1 What Wireshark is / is not
30+
### 1.1 What Wireshark is / is not
2531

2632
* Wireshark is not an IDS (Intrusion Detection System / 入侵检测系统). It does not block or modify traffic; it helps you interpret it.
2733
* Its output quality depends on analyst hypotheses + protocol knowledge.
2834

29-
1.2 Primary use cases
35+
### 1.2 Primary use cases
3036

3137
* Troubleshooting: congestion, retransmissions, failure points.
3238
* Security hunting: rogue hosts, abnormal ports, suspicious protocols.
3339
* Protocol learning: response codes, headers, payloads.
3440

35-
1.3 GUI mental model (5 prominent sections)
41+
### 1.3 GUI mental model (5 prominent sections)
3642

3743
* Toolbar: capture, filtering, sorting, export/merge, statistics.
3844
* Display Filter Bar: the main query input for display filters.
@@ -57,7 +63,7 @@ ASCII layout sketch (conceptual)
5763
+--------------------------------------------------------------+
5864
```
5965

60-
1.4 Packet dissection (protocol dissection / 协议剖析)
66+
### 1.4 Packet dissection (protocol dissection / 协议剖析)
6167

6268
* Click a packet → Packet Details shows the protocol stack as a tree.
6369
* Clicking a field highlights its corresponding bytes in the Packet Bytes pane (byte-level grounding).
@@ -71,14 +77,14 @@ ASCII layout sketch (conceptual)
7177
* Application protocol (e.g., HTTP)
7278
* Application data (payload)
7379

74-
2. Pattern Cards
80+
## Pattern Cards
7581

76-
2.1 “If you can click it, you can filter it”
82+
### 2.1 “If you can click it, you can filter it”
7783

7884
* Select a field in Packet Details → right-click → Apply as Filter (immediate narrowing).
7985
* Use Prepare as Filter when you want to build a compound expression before applying.
8086

81-
2.2 Conversation-first triage
87+
### 2.2 Conversation-first triage
8288

8389
* When you want the whole conversation (endpoints + ports) rather than a single field:
8490

@@ -87,23 +93,23 @@ ASCII layout sketch (conceptual)
8793

8894
* View → Colourise Conversation.
8995

90-
2.3 Reconstruct application content
96+
### 2.3 Reconstruct application content
9197

9298
* Packet-level views fragment payload.
9399
* Follow Stream reconstructs application-level data:
94100

95101
* Follow TCP/UDP/HTTP Stream (depending on protocol).
96102
* After following, Wireshark applies a stream filter automatically; clear it using the “X” on the display filter bar.
97103

98-
2.4 “Navigate like a debugger”
104+
### 2.4 “Navigate like a debugger”
99105

100106
* Go to Packet: jump to a packet number when the task gives you an anchor (e.g., “packet 38”).
101107
* Find Packet: search content using String/Regex/Hex/Display filter, with the correct search scope (list/details/bytes).
102108
* Mark + Comments: annotate packets for later review or collaboration; marks reset per session, comments persist in the capture file.
103109

104-
3. Command Cookbook (only items present in the room text)
110+
## Command Cookbook
105111

106-
3.1 Display filter examples
112+
### 3.1 Display filter examples
107113

108114
```text
109115
# By protocol
@@ -123,13 +129,13 @@ udp.port == 53
123129
ip.addr == TARGET_IP
124130
```
125131

126-
3.2 File hash (terminal)
132+
### 3.2 File hash (terminal)
127133

128134
```bash
129135
md5sum <filename>
130136
```
131137

132-
4. Workflow Checklist (mapped to the room tasks)
138+
## Workflow Checklist (mapped to the room tasks)
133139

134140
Task 1–2: Loading + first orientation
135141

@@ -208,19 +214,19 @@ Right-click filtering modes
208214
* Apply as Column: add a field as a column to compare across many packets.
209215
* Follow Stream: reconstruct app-layer stream; auto-applies stream filter; clear with “X”.
210216

211-
5. Pitfalls
217+
## Pitfalls
212218

213219
* Searching the wrong pane: a string in Packet Details won’t be found if you search only Packet List.
214220
* Over-trusting color: packet coloring is a triage aid, not evidence.
215221
* Forgetting stream filters: Follow Stream silently applies a stream filter; if you “lose packets,” check the display filter bar.
216222
* Mixing capture vs display filters: beginners often type display syntax into capture filter fields.
217223

218-
6. References
224+
## References
219225

220226
* Wireshark User’s Guide (official): [https://www.wireshark.org/docs/wsug_html/](https://www.wireshark.org/docs/wsug_html/)
221227
* Display filter syntax (manpage): [https://www.wireshark.org/docs/man-pages/wireshark-filter.html](https://www.wireshark.org/docs/man-pages/wireshark-filter.html)
222228

223-
CN–EN Glossary (small)
229+
## CN–EN Glossary (small)
224230

225231
* packet capture / PCAP:数据包抓包文件
226232
* packet dissection:协议剖析 / 分层解析

0 commit comments

Comments
 (0)