ttl-probe/README.md
2026-07-19 20:47:25 +05:00

33 lines
1.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# ttl-probe
[![CI](https://github.com/ImSavsis/ttl-probe/actions/workflows/ci.yml/badge.svg)](https://github.com/ImSavsis/ttl-probe/actions/workflows/ci.yml)
[![license](https://img.shields.io/github/license/ImSavsis/ttl-probe.svg)](https://github.com/ImSavsis/ttl-probe/blob/master/LICENSE)
свой traceroute на C++ через сырые ICMP-сокеты. шлёт echo-запросы с растущим TTL и смотрит кто отвечает "time exceeded" на каждом хопе.
```mermaid
sequenceDiagram
ttl-probe->>Hop1: ICMP echo, TTL=1
Hop1-->>ttl-probe: time exceeded
ttl-probe->>Hop2: ICMP echo, TTL=2
Hop2-->>ttl-probe: time exceeded
ttl-probe->>Target: ICMP echo, TTL=N
Target-->>ttl-probe: echo reply (дошли)
```
изначально планировал сюда честный fake-packet TTL-трюк (как в zapret), но на винде это требует сырых TCP-пакетов, а винда с висты их резать не даёт без отдельного драйвера (WinDivert/Npcap) — это уже не "просто". traceroute зато честно показывает сколько хопов до сервера, полезно прежде чем городить любой TTL-трюк вручную.
## сборка
```
cmake -B build
cmake --build build --config Release
```
## юзать
нужны права администратора (сырые сокеты):
```
build\Release\ttlprobe.exe example.com 30
```