Skip to content

Commit e67a287

Browse files
authored
Update README.md
1 parent 9df2ac2 commit e67a287

File tree

1 file changed

+93
-0
lines changed

1 file changed

+93
-0
lines changed

README.md

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,13 @@ Each tool is self-contained with its own documentation and can be built independ
4040
| 📡 **wifi_audit** | Passive Wi-Fi auditing tool (802.11 Beacon/Probe analysis, monitor mode) | ✅ Complete | [tools/wifi_audit](./tools/wifi_audit/) |
4141
| 🔑 **crypto** | Educational implementations of classical/symmetric/asymmetric ciphers & hashing | ✅ Complete | [research/crypto](./research/crypto/) |
4242
| 🛡️ **linux-kernel-exploits** | Educational CVE labs & write-ups for kernel exploitation research | ✅ Complete | [linux-kernel-exploits](./linux-kernel-exploits/) |
43+
| 🌳 **merkle** | Efficient Merkle hash tree implementation using SHA-256 | ✅ Complete | [research/merkle](./research/merkle/) |
44+
| 🚧 **protocols** | Network protocol analysis (in development) | 🚧 In Progress | [research/protocols](./research/protocols/) |
45+
| 📋 **vulns** | Vulnerability research & proofs of concept (planned) | 📋 Planned | [research/vulns](./research/vulns/) |
46+
| 📋 **hash_cracker** | Multi-algorithm password cracking tool | 📋 Planned | [tools/hash_cracker](./tools/hash_cracker/) |
47+
| 📋 **log_analyzer** | Security log correlation and anomaly detection | 📋 Planned | [tools/log_analyzer](./tools/log_analyzer/) |
48+
| 📋 **web_fuzzer** | Web directory/parameter fuzzer | 📋 Planned | [tools/web_fuzzer](./tools/web_fuzzer/) |
49+
| 📋 **packet_sniffer** | Network packet sniffer | 📋 Planned | [tools/packet_sniffer](./tools/packet_sniffer/) |
4350

4451
> ⚠️ **Important:** All tools are designed for **educational and authorized security testing only**. Always ensure proper authorization before use.
4552
@@ -151,6 +158,8 @@ rust-security-suminworld/
151158
│ ├── protocols/ # 🚧 Network protocol analysis
152159
│ └── vulns/ # 📋 Vulnerability research & PoCs
153160
├── linux-kernel-exploits/ # ✅ Kernel exploitation labs & CVE research
161+
├── PoCs/ # Proof-of-concepts for attacks (e.g., cache side channels)
162+
│ └── cache/ # Flush+Reload timing attack PoC (C code)
154163
├── docs/ # Documentation and learning resources
155164
│ ├── learning_notes.md # Study notes and progress logs
156165
│ ├── tool_usage.md # Detailed usage guides
@@ -235,6 +244,90 @@ cargo run -p packet-match-fuzz -- --pattern "HTTP" --input sample.pcap
235244
cargo run -p crypto --example demo
236245
```
237246

247+
## 🔎 Side-Channel Research — Flush+Reload (Cache) PoC
248+
249+
**Warning:** The experimental code in this section is for educational purposes only and must be executed exclusively in a local virtual machine or dedicated experimental equipment, and only in environments with explicit authorization.
250+
251+
Side-channel attacks are techniques that infer secrets from incidental information such as computation time, power consumption, or cache behavior. This repository includes a PoC of **Flush+Reload**, a representative cache-based attack technique. Flush+Reload is a high-resolution, low-noise attack targeting the L3 cache that can determine whether specific memory lines have been accessed, without requiring the attacker and victim to share the same CPU core. This PoC consists of C code located in the `PoCs/cache/` directory.
252+
253+
### Overview
254+
255+
- **Victim Program**: A simulator that repeatedly accesses specific memory indices
256+
- **Attacker Program**: Uses `clflush` and `rdtscp` to measure memory access times, distinguishing cache hits from misses
257+
- **Execution Script**: Runs the victim in the background, saves attacker results to CSV, then terminates the victim
258+
259+
### Running the Experiment
260+
261+
```bash
262+
# Run victim process in background
263+
./PoCs/cache/victim_sim &
264+
VICTIM_PID=$!
265+
266+
# Run attacker and save to CSV
267+
./PoCs/cache/flush_reload_attacker > /tmp/flush_reload_data.csv
268+
269+
# Terminate victim process
270+
kill $VICTIM_PID
271+
```
272+
273+
### Data Format and Interpretation
274+
275+
The CSV format is `iter,cycles` where small values (~1,000 cycles) indicate cache hits and large values (hundreds of thousands of cycles) indicate cache misses or interrupt/context switches.
276+
277+
**Sample Output:**
278+
```csv
279+
iter,cycles
280+
0,158000
281+
1,1000
282+
2,1000
283+
3,155000
284+
4,1000
285+
...
286+
```
287+
288+
Measurements typically form two distinct clusters:
289+
- **Low latency cluster**: Cache hits (victim accessed the memory, data in cache)
290+
- **High latency cluster**: Cache misses or interrupts/context switches
291+
292+
### Analysis Examples
293+
294+
**Statistics:**
295+
```bash
296+
# Count samples
297+
wc -l /tmp/flush_reload_data.csv
298+
299+
# Calculate mean
300+
awk -F, 'NR>1{n++; sum+=$2} END{print "Samples:", n, "Mean:", sum/n}' /tmp/flush_reload_data.csv
301+
```
302+
303+
**Visualization (Python):**
304+
```python
305+
import csv, numpy as np
306+
import matplotlib.pyplot as plt
307+
308+
xs = []
309+
with open('/tmp/flush_reload_data.csv') as f:
310+
r = csv.reader(f)
311+
next(r)
312+
for _, c in r:
313+
xs.append(int(c))
314+
315+
xs = np.array(xs)
316+
plt.hist(xs, bins=200, log=True)
317+
plt.xlabel('Cycles')
318+
plt.ylabel('Count (log scale)')
319+
plt.title('Flush+Reload Distribution')
320+
plt.yscale('log')
321+
plt.show()
322+
```
323+
324+
### Security Implications
325+
326+
Flush+Reload can be exploited for practical attacks such as tracking AES S-box accesses to extract cryptographic keys. Therefore, defensive techniques should be applied to reduce side-channel leakage, including:
327+
- Constant-time implementations
328+
- Cache partitioning (e.g., Intel CAT)
329+
- Memory access pattern obfuscation
330+
238331
## 🛣️ Roadmap
239332

240333
### Phase 1: Core Tools (Current)

0 commit comments

Comments
 (0)