没有不值得去解决的问题,也没有不值得去学习的技术!

Internal Network Penetration in Windows 10 with the frpc Client

After modification, the authorization is successful

1. Background
During development, we often encounter situations that require a public domain name, which can generally be divided into two scenarios:
One is wanting to show our local development results to others, which requires publishing them to the public internet;
The other is for things like WeChat development, which requires a public network address to complete debugging.
If it is just for temporary use, buying a VPS and deploying on it is very inconvenient. Using frp for intranet penetration solves these two problems; it can directly map the local machine to the public network, saving the trouble of deploying on a server.

2. Client configuration, client download address (use the latest version). https://github.com/fatedier/frp/releases . Select: frp_0.42.0_windows_amd64.zip . As shown in Figure 1

Client configuration, client download address (use the latest version). https://github.com/fatedier/frp/releases . Select: frp_0.42.0_windows_amd64.zip
Figure 1

3. After downloading, you need to trust this file. Antivirus software will delete the files inside, so you need to add an exclusion. Extract to: C:\frp_0.42.0_windows_amd64 . As shown in Figure 2

After downloading, you need to trust this file. Antivirus software will delete the files inside, so you need to add an exclusion. Extract to: C:\frp_0.42.0_windows_amd64
Figure 2

4. Modify frpc.ini . The top part is the server configuration, and the bottom part is your local machine configuration. The original configuration is as follows

INI

[common]
server_addr = 127.0.0.1
server_port = 7000

[ssh]
type = tcp
local_ip = 127.0.0.1
local_port = 22
remote_port = 6000


5. The modified example is as follows

INI

[common]
server_addr = x.x.x.x
server_port = 5000
token = aaa

[chengdu-wangqiang-x-local]
type = http
local_ip = 127.0.0.1
local_port= 8001
custom_domains = chengdu-wangqiang-x-local.frp.x.top



6. Start frpc: frpc -c frpc.ini. If you are a Windows user, you need to execute the command in a cmd terminal. It prompts Access denied. Open 360 Antivirus, and restore the frp-related files from the 360 Quarantine. Run it again, and it prompts: login to server failed: authorization failed. The value of token = aaa is incorrect and needs to be obtained from the server side. As shown in Figure 3

Start frpc: frpc -c frpc.ini. If you are a Windows user, you need to execute the command in a cmd terminal. It prompts Access denied. Open 360 Antivirus, and restore the frp-related files from the 360 Quarantine. Run it again, and it prompts: login to server failed: authorization failed. The value of token = aaa is incorrect and needs to be obtained from the server side
Figure 3
Plaintext
C:\Windows\system32>cd ..

C:\Windows>cd ..

C:\>cd frp_0.42.0_windows_amd64

C:\frp_0.42.0_windows_amd64>.\frpc -c .\frpc.ini
Access denied.

C:\frp_0.42.0_windows_amd64>.\frpc -c .\frpc.ini
2022/05/11 11:42:31 [E] [service.go:340] authorization failed
2022/05/11 11:42:31 [W] [service.go:128] login to server failed: authorization failed
authorization failed



7. After modification, the authorization is successful. As shown in Figure 4

After modification, the authorization is successful
Figure 4
Plaintext


C:\frp_0.42.0_windows_amd64>.\frpc -c .\frpc.ini
2022/05/11 13:38:31 [I] [service.go:349] [9199f80513ab1df9] login to server success, get run id [9199f80513ab1df9], server udp port [0]
2022/05/11 13:38:31 [I] [proxy_manager.go:144] [9199f80513ab1df9] proxy added: [chengdu-wangqiang-object-local]
2022/05/11 13:38:31 [I] [control.go:181] [9199f80513ab1df9] [chengdu-wangqiang-object-local] start proxy success


8. Edit the Nginx configuration file, add listen 8001; , where 8001 is the local service port configured in frpc.ini. Reload the configuration. As shown in Figure 5

Edit the Nginx configuration file, add listen 8001; , where 8001 is the local service port configured in frpc.ini. Reload the configuration
Figure 5
Nginx

server {
	listen 8001;
    listen 443 ssl;
    server_name x.local;
	...
}

9. Open the URL in the browser: http://chengdu-wangqiang-x-local.frp.x.top/ , and the response is 200. As shown in Figure 6

 

关于作者 · 持续学习与技术实践

我是一名拥有 15 年以上开发经验的技术从业者,自 2013 年起持续运营个人技术博客,记录工作与个人项目中遇到的真实问题,以及解决问题过程中的探索、实践和思考。

除了技术写作,我也在持续开发和维护自己的独立项目,探索新技术和新工具在实际场景中的应用。我始终相信,没有不值得去解决的问题,也没有不值得去学习的技术。

如果这篇文章对你有所帮助,欢迎浏览博客中的其他文章,也欢迎交流技术经验与想法。

关于我  ·  GitHub  ·  邮件联系