Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

A configurable DNS proxy server library

License

NotificationsYou must be signed in to change notification settings

ronin-rb/ronin-dns-proxy

Repository files navigation

CICode Climate

Description

ronin-dns-proxy is a configurable DNS proxy server library. It supportsreturning spoofing DNS results or passing DNS queries through to the upstreamDNS nameserver.

Features

  • Supports returning spoofed results to specific DNS queries.
  • Supports matching queries with regular expressions.
  • Supports dynamic DNS server rules.
  • Passing through all other DNS queries.
  • Has 95% documentation coverage.
  • Has 100% test coverage.

Examples

require'ronin/dns/proxy'Ronin::DNS::Proxy.run('127.0.0.1',2346)do |server|server.rule:A,'example.com','10.0.0.1'server.rule:AAAA,'example.com','dead:beef::1'# return multiple valuesserver.rule:A,'ftp.example.com',['10.0.0.42','10.0.0.43']# match a query using a regexserver.rule:TXT,/^spf\./,"v=spf1 include:10.0.0.1 ~all"# return an error for a valid hostnameserver.rule:A,'updates.example.com',:ServFail# define a dynamic ruleserver.rule(:CNAME,/^www\./)do |type,name,transaction|# append '.hax' to the domain namenames=name.split('.').push('hax')transaction.respond!(names)end# return MX recordsserver.rule(:MX,'example.com')do |type,name,transaction|transaction.respond!(10,Resolv::DNS::Name.create('email.evil.com'))endend

Then try runninghost -p 2346 example.com 127.0.0.1 once the server isrunning.

Requirements

Install

$ gem install ronin-dns-proxy

Gemfile

gem'ronin-dns-proxy','~> 0.1'

gemspec

gem.add_dependency'ronin-dns-proxy','~> 0.1'

Development

  1. Fork It!
  2. Clone It!
  3. cd ronin-dns-proxy/
  4. bundle install
  5. git checkout -b my_feature
  6. Code It!
  7. bundle exec rake spec
  8. git push origin my_feature

License

Copyright (c) 2023-2024 Hal Brodigan (postmodern.mod3@gmail.com)

ronin-dns-proxy is free software: you can redistribute it and/or modifyit under the terms of the GNU Lesser General Public License as publishedby the Free Software Foundation, either version 3 of the License, or(at your option) any later version.

ronin-dns-proxy is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See theGNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public Licensealong with ronin-dns-proxy. If not, seehttps://www.gnu.org/licenses/.


[8]ページ先頭

©2009-2025 Movatter.jp