{"id":16332996,"url":"https://github.com/davidyslu/Packet_Manipulation","last_synced_at":"2025-04-10T06:32:49.637Z","repository":{"id":93934384,"uuid":"151941606","full_name":"davidyslu/Packet_Manipulation","owner":"davidyslu","description":"Lab in NCTU course \"Introduction to Computer Networks 2018\"","archived":false,"fork":false,"pushed_at":"2019-01-23T03:18:47.000Z","size":4582,"stargazers_count":4,"open_issues_count":0,"forks_count":7,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-08T01:38:12.270Z","etag":null,"topics":["packet-manipulation","python","scapy","tcpdump","wireshark"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/davidyslu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-10-07T12:58:16.000Z","updated_at":"2024-08-12T19:42:15.000Z","dependencies_parsed_at":"2023-03-16T13:15:13.916Z","dependency_job_id":null,"html_url":"https://github.com/davidyslu/Packet_Manipulation","commit_stats":null,"previous_names":["davidyslu/packet_manipulation"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidyslu%2FPacket_Manipulation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidyslu%2FPacket_Manipulation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidyslu%2FPacket_Manipulation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidyslu%2FPacket_Manipulation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davidyslu","download_url":"https://codeload.github.com/davidyslu/Packet_Manipulation/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248168452,"owners_count":21058839,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["packet-manipulation","python","scapy","tcpdump","wireshark"],"created_at":"2024-10-10T23:34:01.404Z","updated_at":"2025-04-10T06:32:49.618Z","avatar_url":"https://github.com/davidyslu.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Packet Manipulation via Scapy\r\n\r\nThis repository is a lab for NCTU course \"Introduction to Computer Networks 2018\".\r\n\r\n---\r\n## Abstract\r\n\r\nIn this lab we are going to learn how to use Scapy - a powerful interactive packet manipulation program, which can forge or decode packets of a wide number of protocols, send them on wire, capture them, match requests and replies, and much more.\r\n\r\n---\r\n## Objectives\r\n\r\n1. Learn how to define your own protocol and generate a packet payload\r\n2. Learn how to use Wireshark to filter packets and find your wanted information\r\n\r\nThis lab aims to learn how we use Scapy and Python to program a simple network protocol and observe the behavior of packet sending and receiving via Wireshark.\r\n\r\n* Basic knowledge of Docker\r\n* Linux networking\r\n* Python with Scapy\r\n* Wireshark\r\n\r\n---\r\n## Overview\r\n\r\n![](https://i.imgur.com/7RFvA3l.png)\r\n\r\n* Define our own proprietary protocol\r\n* In this protocol, we will iteratively send to a server\r\n    1. ID packet: your (ID + department + gender)\r\n    2. Secret packet: a digit of the secret key\r\n* The above procedure will repeat 14 times so that you will collect a 14-digit secret key\r\n    * E.g., 41228904512480\r\n\r\n![](https://i.imgur.com/276Z0iA.png)\r\n\r\n### Packet Format\r\n\r\n* ID Packet\r\n    ![](https://i.imgur.com/37C6IJE.png)\r\n* Secret Packet\r\n    ![](https://i.imgur.com/Ci9fJa5.png)\r\n\r\n---\r\n## Installation\r\n\r\n* **Docker (Docker CE)**\r\n    * [Windows](https://docs.docker.com/docker-for-windows/)\r\n    * [MacOS](https://docs.docker.com/docker-for-mac/)\r\n    * [Ubuntu Linux](https://docs.docker.com/install/linux/docker-ce/ubuntu/)\r\n    * [Others](https://docs.docker.com/install/)\r\n* **[Wireshark 2.6.3](https://www.wireshark.org/download.html)**\r\n    * Windows ([32-bit](https://1.as.dl.wireshark.org/win32/Wireshark-win32-2.6.3.exe) / [64-bit](https://1.as.dl.wireshark.org/win64/Wireshark-win64-2.6.3.exe))\r\n    * [MacOS](https://1.as.dl.wireshark.org/osx/Wireshark%202.6.3%20Intel%2064.dmg)\r\n    * Ubuntu Linux\r\n        ```bash\r\n        $ sudo apt-get install -y wireshark\r\n        ```\r\n* Others\r\n    * [PieTTy](https://drive.google.com/file/d/0BxKoW6fgUa0CSTJDMmlDNC1nUDg/view) (for Windows)\r\n\r\n---\r\n## Tasks\r\n\r\n\u003e **NOTICE:** Please follow this [slides](Tasks.pdf) for detail.\r\n\r\n* **In lab assignement**\r\n    1. Environment Setup\r\n    2. Define protocol via Scapy\r\n    3. Send packets\r\n    4. Sniff packets\r\n    5. Run sender and receiver\r\n    6. Push your files to remote\r\n* **Homework assignement**\r\n    1. Load PCAP via Wireshark\r\n    2. Filter the target packet\r\n    3. Decode the secret key\r\n    4. Report\r\n\r\n### File Structure\r\n\r\n```bash\r\nPacket Manipulation/                # This is ./ in this repository\r\n|--- docker/                        # Docker configuration\r\n     |--- Dockerfile\r\n     |--- main.sh                   # Scripts for running Docker\r\n     |--- [Other files...]\r\n|--- src/                           # Source code\r\n     |--- data/                     # Input files\r\n          |--- record.txt           # Example file for R/W\r\n     |--- out/                      # Output files\r\n     |--- scripts/                  # Networks configuration\r\n          |--- main.sh              # Scripts for build namespace\r\n          |--- [Other files...]\r\n     |--- sender.py                 # Send packets\r\n     |--- receiver.py               # Receive and sniff packets\r\n     |--- Protocol.py               # Define your own protocol\r\n     |--- decoder.py                # Decode the output file\r\n|--- LICENSE\r\n|--- README.md\r\n```\r\n\r\n---\r\n## Contributor\r\n\r\n* [David Lu](https://github.com/yungshenglu)\r\n\r\n---\r\n## License\r\n\r\n[GNU GENERAL PUBLIC LICENSE Version 3](LICENSE)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidyslu%2FPacket_Manipulation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidyslu%2FPacket_Manipulation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidyslu%2FPacket_Manipulation/lists"}