Total Pageviews

Sunday 6 June 2021

利用jackpot翻墙

在linux vps上。首先安装cmake环境:

wget https://github.com/Kitware/CMake/releases/download/v3.23.0-rc2/cmake-3.23.0-rc2.tar.gz

tar xvf cmake-3.23.0-rc2.tar.gz

cd cmake-3.23.0-rc2

./configure && make && make install


然后,

git clone https://github.com/hchen90/jackpot

cd jackpot

cmake .

(会在当前目录下,生成Makefile)

make

(可执行文件jackpot将会生成在src目录下)

cp doc/server.conf src/

cd src

openssl req -x509 -nodes -days 3650 -newkey rsa:2048 -keyout private.key -out public.crt  一路回车,即可在当前目录下,生成public.crt和private.key.

nano server.conf

cat server.conf


[main]

private_key=private.key

certificate=public.crt

serial=mypassword

timeout=3000000000


[tls]

; remote proxy server

timeout = 20000000000000

ip=0.0.0.0

port=4422


[web]

; remote web server

timeout = 5

ip=0.0.0.0

port=8877

; rootfs.cpio is an archive for all files on web server.

;rootfs = rootfs.cpio

;rootfs=/root/a.cpio


然后,要记得开放4422端口:

iptables -I INPUT -p tcp -m tcp --dport 4422 -j ACCEPT


./jackpot -n server.conf

显示:

Proxy server is listening on [0.0.0.0:4422]

Web server is listening on [0.0.0.0:8877]


不过此命令./jackpot -n server.conf是运行在前台的,我们可以利用systemd把此命令运行为service:

nano /etc/systemd/system/jackpot.service

cat /etc/systemd/system/jackpot.service

[Unit]

After=network.target


[Service]

WorkingDirectory=/root/jackpot/src/

ExecStart=/root/jackpot/src/jackpot -n /root/jackpot/src/server.conf

Restart=always


[Install]

WantedBy=multi-user.target


然后运行:

systemctl start jackpot

systemctl enable jackpot

服务器端搭建完成。


在客户机器mac上。首先安装cmake环境,然后,

git clone https://github.com/hchen90/jackpot

cd jackpot

cmake .

(会在当前目录下,生成Makefile)

make

(可执行文件jackpot将会生成在src目录下)

cp doc/client.conf src/

cd src

nano client.conf

cat client.conf


[main]

serial=mypassword

timeout=3000000000000


[tls]

; remote proxy server

ip = vps-public-ip

port=4422


[local]

; local socks5 server

ip=0.0.0.0

port=1082


然后运行:

./jackpot -n client.conf

显示:

SOCKS5 server is listening on [0.0.0.0:1082]

不要关闭此终端,然后,设置浏览器的socks5 proxy地址为127.0.0.1 ,端口为1082 ,浏览器即可翻墙。


项目地址:https://github.com/hchen90/jackpot

https://github.com/hchen90/jackpot/issues/1

------


related post:  

https://briteming.blogspot.com/2017/06/lightning.html



No comments:

Post a Comment