{"id":13540270,"url":"https://github.com/packetfu/packetfu","last_synced_at":"2025-04-02T07:30:46.928Z","repository":{"id":56887208,"uuid":"1813046","full_name":"packetfu/packetfu","owner":"packetfu","description":"PacketFu, a mid-level packet manipulation library for Ruby","archived":false,"fork":false,"pushed_at":"2023-06-28T22:55:23.000Z","size":2339,"stargazers_count":377,"open_issues_count":30,"forks_count":88,"subscribers_count":21,"default_branch":"main","last_synced_at":"2024-05-22T01:42:39.866Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/packetfu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2011-05-28T04:41:28.000Z","updated_at":"2024-05-11T15:24:34.000Z","dependencies_parsed_at":"2024-01-17T15:08:37.312Z","dependency_job_id":null,"html_url":"https://github.com/packetfu/packetfu","commit_stats":{"total_commits":498,"total_committers":28,"mean_commits":"17.785714285714285","dds":0.5140562248995983,"last_synced_commit":"31cbecca9cd6d3486629ff4797433784a37ce2e4"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/packetfu%2Fpacketfu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/packetfu%2Fpacketfu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/packetfu%2Fpacketfu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/packetfu%2Fpacketfu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/packetfu","download_url":"https://codeload.github.com/packetfu/packetfu/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246774220,"owners_count":20831495,"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":[],"created_at":"2024-08-01T09:01:44.447Z","updated_at":"2025-04-02T07:30:42.946Z","avatar_url":"https://github.com/packetfu.png","language":"Ruby","readme":"# PacketFu\n\n[![Build Status](https://secure.travis-ci.org/packetfu/packetfu.svg)](http://travis-ci.org/packetfu/packetfu)\n[![Code Climate](https://codeclimate.com/github/packetfu/packetfu.svg)](https://codeclimate.com/github/packetfu/packetfu)\n[![Coverage Status](https://coveralls.io/repos/github/packetfu/packetfu/badge.svg?branch=master)](https://coveralls.io/github/packetfu/packetfu?branch=master)\n\nA library for reading and writing packets to an interface or to a\nlibpcap-formatted file.\n\nIt is maintained [here](https://github.com/packetfu/packetfu).\n\n## Setup\n\nTo install the gem, type\n\n```bash\ngem install packetfu\n```\n\nTo install from source, type\n\n```bash\ngem install bundler\ngit clone https://github.com/packetfu/packetfu.git\ncd packetfu\nbundle install\n```\n\n## Quick Start\n\nThe best way to test your installation is by using [packetfu-shell](https://github.com/packetfu/packetfu/blob/master/examples/packetfu-shell.rb), like so\n\n```bash\n$ rvmsudo ruby examples/packetfu-shell.rb\n _______  _______  _______  _        _______ _________ _______\n(  ____ )(  ___  )(  ____ \\| \\    /\\(  ____ \\\\__   __/(  ____ \\|\\     /|\n| (    )|| (   ) || (    \\/|  \\  / /| (    \\/   ) (   | (    \\/| )   ( |\n| (____)|| (___) || |      |  (_/ / | (__       | |   | (__    | |   | |\n|  _____)|  ___  || |      |   _ (  |  __)      | |   |  __)   | |   | |\n| (      | (   ) || |      |  ( \\ \\ | (         | |   | (      | |   | |\n| )      | )   ( || (____/\\|  /  \\ \\| (____/\\   | |   | )      | (___) |\n|/       |/     \\|(_______/|_/    \\/(_______/   )_(   |/       (_______)\n ____________________________              ____________________________\n(                            )            (                            )\n| 01000001 00101101 01001000 )( )( )( )( )( 00101101 01000001 00100001 |\n|                            )( )( )( )( )(                            |\n(____________________________)            (____________________________)\n                               PacketFu\n             a mid-level packet manipulation library for ruby\n\n\u003e\u003e\u003e PacketFu Shell 1.1.12.\n\u003e\u003e\u003e Use $packetfu_default.config for salient networking details.\nIP:  192.168.0.100   Mac: ac:bc:32:85:47:3f   Gateway: ec:08:6b:62:bc:d2\nNet: 192.168.0.0                              Iface:   en0\n\u003e\u003e\u003e Packet capturing/injecting enabled.\n\u003c\u003e\u003c\u003e\u003c\u003e\u003c\u003e\u003c\u003e\u003c\u003e\u003c\u003e\u003c\u003e\u003c\u003e\u003c\u003e\u003c\u003e\u003c\u003e\u003c\u003e\u003c\u003e\u003c\u003e\u003c\u003e\u003c\u003e\u003c\u003e\u003c\u003e\u003c\u003e\u003c\u003e\u003c\u003e\u003c\u003e\u003c\u003e\u003c\u003e\u003c\u003e\u003c\u003e\u003c\u003e\u003c\u003e\u003c\u003e\u003c\u003e\u003c\u003e\u003c\u003e\u003c\u003e\u003c\u003e\u003c\u003e\n2.3.0 :001 \u003e\n```\n\nOnce you're a this point, you're in an IRB (aka: [REPL](https://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop)) interface when you can start creating and injection packets with PacketFu.\n\nHere's an example of creating a TCPPacket and sending it out on the wire:\n\n```\n2.3.0 :002 \u003e packet = TCPPacket.new(:config =\u003e Utils.whoami?)\n =\u003e --EthHeader-------------------------------------------\n  eth_dst      ec:08:6b:62:bc:d2 PacketFu::EthMac\n  eth_src      ac:bc:32:85:47:3f PacketFu::EthMac\n  eth_proto    0x0800            StructFu::Int16\n--IPHeader--------------------------------------------\n  ip_v         4                 Integer\n  ip_hl        5                 Integer\n  ip_tos       0                 StructFu::Int8\n  ip_len       20                StructFu::Int16\n  ip_id        0x77e4            StructFu::Int16\n  ip_frag      0                 StructFu::Int16\n  ip_ttl       32                StructFu::Int8\n  ip_proto     6                 StructFu::Int8\n  ip_sum       0xffff            StructFu::Int16\n  ip_src       192.168.0.100     PacketFu::Octets\n  ip_dst       0.0.0.0           PacketFu::Octets\n--TCPHeader-------------------------------------------\n  tcp_src      42653             StructFu::Int16\n  tcp_dst      0                 StructFu::Int16\n  tcp_seq      0x8d65fbbf        StructFu::Int32\n  tcp_ack      0x00000000        StructFu::Int32\n  tcp_hlen     5                 PacketFu::TcpHlen\n  tcp_reserved 0                 PacketFu::TcpReserved\n  tcp_ecn      0                 PacketFu::TcpEcn\n  tcp_flags    ......            PacketFu::TcpFlags\n  tcp_win      16384             StructFu::Int16\n  tcp_sum      0x7f29            StructFu::Int16\n  tcp_urg      0                 StructFu::Int16\n  tcp_opts                       PacketFu::TcpOptions\n\n2.3.0 :003 \u003e packet.ip_daddr = \"8.8.8.8\"\n =\u003e \"8.8.8.8\"\n2.3.0 :004 \u003e packet.tcp_dst = 53\n =\u003e 53\n2.3.0 :005 \u003e packet.to_w\n =\u003e [1, 1, 54]\n```\n\n## Documentation\n\nPacketFu is yard-compatible (as well as sdoc/rdoc, if you prefer). You\ncan generate local documentation easily with either `yard doc .` or\n`sdoc`, and view doc/index.html with your favored browser. Once that's\ndone, navigate at the top, and read up on how to create a Packet or\nCapture from an interface with show_live or whatever.\n\n## Supported Rubies\n\nThis project is integrated with travis-ci and is regularly tested to work with the following rubies:\n\nTo checkout the current build status and what rubies we're currently supporting, click [here](https://travis-ci.org/packetfu/packetfu).\n\n## Supported OSs\n\nThis project is designed for use on Linux (Ubuntu|RHEL|BSD primarily) and OSX platforms and it is the intention of the PacketFu team to support those OSs to ensure PacketFu runs on them.  That said, PacketFu can and has been known to run on Windows as well as other unix-style platforms, but it's not actively supported in the sense that we may help from the community to help fill that gap.  If that is something you are interested in helping with, we welcome your support.\n\n## Authors\n\nPacketFu is maintained primarily by Tod Beardsley todb@packetfu.com and\nJonathan Claudius claudijd@yahoo.com, with help from Open Source Land.\n\nSee [LICENSE](https://github.com/packetfu/packetfu/blob/master/LICENSE.txt) for licensing details.\n","funding_links":[],"categories":["Networking","\u003ca id=\"79499aeece9a2a9f64af6f61ee18cbea\"\u003e\u003c/a\u003e浏览嗅探\u0026\u0026流量拦截\u0026\u0026流量分析\u0026\u0026中间人","\u003ca id=\"eec238a1a2657b70f7bbbe68a4421249\"\u003e\u003c/a\u003e其他","Ruby","WebSocket"],"sub_categories":["\u003ca id=\"99398a5a8aaf99228829dadff48fb6a7\"\u003e\u003c/a\u003e未分类-Network","\u003ca id=\"b239f12aca7aa942b45836032cbef99a\"\u003e\u003c/a\u003e转换"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpacketfu%2Fpacketfu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpacketfu%2Fpacketfu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpacketfu%2Fpacketfu/lists"}