{"id":30873451,"url":"https://github.com/sdaubert/packetgen-plugin-smb","last_synced_at":"2025-09-07T23:05:12.257Z","repository":{"id":56887209,"uuid":"148521019","full_name":"sdaubert/packetgen-plugin-smb","owner":"sdaubert","description":"SMB protocol suite plugin for packetgen","archived":false,"fork":false,"pushed_at":"2025-04-21T17:21:48.000Z","size":242,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-06T15:02:03.466Z","etag":null,"topics":["packetgen","ruby","smb","smbv1"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sdaubert.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,"zenodo":null}},"created_at":"2018-09-12T18:04:31.000Z","updated_at":"2025-04-21T17:21:51.000Z","dependencies_parsed_at":"2025-04-21T18:23:24.426Z","dependency_job_id":"81d02118-aabc-4860-a2ef-ee63dd19fda7","html_url":"https://github.com/sdaubert/packetgen-plugin-smb","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/sdaubert/packetgen-plugin-smb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdaubert%2Fpacketgen-plugin-smb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdaubert%2Fpacketgen-plugin-smb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdaubert%2Fpacketgen-plugin-smb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdaubert%2Fpacketgen-plugin-smb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sdaubert","download_url":"https://codeload.github.com/sdaubert/packetgen-plugin-smb/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdaubert%2Fpacketgen-plugin-smb/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274099158,"owners_count":25222147,"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","status":"online","status_checked_at":"2025-09-07T02:00:09.463Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["packetgen","ruby","smb","smbv1"],"created_at":"2025-09-07T23:05:11.449Z","updated_at":"2025-09-07T23:05:12.245Z","avatar_url":"https://github.com/sdaubert.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Gem Version](https://badge.fury.io/rb/packetgen-plugin-smb.svg)](https://badge.fury.io/rb/packetgen-plugin-smb)\n\n# Packetgen::Plugin::SMB\n\nThis is a plugin for [PacketGen gem](https://github.com/sdaubert/packetgen). It adds some support for SMB protocol suite:\n\n* NetBIOS:\n  * Datagram service,\n  * Session service,\n* SMB:\n  * SMB common header,\n  * Negotiate command,\n  * Close command,\n  * NtCreateAndX command,\n  * Trans command,\n  * Browser subprotocol,\n* SMB2:\n  * SMB2 common header (support 2.x and 3.x dialects),\n  * Negotiate command,\n  * SessionSetup command,\n* GSSAPI, used to transport negotiation over SMB2 commands,\n* NTLM, SMB authentication protocol,\n* LLMNR (_Link-Local Multicast Name Resolution_), resolution protocol used in SMB networks.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'packetgen-plugin-smb'\n```\n\nAnd then execute:\n\n```bash\nbundle\n```\n\nOr install it yourself as:\n\n```bash\ngem install packetgen-plugin-smb\n```\n\n## Usage\n\n### SMB2 with NTLM negociation\n\nSee [examples/smb-responder](/examples/smb-responder).\n\n### LLMNR\n\nLLMNR is a multicast protocol. Unless you want to have a fine control on UDP layer, the simplest way is to use it over a UDP ruby socket:\n\n```ruby\nrequire 'socket'\nrequire 'packetgen'\nrequire 'packetgen-plugin-smb'\n\nLLMNR_MCAST_ADDR = '224.0.0.252'\nLOCAL_IPADDR = 'x.x.x.x' # your IP\n\n# Open a UDP socket\nsocket = UDPSocket.new\n# Bind it to receive LLMNR response packets\nsocket.bind(LOCAL_IPADDR, 0)\n\n# Send a LLMNR query\nquery = PacketGen.gen('LLMNR', id: 0x1234, opcode: 'query')\nquery.llmnr.qd \u003c\u003c { rtype: 'Question', name: 'example.local' }\nsocket.send(query.to_s, 0, LLMNR_MCAST_ADDR, PacketGen::Plugin::LLMNR::UDP_PORT)\n\n# Get answer\n# data = socket.recv(1024)\ndata, peer = socket.recvfrom(1024)\nanswer = PacketGen.parse(data, first_header: 'LLMNR')\nexample_local_ip = answer.llmnr.an.to_a\n                         .find { |an| an.is_a?(PacketGen::Header::DNS::RR) }.human_rdata\nputs example_local_ip\n```\n\nYou have to manage multicast if you want to make a LLMNR responder. For further details, see [examples/llmnr-responder](/examples/llmnr-responder).\n\n## See also\n\nAPI documentation: \u003chttp://www.rubydoc.info/gems/packetgen-plugin-smb\u003e\n\n## License\n\nMIT License (see [LICENSE](https://github.com/sdaubert/packetgen-plugin-smb/blob/master/LICENSE))\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at \u003chttps://github.com/sdaubert/packetgen-plugin-smb\u003e.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsdaubert%2Fpacketgen-plugin-smb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsdaubert%2Fpacketgen-plugin-smb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsdaubert%2Fpacketgen-plugin-smb/lists"}