Giter Site home page Giter Site logo

dnsproxy's Introduction

A DNS server/poor person's NAT/tunneling tool combo. A hack to tunnel traffic for a network device that doesn't natively support VPN or SOCKS, but lets you choose the DNS server. It does this by responding to DNS queries with 'fake' IP addresses that are actually assigned to the machine running this code, then proxying the traffic to its original destination.

It's not as good as having a normal IPSEC tunnel and just routing traffic through that, but after a couple of hours wrestling with Strongswan config and XFRM policies I figured this was easier. Plus, once I got the idea I wanted to know if it'll work!

Usage

  • (Optionally) run the remote part of the tunnel.

      $ ssh remote-server
      remote-server$ dnsproxy -remote -tunnel-addr :5556
    
  • Assign a bunch of IP addresses to the local machine. On OS X this could be:

      for addr in 192.168.1.{64..127}; do sudo ifconfig en0 add $addr; done
    
  • Run dnsproxy, in this case forwarding ports 80 and 443.

      sudo dnsproxy -iprange 192.168.1.64/26 -port 80 -port 443  # add "-tunnel-addr remote-server:5556" if we're tunnelling.
    

Warning

This is not secure. The traffic is not encrypted and there is no auth. If you're actually using this I recommend that you take measures to secure it, e.g. use TLS and have some kind IP address whitelist on your firewall.

Things that would be nice to have

  • Encryption
  • Auth/IP address whitelist
  • UDP support
  • IPv6 support
  • Parse nmap style IP address ranges
  • Multiplex connections over a single tunnel. Maybe use http2?

dnsproxy's People

Contributors

saljam avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.