AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified Apache-2.0 Self-run

Traffic Analysis

skill-chaterm-terminal-skills-traffic-analysis · by chaterm

流量分析与抓包

No reviews yet
0 installs
34 views
0.0% view→install

Install

$ agentstack add skill-chaterm-terminal-skills-traffic-analysis

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access Used
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-chaterm-terminal-skills-traffic-analysis)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
6mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Traffic Analysis? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

流量分析与抓包

概述

tcpdump、Wireshark、流量分析与网络诊断技能。

tcpdump

基础用法

# 监听所有接口
tcpdump -i any

# 指定接口
tcpdump -i eth0

# 详细输出
tcpdump -v
tcpdump -vv
tcpdump -vvv

# 显示 ASCII
tcpdump -A

# 显示十六进制
tcpdump -X
tcpdump -XX

# 不解析主机名
tcpdump -n

# 不解析端口名
tcpdump -nn

过滤表达式

# 主机过滤
tcpdump host 192.168.1.100
tcpdump src host 192.168.1.100
tcpdump dst host 192.168.1.100

# 网段过滤
tcpdump net 192.168.1.0/24

# 端口过滤
tcpdump port 80
tcpdump src port 80
tcpdump dst port 443
tcpdump portrange 8000-9000

# 协议过滤
tcpdump tcp
tcpdump udp
tcpdump icmp
tcpdump arp

# 组合过滤
tcpdump 'host 192.168.1.100 and port 80'
tcpdump 'src 192.168.1.100 and dst port 443'
tcpdump 'tcp and (port 80 or port 443)'
tcpdump 'not port 22'

保存与读取

# 保存到文件
tcpdump -w capture.pcap
tcpdump -w capture.pcap -c 1000    # 限制包数

# 读取文件
tcpdump -r capture.pcap
tcpdump -r capture.pcap -nn

# 轮转文件
tcpdump -w capture-%H%M%S.pcap -G 3600    # 每小时
tcpdump -w capture.pcap -C 100            # 每 100MB

高级过滤

# TCP 标志
tcpdump 'tcp[tcpflags] & tcp-syn != 0'
tcpdump 'tcp[tcpflags] & tcp-rst != 0'
tcpdump 'tcp[tcpflags] == tcp-syn'

# HTTP 请求
tcpdump -A 'tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)>2)) != 0)'

# DNS 查询
tcpdump -i any 'udp port 53'

# 大包
tcpdump 'greater 1000'
tcpdump 'less 100'

tshark (Wireshark CLI)

基础用法

# 安装
apt install tshark

# 监听
tshark -i eth0

# 指定过滤器
tshark -i eth0 -f "port 80"

# 显示过滤器
tshark -i eth0 -Y "http"

字段提取

# 提取特定字段
tshark -r capture.pcap -T fields -e ip.src -e ip.dst -e tcp.port

# HTTP 请求
tshark -r capture.pcap -Y "http.request" -T fields -e http.host -e http.request.uri

# DNS 查询
tshark -r capture.pcap -Y "dns.qry.name" -T fields -e dns.qry.name

统计分析

# 协议统计
tshark -r capture.pcap -q -z io,phs

# 会话统计
tshark -r capture.pcap -q -z conv,tcp

# HTTP 统计
tshark -r capture.pcap -q -z http,tree

# 端点统计
tshark -r capture.pcap -q -z endpoints,ip

ngrep

基础用法

# 安装
apt install ngrep

# 搜索内容
ngrep -q 'GET' port 80
ngrep -q 'password' port 80

# 指定接口
ngrep -d eth0 'pattern'

# 忽略大小写
ngrep -qi 'error'

iftop / nethogs

iftop

# 安装
apt install iftop

# 基础用法
iftop
iftop -i eth0

# 不解析主机名
iftop -n

# 显示端口
iftop -P

# 过滤
iftop -f "dst port 80"

nethogs

# 安装
apt install nethogs

# 按进程显示
nethogs
nethogs eth0

# 刷新间隔
nethogs -d 2

常见场景

场景 1:HTTP 流量分析

# 抓取 HTTP 请求
tcpdump -i any -A -s 0 'tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)>2)) != 0)'

# 提取 HTTP 头
tcpdump -i any -A 'tcp port 80' | grep -E "^(GET|POST|HTTP|Host:|Content-)"

# tshark 分析
tshark -i any -Y "http.request" -T fields -e http.host -e http.request.method -e http.request.uri

场景 2:DNS 问题排查

# 抓取 DNS
tcpdump -i any -nn port 53

# 详细 DNS 信息
tcpdump -i any -vvv port 53

# tshark DNS 分析
tshark -i any -Y "dns" -T fields -e dns.qry.name -e dns.a

场景 3:连接问题诊断

# TCP 握手
tcpdump -i any 'tcp[tcpflags] & (tcp-syn|tcp-fin|tcp-rst) != 0'

# 重传
tcpdump -i any 'tcp[tcpflags] & tcp-syn != 0 and tcp[tcpflags] & tcp-ack != 0'

# 连接重置
tcpdump -i any 'tcp[tcpflags] & tcp-rst != 0'

场景 4:带宽分析

# 实时带宽
iftop -i eth0 -P -n

# 按进程
nethogs eth0

# 统计流量
tcpdump -i eth0 -w - | pv > /dev/null

故障排查

| 问题 | 排查方法 | |------|----------| | 丢包 | 检查 tcpdump 统计、网卡队列 | | 延迟高 | 分析 RTT、重传 | | 连接失败 | 检查 SYN/RST 包 | | 带宽占用 | 使用 iftop/nethogs |

# 查看丢包
tcpdump -i eth0 -w /dev/null 2>&1 | grep -i drop

# 网卡统计
ethtool -S eth0 | grep -i error
cat /proc/net/dev

# 连接状态
ss -s
netstat -s | grep -i retrans

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.