vscode remote server tunnel intranet penetration forwarding tcp, rate 10kb per second

reference:

The correct way to open the vscode web version (establishing a tunnel-p2p connection)_vscode opens the web page_Guai Lizuo's blog-CSDN blog

vscode intranet penetration, white prostitution 10M bandwidth penetration, remote tunnels remote development plug-in, no prostitution, no prostitution_bilibili_bilibili

Enter the following command on vps (ubuntu20.04 can access the Internet, no public IP):

The tool chisel is needed to forward tcp connections through websocket and start socks5 proxy.

cd /tmp;
curl -L -O https://github.com/jpillora/chisel/releases/download/v1.8.1/chisel_1.8.1_linux_amd64.gz ;
curl -L -O https://github.com/jpillora/chisel/releases/download/v1.8.1/chisel_1.8.1_windows_amd64.gz;


# https://github.com/jpillora/chisel/releases

 Later I discovered that there is no need to download code-server, /tmp/code will be downloaded by itself.

# https://github.com/coder/code-server
cd /tmp;

curl -L -O https://github.com/coder/code-server/releases/download/v4.13.0/code-server-4.13.0-linux-amd64.tar.gz
tar -xzvf ./code-server-4.13.0-linux-amd64.tar.gz

/tmp/code-server-4.13.0-linux-amd64/bin/code-server  --help

setsid /tmp/chisel server -v -p 60080 --socks5 &
export PASSWORD="qq5201314";
setsid /tmp/code-server-4.13.0-linux-amd64/bin/code-server  --bind-addr 0.0.0.0:9090 &

# cat ~/.config/code-server/config.yaml

/tmp/code will download vscode-server-linux-x64.tar.gz by itself

Open this link in your browser https://vscode.dev/tunnel/fv-az801-175/tmp

[2023-05-27 12:00:28] info [tunnels::connections::relay_tunnel_host] Opened new client on channel 2
[2023-05-27 12:00:28] info [tunnels::connections::relay_tunnel_host] Opened new client on channel 3
[2023-05-27 12:00:30] info [rpc.0] Checking /root/.vscode-cli/servers/Stable-b3e4e68a0bc097f0ae7907b217c1119af9e03435/log.txt and /root/.vscode-cli/servers/Stable-b3e4e68a0bc097f0ae7907b217c1119af9e03435/pid.txt for a running server...
[2023-05-27 12:00:30] info [rpc.0] Downloading Visual Studio Code server -> /tmp/.tmpanzfN4/vscode-server-linux-x64.tar.gz
[2023-05-27 12:00:33] info [rpc.0] Starting server...
[2023-05-27 12:00:33] info [rpc.0] Server started

#   https://marketplace.visualstudio.com/items?itemName=ms-vscode.remote-server

# https://code.visualstudio.com/download

cd /tmp;
curl -L -O https://az764295.vo.msecnd.net/stable/b3e4e68a0bc097f0ae7907b217c1119af9e03435/vscode_cli_alpine_x64_cli.tar.gz
tar -xzvf  ./vscode_cli_alpine_x64_cli.tar.gz

#/tmp/code -h

/tmp/code tunnel --accept-server-license-terms  

#  需要输入验证码登录你的github账户,确保你的网络能访问github

Click this avatar to display the account name that GitHub has logged in to.

Open the following URL (make sure your network can access github):

https://vscode.dev/tunnel/fv-az201-614/tmp

The following interface is displayed:

Enter conn from the command panel to select the first one:

In the middle of the picture, there is a port: add a forwarding port 60080 (which is the tcp port monitored by /tmp/chisel above)

After adding the startup port, a URL will appear. Copy and open it. Then you need to log in to github (which must be consistent with the github account above). After logging in, enter the next page, click continue, and jump again, showing Not found.

Copy the cookies for this page at this time:

.Tunnels.Relay.WebForwarding.Cookies=CfDJ8ILUty0yradLtZEmZVyVSFbthyATb86mjzIvcosSmmEn5R2Rb2zyuDk0HbF3iWdw2Fqsgfw0cafpZAeFj-EvTU7VwxEO9pEEqZ3sLVXkKYUWmZNWILMUBN8drykp8TEn5gsMIzwfXw2E4afg0YmXp5GrM-Px822eK1FK_QfiFUKpXDWWykrBoeDU_TwSpsSmLjj2ieBcMU2hRt1Z3FpDcuxtiXdEdE9hRF9UTpxfGODERWvd-pUTWvhDiSro40DOhSlVwxSS0_igahsEH4tNG6FH_Uqiipub7VkxeVq4h-gN6fY83OtBwnMf5kWEbYGgRpZL1f_WFe4eOUvrHI7JWgGO9quG55OOWUCvZZvV8ayqaTr3ZlM_qL6xfvt1kp5X0BaHDLHEKQquoPsvFYJZbhQ3Ph5lF_CRSyOg4zkyfPLPWwTr9X-h_CSntQeeI0RbmsDpiukvYBj57Uf2ekP8_cP2b1JL0EUsEP7mMKqKNB9Sde9QiGUceu5ARfGarWdDYcrfioPwA9Dx-WsLs2tiinYvrAf7XDACBkoM-FXlCYusWr6ji3XI0MfD1NDZ1bOUC6mdzyToFQRfOOOqbnQRzg5qT9pihI6T5H58Y1NDdARY0CM-R2XhOhxVCD2rsTpwqe7u5WQPiQDjKNECximWxfs_Wa1N52ic-Ffd3-FMPubXF-GP25_g0v_yT-GbveeVk7gwX37HW_3DsC06hpS7Wwc44SD_igNlMiP0xnv5-gCwX5B6YxyEfX8edoWYjWZaRZ2uDZS_SIutow8o_fo6qTamBHgbV8G4TZ8Mh6rWaJmqOTaDpOIhBsFS2sjxXJHzGTib9Gn0KhrfFMX7l_hV-AMW8BP4XrjwUU2mnpK5D_VdTbmVR-w6DgihKdmivMi4MFz5Su53prVBryWK-NNbXx-B6RshHdJkn12BHdbu6gvf9KDPIT6eqZXzJQ5mlMOYfRQecmD1avrmlcE12WGE97aPgFBZ6EwAl24hWw6il1pW8mxv4oOzEoNXMBt-F37iY67MI-irYzfLu4K_amfnSfnJFphSJ_XqTIRMRpJnBm2yfgfztd46flteetSnWu5Fuo53zh0D6AfG_ZPeIOUGS4JUVnkJL844wNjN6WU2PCam30Or8Zj3Qcv1pPNvIZm7vvw9G-SHX-ymxWmAsegb2mvK0z3JdInP38LeDuBPb77SoUpsEN25cakuE95GO8IW75lmk7ukQW41s1VgxD_juQ5pqNK_wCMw2GEKh5baF3mU1q1TKa1YZJYO0ULBubw5a_rnKU1PcTQMUnsVCTIx5cJakPIkM0Fiso0gJTDEHeOhvMcb_Itn6NucLHW-FudifxtHap71Eq0ZFMgstkyqYgvGVXj_n1g2fGl6iPfhm5LrCeHzaBXtt9SWUgXi79tLI1xKC5XTm-ebqWLNEQHy6U8nf667TFp57uYUkRitMq8h5jTpb8Z0unH7qPnnTo1xeQ; tunnel_phishing_protection=v3kzr7k9.usw3

On your local PC, start the chisel client:

chisel.exe client -v --header "Cookie: .Tunnels.Relay.WebForwarding.Cookies=CfDJ8ILUty0yradLtZEmZVyVSFbthyATb86mjzIvcosSmmEn5R2Rb2zyuDk0HbF3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zj3Qcv1pPNvIZm7vvw9G-SHX-ymxWmAsegb2mvK0z3JdInP38LeDuBPb77SoUpsEN25cakuE95GO8IW75lmk7ukQW41s1VgxD_juQ5pqNK_wCMw2GEKh5baF3mU1q1TKa1YZJYO0ULBubw5a_rnKU1PcTQMUnsVCTIx5cJakPIkM0Fiso0gJTDEHeOhvMcb_Itn6NucLHW-FudifxtHap71Eq0ZFMgstkyqYgvGVXj_n1g2fGl6iPfhm5LrCeHzaBXtt9SWUgXi79tLI1xKC5XTm-ebqWLNEQHy6U8nf667TFp57uYUkRitMq8h5jTpb8Z0unH7qPnnTo1xeQ; tunnel_phishing_protection=v3kzr7k9.usw3" https://v3kzr7k9-60080.usw3.devtunnels.ms/  0.0.0.0:6080:socks

In this way, the local tcp6080 is the sock5 service, which can be used as the SSH service for xshell to connect to ubuntu vps.

# cd /tmp; python3 -m http.server 80 &

#  cp /tmp/code /var/www/html/ 


curl -o z:\code3 -x socks5h://127.0.0.1:6080  "http://127.0.0.1:80/code"

As shown in the figure below: the download speed is about 10kb-25kb, but if it does not go through chisel, but directly penetrates apache's http service (tcp30080), after authentication (login to github), the download speed is about 550kb-600kb per second

Problem (no solution found yet):

Github remote login requires a verification code and cannot be opened ( Visual Studio Code for the Web https://vscode.dev/tunnel/fv-az47-59 ):

root@fv-az47-59:/tmp# /tmp/code tunnel --accept-server-license-terms  
*
* Visual Studio Code Server
*
* By using the software, you agree to
* the Visual Studio Code Server License Terms (https://aka.ms/vscode-server-license) and
* the Microsoft Privacy Statement (https://privacy.microsoft.com/en-US/privacystatement).
*
To grant access to the server, please log into https://github.com/login/device and use code 80BD-5360
✔ What would you like to call this machine? ·  
[2023-05-27 11:47:00] info Names can only contain letters, numbers, and '-'. Spaces, commas, and all other special characters are not allowed. Please try a different name.
✔ What would you like to call this machine? · #  需要输入验证码登录你的github账户,确保你的网络能访问github
[2023-05-27 11:47:14] info Names cannot be longer than 20 characters. Please try a different name.
✔ What would you like to call this machine? · fv-az47-59
[2023-05-27 11:47:19] info Creating tunnel with the name: fv-az47-59

Open this link in your browser https://vscode.dev/tunnel/fv-az47-59/tmp

^C[2023-05-27 11:48:16] info Shutting down: Ctrl-C receive

Guess you like

Origin blog.csdn.net/qq_29060627/article/details/130903989