当前位置:网站首页>FRP intranet penetration, reverse proxy
FRP intranet penetration, reverse proxy
2022-07-04 05:47:00 【GoCoding】
frp It is a high performance reverse proxy application focusing on Intranet penetration , Support TCP、UDP、HTTP、HTTPS Other protocols . You can make intranet services secure 、 Convenient way through the public network IP Node transfer is exposed to the public network .
This article will expose the intranet Web Service as an example , practice frp Installation and deployment of . More scenarios , so frp Example .
install
frp Mainly by client (frpc) and Server side (frps) form , The server is usually deployed in a network with a public network IP On the machine , The client is usually deployed on the machine where the intranet service needs to be penetrated .
Can be in Github Of Release Page to download the latest version of the client and server binary files .
Article public network 、 Intranet machines are Linux x86_64, So I chose frp_0.39.0_linux_amd64.tar.gz. decompression :
$ tar xzvf frp_0.39.0_linux_amd64.tar.gz
frp_0.39.0_linux_amd64/
frp_0.39.0_linux_amd64/frps
frp_0.39.0_linux_amd64/frps_full.ini
frp_0.39.0_linux_amd64/systemd/
frp_0.39.0_linux_amd64/systemd/[email protected]
frp_0.39.0_linux_amd64/systemd/[email protected]
frp_0.39.0_linux_amd64/systemd/frpc.service
frp_0.39.0_linux_amd64/systemd/frps.service
frp_0.39.0_linux_amd64/LICENSE
frp_0.39.0_linux_amd64/frpc.ini
frp_0.39.0_linux_amd64/frpc_full.ini
frp_0.39.0_linux_amd64/frps.ini
frp_0.39.0_linux_amd64/frpc
Public network
Copy frps File into the public network machine , Assume that IP by x.x.x.x:
scp frps* [email protected]:
modify frps.ini file , Set listening HTTP The request port is 8080:
cat <<-EOF > ~/frps.ini
[common]
bind_port = 7000
vhost_http_port = 8080
EOF
install supervisor Deployment , The backstage runs for a long time :
# install supervisor
sudo apt install supervisor -y
# Add the configuration
sudo -i
cat <<-EOF >> /etc/supervisor/supervisord.conf
[program:frps]
directory=/home/ubuntu
command=/home/ubuntu/frps -c /home/ubuntu/frps.ini
priority=999
autostart=true
autorestart=true
startsecs=10
startretries=3
stdout_logfile=/var/log/frps_out.log
stdout_logfile_maxbytes=1MB
stdout_logfile_backups=10
stdout_capture_maxbytes=1MB
stderr_logfile=/var/log/frps_err.log
stderr_logfile_maxbytes=1MB
stderr_logfile_backups=10
stderr_capture_maxbytes=1MB
environment=
nocleanup=false
EOF
exit
# Update service
sudo supervisorctl update all
# View service
sudo supervisorctl status all
Intranet
Copy frpc File into intranet machine , Assume that IP by 192.168.1.100:
scp frpc* [email protected]:
modify frpc.ini file , hypothesis frps Of the server IP by x.x.x.x,local_port On the local machine Web The port the service listens on , Bind custom domain name as custom_domains.
cat <<-EOF > ~/frpc.ini
[common]
server_addr = x.x.x.x
server_port = 7000
[web]
type = http
local_port = 8000
custom_domains = www.yourdomain.com
EOF
take www.yourdomain.com Domain name of A The record resolves to IP x.x.x.x.
If the server already has a corresponding domain name , Can also be CNAME The record resolves to the original domain name of the server . Or you can modify HTTP Requested Host Field to achieve the same effect .
Simple operation service , To test :
# function HTTP service
python3 -m http.server 8000
# function frpc service
./frpc -c ./frpc.ini
# Access test
curl http://www.yourdomain.com:8080/
With systemd Deployment , The backstage runs for a long time :
# Copy files
sudo cp frpc /usr/bin/frpc
sudo mkdir -p /etc/frp
sudo cp frpc.ini /etc/frp/frpc.ini
# Add the configuration (frp Given systemd To configure )
sudo -i
cat <<-EOF > /etc/systemd/system/frpc.service
[Unit]
Description=Frp Client Service
After=network.target
[Service]
Type=simple
User=nobody
Restart=on-failure
RestartSec=5s
ExecStart=/usr/bin/frpc -c /etc/frp/frpc.ini
ExecReload=/usr/bin/frpc reload -c /etc/frp/frpc.ini
LimitNOFILE=1048576
[Install]
WantedBy=multi-user.target
EOF
exit
# Overload configuration
sudo systemctl daemon-reload
# Boot up
sudo systemctl enable frpc.service
# Start the service
sudo systemctl start frpc.service
# Check the status
sudo systemctl status frpc.service
GoCoding Personal experience sharing , We can pay attention to the official account !
边栏推荐
- How to clone objects
- C语言简易学生管理系统(含源码)
- FreeRTOS 中 RISC-V-Qemu-virt_GCC 的 锁机制 分析
- 总线的基本概念
- JS string splicing
- 体验碎周报第 102 期(2022.7.4)
- 509. Fibonacci number, all paths of climbing stairs, minimum cost of climbing stairs
- Actual cases and optimization solutions of cloud native architecture
- 接地继电器DD-1/60
- js arguments参数使用和详解
猜你喜欢

如何获取el-tree中所有节点的父节点

光模块字母含义及参数简称大全

LayoutManager布局管理器:FlowLayout、BorderLayout、GridLayout、GridBagLayout、CardLayout、BoxLayout
![BUU-Crypto-[GXYCTF2019]CheckIn](/img/b8/ad6c05977f6943f30e9975acb6eb6e.jpg)
BUU-Crypto-[GXYCTF2019]CheckIn

Take you to quickly learn how to use qsort and simulate qsort

Void convolution, deformable convolution, deformable ROI pooling

VB.net GIF(制作、拆解——优化代码,类库——5)

AWT常用组件、FileDialog文件选择框

HMS v1.0 appointment. PHP editid parameter SQL injection vulnerability (cve-2022-25491)

How to configure static IP for Kali virtual machine
随机推荐
Arc135 C (the proof is not very clear)
Win10 clear quick access - leave no trace
Design and implementation of redis 7.0 multi part AOF
VB.net 简单的处理图片,黑白(类库——7)
Gridview出现滚动条,组件冲突,如何解决
509. Fibonacci number, all paths of climbing stairs, minimum cost of climbing stairs
The difference between PX EM rem
[microservice] Nacos cluster building and loading file configuration
1.1 history of Statistics
Halcon image calibration enables subsequent image processing to become the same as the template image
2022 R2 mobile pressure vessel filling retraining question bank and answers
Build an Internet of things infrared temperature measuring punch in machine with esp32 / rush to work after the Spring Festival? Baa, no matter how hard you work, you must take your temperature first
Principle and practice of common defects in RSA encryption application
BUU-Pwn-test_ your_ nc
win10清除快速访问-不留下痕迹
How to use postman to realize simple interface Association [add, delete, modify and query]
How to configure static IP for Kali virtual machine
js获取对象中嵌套的属性值
ansys命令
How to get the parent node of all nodes in El tree