当前位置:网站首页>FRP intranet penetration, reverse proxy
FRP intranet penetration, reverse proxy
2022-07-01 16:50: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.gzfrp_0.39.0_linux_amd64/frp_0.39.0_linux_amd64/frpsfrp_0.39.0_linux_amd64/frps_full.inifrp_0.39.0_linux_amd64/systemd/frp_0.39.0_linux_amd64/systemd/[email protected]_0.39.0_linux_amd64/systemd/[email protected]_0.39.0_linux_amd64/systemd/frpc.servicefrp_0.39.0_linux_amd64/systemd/frps.servicefrp_0.39.0_linux_amd64/LICENSEfrp_0.39.0_linux_amd64/frpc.inifrp_0.39.0_linux_amd64/frpc_full.inifrp_0.39.0_linux_amd64/frps.inifrp_0.39.0_linux_amd64/frpcPublic 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 = 7000vhost_http_port = 8080EOF install supervisor Deployment , The backstage runs for a long time :
# install supervisorsudo apt install supervisor -y# Add the configuration sudo -icat <<-EOF >> /etc/supervisor/supervisord.conf[program:frps]directory=/home/ubuntucommand=/home/ubuntu/frps -c /home/ubuntu/frps.inipriority=999autostart=trueautorestart=truestartsecs=10startretries=3stdout_logfile=/var/log/frps_out.logstdout_logfile_maxbytes=1MBstdout_logfile_backups=10stdout_capture_maxbytes=1MBstderr_logfile=/var/log/frps_err.logstderr_logfile_maxbytes=1MBstderr_logfile_backups=10stderr_capture_maxbytes=1MBenvironment=nocleanup=falseEOFexit# Update service sudo supervisorctl update all# View service sudo supervisorctl status allIntranet
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.xserver_port = 7000[web]type = httplocal_port = 8000custom_domains = www.yourdomain.comEOF 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/frpcsudo mkdir -p /etc/frpsudo cp frpc.ini /etc/frp/frpc.ini# Add the configuration (frp Given systemd To configure )sudo -icat <<-EOF > /etc/systemd/system/frpc.service[Unit]Description=Frp Client ServiceAfter=network.target[Service]Type=simpleUser=nobodyRestart=on-failureRestartSec=5sExecStart=/usr/bin/frpc -c /etc/frp/frpc.iniExecReload=/usr/bin/frpc reload -c /etc/frp/frpc.iniLimitNOFILE=1048576[Install]WantedBy=multi-user.targetEOFexit# 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.serviceGoCoding Personal experience sharing , We can pay attention to the official account !
边栏推荐
- 今天14:00 | 港大、北航、耶鲁、清华、加大等15位ICLR一作讲者精彩继续!
- 虚拟串口模拟器和串口调试助手使用教程「建议收藏」
- [nodemon] app crashed - waiting for file changes before starting... resolvent
- Today, at 14:00, 15 ICLR speakers from Hong Kong University, Beihang, Yale, Tsinghua University, Canada, etc. continue!
- sql刷题586. 订单最多的客户
- SystemVerilog structure (II)
- Bugku's file contains
- 独家消息:阿里云悄然推出RPA云电脑,已与多家RPA厂商开放合作
- Girls who want to do software testing look here
- Research and investment strategy report of hydroxypropyl beta cyclodextrin industry in China (2022 Edition)
猜你喜欢

SystemVerilog structure (II)

瑞典公布决定排除华为5G设备,但是华为已成功找到新出路

Redis6.0 new features

How to cancel automatic search and install device drivers for laptops

毕业季 | 华为专家亲授面试秘诀:如何拿到大厂高薪offer?

Redis distributed lock

sql刷题1050. 合作过至少三次的演员和导演

数据库系统原理与应用教程(006)—— 编译安装 MySQL5.7(Linux 环境)

Tutorial on the principle and application of database system (002) -- MySQL installation and configuration: MySQL software uninstallation (Windows Environment)
![[nodemon] app crashed - waiting for file changes before starting...解决方法](/img/ee/9830afd86e092851a2a906cb994949.png)
[nodemon] app crashed - waiting for file changes before starting...解决方法
随机推荐
Borui data integrated intelligent observable platform was selected into the "Yunyuan production catalogue" of China Academy of communications in 2022
Go language source level debugger delve
Chinese diosgenin market forecast and investment strategy report (2022 Edition)
游戏行业安全选择游戏盾,效果怎么样?
Free lottery | explore the future series of blind box digital copyright works of "abadou" will be launched on the whole network!
Installation and use of sqoop
AI高考志愿填报:大厂神仙打架,考生付费围观
The difference between the lazy mode of singleton mode and the evil mode
SQL question brushing 627 Change gender
數據庫系統原理與應用教程(006)—— 編譯安裝 MySQL5.7(Linux 環境)
机器学习11-聚类,孤立点判别
[live broadcast appointment] database obcp certification comprehensive upgrade open class
数据库系统原理与应用教程(005)—— yum 离线安装 MySQL5.7(Linux 环境)
What are the differences between PHP and DW
Internet News: "20220222" get together to get licenses; Many products of Jimi have been affirmed by consumers; Starbucks was fined for using expired ingredients in two stores
Apple's self-developed baseband chip failed again, which shows Huawei Hisilicon's technological leadership
SystemVerilog structure (II)
VMware virtual machine failed during startup: VMware Workstation is incompatible with hyper-v
Buuctf gold III
用手机在同花顺上开户靠谱吗?这样有没有什么安全隐患