当前位置:网站首页>frp: open source intranet penetration tool
frp: open source intranet penetration tool
2022-08-03 08:04:00 【Brother Mu Yao】
前言
frp 是一个专注于内网穿透的高性能的反向代理应用,支持 TCP、UDP、HTTP、HTTPS 等多种协议.可以将内网服务以安全、便捷的方式通过具有公网 IP 节点的中转暴露到公网.
官网GitHub:https://github.com/fatedier/frp
官网文档:https://gofrp.org/docs/
下载与安装
安装包:https://github.com/fatedier/frp/releases
以Ubuntu为例,执行命令下载:
wget https://github.com/fatedier/frp/releases/download/v0.44.0/frp_0.44.0_linux_amd64.tar.gz
执行命令解压:
tar -zxvf frp_0.44.0_linux_amd64.tar.gz
客户端(公网IP设备):保留文件 frps
和 frps.ini
服务端(局域网设备):保留文件 frpc
和 frpc.ini
服务端配置
[common]
bind_port = 8888
token = this_is_your_token
dashboard_port = 10000
dashboard_user = username
dashboard_pwd = password
vhost_http_port = 12888
配置完成后,The server does these things:
- 配置了 frp 服务监听端口 8888
- The access key is configured as “this_is_your_token”
- 配置了 dashboard 的 port、用户名、密码,访问公网IP:10000,Enter the username and password to log in to the background
- monitoring is configured 12888 端口代理 http 请求
Quickly start the server,执行:
./frps -c ./frps.ini
更多配置,详见:https://gofrp.org/docs/reference/server-configures/
客户端配置
[common]
# 公网IPand the server listening port,and the connection key
server_addr = 188.188.188.188
server_port = 8888
token = this_is_your_token
[ssh_local]
type = tcp
local_ip = 127.0.0.1
local_port = 22
remote_port = 10099
[static_file]
type = tcp
remote_port = 11099
plugin = static_file
# 要对外暴露的文件目录
plugin_local_path = /home/xxxx/xxx/share
# 用户访问 URL 中会被去除的前缀,保留的内容即为要访问的文件路径
plugin_strip_prefix = static
plugin_http_user = uuuuuuusername
plugin_http_passwd = ppppppppassword
[web_01]
type = http
local_port = 12888
custom_domains = www.fuck.cn
配置完成后,The server does these things:
- common:把服务端的IP、The listening port tells the client,Then configure the secret key to connect smoothly
- ssh_local:ssh连接,访问公网IP:10099 It can be forwarded to the intranet machine22端口
- static_file:公开文件,访问公网IP:11099 输入user和passwordto access shared files
- web_01:http映射,访问www.fuck.cn:12888 Intranet can be initiatedIP:12888 的HTTP请求
Quick start client,执行:
./frpc -c ./frpc.ini
注意:The firewall should be configured to allow the above ports to pass.
开机自启
使用 systemd
来控制 frps,需要先安装 systemd
,然后在 /etc/systemd/system
目录下创建一个 frps.service
文件,写入以下内容:
[Unit]
# 服务名称,可自定义
Description = frp server
After = network.target syslog.target
Wants = network.target
[Service]
Type = simple
# 启动frps的命令,需修改为您的frps的安装路径
ExecStart = /path/to/frps -c /path/to/frps.ini
[Install]
WantedBy = multi-user.target
管理frp服务:
# 启动frp
systemctl start frps
# 停止frp
systemctl stop frps
# 重启frp
systemctl restart frps
# 查看frp状态
systemctl status frps
配置 frps 开机自启:
systemctl enable frps
边栏推荐
猜你喜欢
随机推荐
pyspark @udf loop using variable problem
智能客服,还有多少AI泡沫?
vim 折叠函数
请求与响应:响应
【云原生--Kubernetes】Pod重启策略
Nanny level explains Transformer
基于SSM开发的的小区物业管理系统小程序源码
Windows安装MySQL(MIS)
Charles packet capture tool learning record
力扣(LeetCode)214. 打家劫舍 II(2022.08.02)
HCIP笔记整理 2022/7/20
2022下半年软考「高项&集成」复习计划ta来喽~
ORB-SLAM2提取特征点
Roson的Qt之旅#104 QML Image控件
解决移动端有纵向滚动条但是不能滚动的问题
加速FinOps实践,为企业降本增效
The use of the database table structure document generation tool screw
Charles抓包工具学习记录
ArcEngine (2) loading the map document
学习笔记:机器学习之逻辑回归