Giter Club home page Giter Club logo

ndp_proxy's Introduction

ndp_proxy

使得应用可以绑定并使用指定段内的任意ipv6

注意

  • 仅linux可用,依赖libpcap和iproute2
  • 家宽环境下使用时设置的网段建议不要包含第一个/120段,因为很多路由器的dhcpv6策略是给v6分配和v4一样的地址,比如一台电脑的v4是192.168.1.12,路由器v6前缀是240e::,那么电脑会被分配到240e::12作为v6地址,此时如果使用了第一个/120段会导致ip冲突
  • 同时应注意避开slaac分配使用的地址

安装

apt install -y libpcap-dev libpcap0.8 iproute2
go install github.com/yu1745/ndp_proxy/cmd/ndp_proxy@latest

非apt包管理的系统请自行替换成对应的命令

使用

ndp_proxy -i eth0 -p 240e:1234::/112
-i 网卡名称
-p ip段,格式如2401::/64所示

原理

首先使用sysctl配置net.ipv6.ip_nonlocal_bind为1,允许绑定不属于自己的地址

然后执行ip r add local [ip段] dev lo命令配置路由表,使得要绑定的块的包不被操作系统扔掉,能够正常的到达用户空间

然后使用pcap监听数据链路层,筛选出Neighbor Solicitation包,伪造Neighbor Advertisement包回应路由器,使路由器认为该地址是本机持有的

随后就可以使用参数中的段中的任意ip发起连接

ndp_proxy's People

Contributors

yu1745 avatar

Stargazers

 avatar  avatar Jeeppers Creeppers avatar

Watchers

 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.