{"id":13774032,"url":"https://github.com/dns-oarc/dnsjit","last_synced_at":"2025-04-09T23:19:30.337Z","repository":{"id":28903744,"uuid":"117547158","full_name":"DNS-OARC/dnsjit","owner":"DNS-OARC","description":"Engine for capturing, parsing and replaying DNS","archived":false,"fork":false,"pushed_at":"2025-03-11T08:38:30.000Z","size":1428,"stargazers_count":58,"open_issues_count":20,"forks_count":13,"subscribers_count":7,"default_branch":"develop","last_synced_at":"2025-04-02T21:11:16.494Z","etag":null,"topics":["dns","lua","luajit","network-capture","pcap"],"latest_commit_sha":null,"homepage":"","language":"C","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/DNS-OARC.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES","contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"custom":"https://www.dns-oarc.net/donate"}},"created_at":"2018-01-15T13:13:11.000Z","updated_at":"2025-03-11T08:38:35.000Z","dependencies_parsed_at":"2022-08-07T14:00:55.921Z","dependency_job_id":"51a80d39-c901-4e59-9f9c-d426805594fa","html_url":"https://github.com/DNS-OARC/dnsjit","commit_stats":{"total_commits":444,"total_committers":3,"mean_commits":148.0,"dds":0.4211711711711712,"last_synced_commit":"c844171d6dda031a7e96012f72f4e68142a05a8e"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DNS-OARC%2Fdnsjit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DNS-OARC%2Fdnsjit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DNS-OARC%2Fdnsjit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DNS-OARC%2Fdnsjit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DNS-OARC","download_url":"https://codeload.github.com/DNS-OARC/dnsjit/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248125825,"owners_count":21051809,"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":["dns","lua","luajit","network-capture","pcap"],"created_at":"2024-08-03T17:01:23.050Z","updated_at":"2025-04-09T23:19:30.305Z","avatar_url":"https://github.com/DNS-OARC.png","language":"C","funding_links":["https://www.dns-oarc.net/donate"],"categories":["\u003ca id=\"58b6684347a223e01d4d76d9ca185a88\"\u003e\u003c/a\u003eReplay\u0026\u0026重播"],"sub_categories":[],"readme":"# Engine for capturing, parsing and replaying DNS\n\n[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=dns-oarc%3Adnsjit\u0026metric=bugs)](https://sonarcloud.io/summary/new_code?id=dns-oarc%3Adnsjit) [![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=dns-oarc%3Adnsjit\u0026metric=security_rating)](https://sonarcloud.io/summary/new_code?id=dns-oarc%3Adnsjit)\n\n**dnsjit** is a combination of parts taken from **dsc**, **dnscap**, **drool**,\nand put together around Lua to create a script-based engine for easy\ncapturing, parsing and statistics gathering of DNS messages while also\nproviding facilities for replaying DNS traffic.\n\nOne of the core functionality that **dnsjit** brings is to tie together C\nand Lua modules through a receiver/producer interface.\nThis allows creation of custom chains of functionality to meet various\nrequirements.\nAnother core functionality is the ability to parse and process DNS messages\neven if the messages are non-compliant with the DNS standards.\n\nThe following Lua module categories exists:\n- `dnsjit.core`: Core modules for handling things like logging, DNS messages and receiver/receive functionality.\n- `dnsjit.lib`: Various Lua libraries or C library bindings.\n- `dnsjit.input`: Input modules used to read DNS messages in various ways.\n- `dnsjit.filter`: Filter modules to process or manipulate DNS messages.\n- `dnsjit.output`: Output modules used to display DNS message, export to various formats or replay them against other targets.\n\nSee each category's man-page for more information.\n\nMore information may be found here:\n- https://www.dns-oarc.net/tools/dnsjit\n\nIssues should be reported here:\n- https://github.com/DNS-OARC/dnsjit/issues\n\nGeneral support and discussion:\n- Mattermost: https://chat.dns-oarc.net/community/channels/oarc-software\n\n## Packages\n\nhttps://dev.dns-oarc.net/packages\n\nPackages for Debian, Ubuntu, EPEL, SLE, openSUSE can be found in the\nPRE-RELEASE channel. Some distributions are limited to certain\narchitectures because of LuaJIT.\n\n## Dependencies\n\n- [libluajit](http://luajit.org/) 2.0+ (or compatible alternatives)\n- [libpcap](http://www.tcpdump.org/)\n- [liblmdb](https://github.com/LMDB/lmdb)\n- [libck](https://github.com/concurrencykit/ck)\n- [libgnutls](https://www.gnutls.org/)\n- [liblz4](http://www.lz4.org/)\n- [libzstd](http://www.zstd.net/)\n- [luajit](http://luajit.org/) (for building)\n- automake/autoconf/libtool/pkg-config (for building)\n\nDebian/Ubuntu: `apt-get install libluajit-5.1-dev libpcap-dev luajit liblmdb-dev libck-dev libgnutls28-dev liblz4-dev libzstd-dev`\n- Note: On Xenial you'll need to install `libzstd1-dev`\n\nCentOS: `yum install luajit-devel libpcap-devel lmdb-devel ck-devel gnutls-devel lz4-devel libzstd-devel`\n- Note: You might need EPEL and/or PowerTools repositories enabled\n\nFreeBSD: `pkg install luajit libpcap lmdb gnutls concurrencykit zstd liblz4`\n\nOpenBSD: `pkg_add luajit gnutls lz4 zstd` + manual install of libpcap, liblmdb and libck\n\nOn some version of SUSE Linux Enterprise moonjit is used as an compatible\nalternative to luajit.\n\n## Build\n\n```shell\ngit clone https://github.com/DNS-OARC/dnsjit\ncd dnsjit\nsh autogen.sh\n./configure\nmake\n```\n\n## Documentation\n\nMost documentation exists in man-pages and you do not have to install to\naccess them, after building you can do:\n\n```shell\nman src/dnsjit.1\nman src/dnsjit.core.3\nman src/dnsjit.lib.3\nman src/dnsjit.input.3\nman src/dnsjit.filter.3\nman src/dnsjit.output.3\n```\n\n## Usage\n\nRun a Lua script:\n\n```shell\ndnsjit file.lua ...\n```\n\nShebang-style:\n```lua\n#!/usr/bin/env dnsjit\n...\n```\n\n## Example\n\nFollowing example display the DNS ID found in queries.\n\n```lua\nrequire(\"dnsjit.core.objects\")\nlocal input = require(\"dnsjit.input.pcap\").new()\nlocal layer = require(\"dnsjit.filter.layer\").new()\nlocal dns = require(\"dnsjit.core.object.dns\").new()\n\ninput:open_offline(arg[2])\nlayer:producer(input)\nlocal producer, ctx = layer:produce()\n\nwhile true do\n    local object = producer(ctx)\n    if object == nil then break end\n    if object:type() == \"payload\" then\n        dns:reset()\n        dns.obj_prev = object\n        if dns:parse_header() == 0 then\n            print(dns.id)\n        end\n    end\nend\n```\n\nDisclaimer, to keep the above example short it only works on pre-prepared\nPCAPs with only UDP DNS traffic in them.\n\nSee more examples in the [examples](https://github.com/DNS-OARC/dnsjit/tree/develop/examples) directory.\n\n## Copyright\n\nCopyright (c) 2018-2024 OARC, Inc.\n\nAll rights reserved.\n\n```\nThis file is part of dnsjit.\n\ndnsjit is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\ndnsjit is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with dnsjit.  If not, see \u003chttp://www.gnu.org/licenses/\u003e.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdns-oarc%2Fdnsjit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdns-oarc%2Fdnsjit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdns-oarc%2Fdnsjit/lists"}