首页 > 其他分享 >frp内网穿透

frp内网穿透

时间:2024-04-12 10:15:36浏览次数:32  
标签:target frps frp 穿透 systemctl frpc root 内网

  • frp0.52以后的版本配置文件是按照json格式编写的

下载frp

frp的github地址:https://github.com/fatedier/frp

上传到服务端和客户端,然后解压

服务端用到的文件是frps和配置文件frps.ini

服务端修改配置frps.ini

[common]
bind_port = 7000
authentication_method = token
token = 123456

客户端用到的文件是frpc和配置文件frpc.ini

客户端修改配置frpc.ini

[common]
server_addr = x.x.x.x
server_port = 7000
tls_enable = true
token = 123456

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

local_ip 和 local_port 配置为本地需要暴露到公网的服务地址和端口。remote_port 表示在 frp 服务端监听的端口,访问此端口的流量将会被转发到本地服务对应的端口。

做成linux服务,使用systemctl管理

服务端新建文件并编辑

cat << EOF > /etc/systemd/system/frps.service
[Unit]
Description = frp server
After = network.target syslog.target
Wants = network.target

[Service]
Type = simple
ExecStart = /root/frp/frps -c /root/frp/frps.ini

[Install]
WantedBy = multi-user.target
EOF

systemctl daemon-reload
systemctl enable frps
systemctl start frps

客户端新建文件并编辑

cat << EOF > /etc/systemd/system/frpc.service
[Unit]
Description = frp client
After = network.target syslog.target
Wants = network.target

[Service]
Type = simple
ExecStart = /root/frp/frpc -c /root/frp/frpc.ini

[Install]
WantedBy = multi-user.target
EOF

systemctl daemon-reload
systemctl enable frpc
systemctl start frpc


以下为新版本配置


v0.54配置文件

服务端配置文件

# 服务端口
bindPort = 7000

# 鉴权方式
auth.method = "token"

# token值,客户端需要配置一致
token = "123456"

# HTTP 类型代理
vhostHTTPPort = 80

# HTTPS 类型代理
vhostHTTPSPort = 443

# Dashboard 配置
webServer.addr = "0.0.0.0"
webServer.port = 7001
webServer.user = "admin"
webServer.password = "admin"

客户端配置文件

serverAddr = "x.x.x.x"
serverPort = 7000
token = "123456"

[[proxies]]
name = "ssh"
type = "tcp"
localIP = "127.0.0.1"
localPort = 22
remotePort = 20001

[[proxies]]
name = "web"
type = "tcp"
localIP = "127.0.0.1"
localPort = 443
remotePort = 20001

做成linux服务,使用systemctl管理

服务端新建文件并编辑

cat << EOF > /etc/systemd/system/frps.service
[Unit]
Description = frp server
After = network.target syslog.target
Wants = network.target

[Service]
Type = simple
ExecStart = /root/frp/frps -c /root/frp/frps.toml

[Install]
WantedBy = multi-user.target
EOF

systemctl daemon-reload
systemctl enable frps
systemctl start frps

客户端新建文件并编辑

cat << EOF > /etc/systemd/system/frpc.service
[Unit]
Description = frp client
After = network.target syslog.target
Wants = network.target

[Service]
Type = simple
ExecStart = /root/frp/frpc -c /root/frp/frpc.toml

[Install]
WantedBy = multi-user.target
EOF

systemctl daemon-reload
systemctl enable frpc
systemctl start frpc

标签:target,frps,frp,穿透,systemctl,frpc,root,内网
From: https://www.cnblogs.com/wszzn/p/18130586

相关文章

  • uview2.0版本,h5内网,无网络下icon图标不显示
    在项目目录下找到/node_modules/uview-ui/components/u-icon/u-icon.vue路径的文件由其中的代码片段可知,官方使用的是阿里云图标库的线上库,浏览器访问https://at.alicdn.com/t/font_2225171_8kdcwk4po24.ttf这个地址,下载字体文件放到本地的static文件目录下然后将u-icon.vue......
  • 内网穿透代理(NPS)搭建以及使用
    部署前提需要一台公网服务器(各大云piao)获取到服务器后需要放行服务器端口(建议所有端口:ALL)新建一个NPS文件夹kmdirNPS进入NPS文件夹cdNPS使用wget命令一键拉取工具压缩包及解压压缩文件其它版本链接:https://github.com/ehang-io/nps/releases/tag/v0.26.10wgethtt......
  • 【攻防实操系列+内网渗透】--第1章:内网渗透测试基础①
    内网也指局域网(LocalAreaNetwork,LAN),是指在某一区域内由多台计算机互连而成的计算机组,组网范围通常在数千米以内。在局域网中,可以实现文件管理、应用软件共享、打印机共享、工作组内的日程安排、电子邮件和传真通信服务等。内网是封闭的,可以由办公室内的两台计算机组成,也......
  • goby 插件推荐 及 内网下载使用
    背景:在内网电脑上,配置,插件发现没有网络推荐插件:ExportCsvhttps://github.com/gobysec/GobyExtension/tree/master/samples/ExportCsv   推荐使用git 下载:没找到连接。。。另辟蹊径:把所有的插件都下载下来了   https://github.com/gobysec/GobyExtension ......
  • 相机的常用操作+不同焦段镜头的穿透力
    ......
  • 实战中内网穿透的打法
    前言在内网渗透时,一个WebShell或CobaltStrike、Metasploit上线等,只是开端,更多是要内网横向移动,扩大战果,打到核心区域。但后渗透的前提是需要搭建一条通向内网的“专属通道”,才能进一步攻击。可实战中因为网络环境不同,所利用的方式就不同。以下为自我总结“实战中内网穿透......
  • 绿联 安装Frpc内网穿透并使用Nginx反向代理
    绿联安装Frpc内网穿透并使用Nginx反向代理1、前言服务器官网:雨云-新一代云服务提供商本教程使用Frps与Frpc进行内网穿透,其中Frps需要自购服务器安装,若无法购买服务器则本教程对你无用;另外还需拥有自己的域名,雨云免费二级域名好像不能申请证书;推荐购买国内的主机,使......
  • 内网nginx代理高德问题
    A为外网服务器B为内网服务器nginx配置server{listen8081;server_name15.72.185.21; location/webapi/{proxy_passhttp://15.72.191.145:18090/; } location/restapi{ proxy_passhttp://15.72.191.145:18090/restapi/;......
  • 【知识点】Redis-缓存-缓存穿透
    缓存穿透:查询一个不存在的数据,Mysql查询不到也没有写入缓存,导致每次请求都会查询数据库。(比如恶意请求)解决方案:缓存空数据:返回数据为空时仍然缓存(但是需要加过期时间)。优点:简单缺点:消耗内存,可能存在数据不一致情况。布隆过滤器布隆过滤器使用Bitmap(位图)来记载一个数据是......
  • VM虚拟机部署code-server服务+tailscale内网穿透,实现随处coding
    1.Linux下安装code-serverReleases·coder/code-server(github.com)https://github.com/coder/code-server/releases先去发布页面查看最新的code-server版本,下载命令示例:wgethttps://github.com/coder/code-server/releases/download/v4.22.1/code-server_4.22.1_amd64.d......