美文网首页
Tor网络中搭建私人网桥

Tor网络中搭建私人网桥

作者: _我不喜欢吃芋头 | 来源:发表于2018-07-13 12:40 被阅读0次

    配置Tor网桥

    教程参考 https://dreamcreator108.com/dreams/tor-bridge/index.html

    Obfsproxy Instructions

    image.png

    client torrcclient torrc
    这是安装Python版本obfsproxy的向导,如果你在应用C版本,我们建议您升级为Python版本。

    Step 0:安装Python

    安装obfsproxy需要Python(版本>=2.7)和pip,如果用Debian测试版本(或者不稳定版本),或者比Oneiric更新的Ubuntu版本,这很容易:
    apt-get install python2.7 python-pip python-dev build-essential
    在Fedora操作系统上,命令可能看起来是这样:
    yum install make automake gcc python-pip python-devel libyaml-devel

    Step 1:Install Tor

    需要一个最近的Tor版本( >=0.2.4.1 )
    在 /etc/apt/sources.list 中添加源

    deb http://deb.torproject.org/torproject.org xenial main
    deb-src http://deb.torproject.org/torproject.org xenial main
    

    添加gpg key:

    gpg --keyserver keys.gnupg.net --recv A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89
    gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | sudo apt-key add -
    

    安装tor:

    apt update && apt install tor deb.torproject.org-keyring -y
    

    Step 2:Install obfsproxy

    在 /etc/apt/sources.list 中添加源

    deb http://deb.torproject.org/torproject.org obfs4proxy main
    

    Step 3:setup tor

    现在在安装Tor 的/etc/tor/torrc 中增加:

    #Bridge config
    Log notice file /var/log/tor/notices.log
    RunAsDaemon 1
    ORPort 443
    Exitpolicy reject *:*
    BridgeRelay 1
    ServerTransportPlugin obfs4 exec /usr/bin/obfs4proxy
    ExtORPort auto
    PublishServerDescriptor 0
    
    #Set your bridge nickname and contact info
    ContactInfo 88888
    Nickname GentleNi
    
    

    Step 4:启动Tor并进行验证

    使用新配置文件重启Tor(可能需要用sudo命令权限)
    service tor restart
    查看日志文件,命令:tail -F /var/log/tor/notices.log,当看到有类似的输出,证明很成功:

    [notice] Your Tor server's identity key fingerprint is 'Unnamed 530FA95A79B9145D315F15F01215BE2F3BE921EB'
    [notice] Your Tor bridge's hashed identity key fingerprint is 'Unnamed 83D1AC9EC2F15D7024278461DC91A8B2E9BBF43A'
    [notice] Registered server transport 'obfs4' at '[::]:46396'
    [notice] Tor has successfully opened a circuit. Looks like client functionality is working.
    [notice] Bootstrapped 100%: Done
    [notice] Now checking whether ORPort <redacted>:443 is reachable... (this may take up to 20 minutes -- look for log messages indicating success)
    [notice] Self-testing indicates your ORPort is reachable from the outside. Excellent.
    

    记住输出中 obfs4 监听的端口(本例中是 46396)。并且还能找到你的server identity fingerprint(本例中是 530FA95A79B9145D315F15F01215BE2F3BE921EB),也复制下来。

    /var/lib/tor/pt_state/obfs4_bridgeline.txt文件中可以看到类似如下的内容:

    Bridge obfs4 <IP ADDRESS>:<PORT> <FINGERPRINT> cert=6LMNcXh6MIfApbZiMksnS4Kj+2sffZ5pybSqtcOO5YoHgfrMpkBJqvLxhuR2Ppau0L2seg iatmode=0
    
    

    把 Bridge 去了,ip 换了,端口写对了,fingerprint 粘贴了,之后,把这行复制即可,这个,就是你的网桥了。

    本例中最后成品:

    obfs4 123.456.789.10:46396 530FA95A79B9145D315F15F01215BE2F3BE921EB cert=6LMNcXh6MIfApbZiMksnS4Kj+2sffZ5pybSqtcOO5YoHgfrMpkBJqvLxhuR2Ppau0L2seg iatmode=0
    
    

    相关文章

      网友评论

          本文标题:Tor网络中搭建私人网桥

          本文链接:https://www.haomeiwen.com/subject/gyujpftx.html