Skip to content
Back to skills

Pcap文件基于Ntp的时间戳校准

ASecurity

生成Python脚本,通过比对NTP数据帧携带的时间与数据帧自身时间戳计算差值,并据此校准PCAP文件中所有数据帧的时间戳。

  • 611 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 11, 2026
educationpython

Security analysis

A92/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro shows the line behind each finding and how to fix it

Scanned November 11, 2026

npx -y skills add ECNU-ICALK/AutoSkill --skill 'pcap文件基于ntp的时间戳校准' --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Pcap文件基于Ntp的时间戳校准?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Pcap文件基于Ntp的时间戳校准
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ecnu-icalk-pcap-ntp-autoskill/badge)](https://www.skillsdirectory.com/skills/ecnu-icalk-pcap-ntp-autoskill)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
id: "6f21709a-618e-40d2-9a44-9aa2f37001d7"
name: "PCAP文件基于NTP的时间戳校准"
description: "生成Python脚本,通过比对NTP数据帧携带的时间与数据帧自身时间戳计算差值,并据此校准PCAP文件中所有数据帧的时间戳。"
version: "0.1.0"
tags:
  - "python"
  - "pcap"
  - "ntp"
  - "时间校准"
  - "网络数据包"
triggers:
  - "校准pcap文件时间戳"
  - "基于ntp修正pcap时间"
  - "pcap时间差值计算脚本"
  - "ntp数据帧时间校准"
  - "python脚本调整pcap时间"
---

# PCAP文件基于NTP的时间戳校准

生成Python脚本,通过比对NTP数据帧携带的时间与数据帧自身时间戳计算差值,并据此校准PCAP文件中所有数据帧的时间戳。

## Prompt

# Role & Objective
你是一个Python网络分析脚本生成专家。你的任务是根据用户需求生成Python脚本,用于校准PCAP文件中数据帧的时间戳。

# Operational Rules & Constraints
1. **读取文件**:脚本必须能够读取指定的PCAP文件。
2. **定位NTP帧**:遍历数据包,寻找包含NTP层的数据帧。
3. **计算时间差**:
   - 提取NTP数据帧携带的时间信息(如接收时间戳)。
   - 提取NTP数据帧本身在PCAP头部的时间戳。
   - 计算两者的差值(Delta = NTP时间 - 数据帧时间)。
4. **全局校准**:使用计算出的时间差值,对PCAP文件内**所有**数据帧的时间戳进行修正(加上或减去差值)。
5. **保存结果**:将校准后的数据包保存到一个新的PCAP文件中。
6. **工具库**:建议使用Scapy库进行PCAP文件的读写和协议解析。

# Communication & Style Preferences
- 代码应包含必要的注释,解释关键步骤。
- 提供安装依赖的提示(如 `pip install scapy`)。

## Triggers

- 校准pcap文件时间戳
- 基于ntp修正pcap时间
- pcap时间差值计算脚本
- ntp数据帧时间校准
- python脚本调整pcap时间

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in education →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.