
联系老板
请加QQ,备注留言 frp-你的用户名,领取红包,扫码支付更优惠

2023/6/17...大约 4 分钟

请加QQ,备注留言 frp-你的用户名,领取红包,扫码支付更优惠

构造一个python3 镜像
FROM alpine
MAINTAINER change
RUN sed -i 's#dl-cdn.alpinelinux.org#mirrors.aliyun.com#g' /etc/apk/repositories && \
apk add python3 wget &&\
mkdir /root/frp_auth
ADD get-pip.py /root/get-pip.py
RUN python3 /root/get-pip.py -i https://mirrors.aliyun.com/pypi/simple/ ;pip install flask -i https://mirrors.aliyun.com/pypi/simple/
RUN apk add tzdata && cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& echo "Asia/Shanghai" > /etc/timezone \
&& apk del tzdata
RUN pip install pymysql -i https://mirrors.aliyun.com/pypi/simple/
WORKDIR /root/frp_auth
[ssh]
# tcp | udp | http | https | stcp | xtcp, default is tcp
type = tcp
local_ip = 127.0.0.1
local_port = 22
# limit bandwidth for this proxy, unit is KB and MB
bandwidth_limit = 1MB
# true or false, if true, messages between frps and frpc will be encrypted, default is false
use_encryption = false
# if true, message will be compressed
use_compression = false
# remote port listen by frps
remote_port = 6001
# frps will load balancing connections for proxies in same group
group = test_group
# group should have same group key
group_key = 123456
# enable health check for the backend service, it support 'tcp' and 'http' now
# frpc will connect local service's port to detect it's healthy status
health_check_type = tcp
# health check connection timeout
health_check_timeout_s = 3
# if continuous failed in 3 times, the proxy will be removed from frps
health_check_max_failed = 3
# every 10 seconds will do a health check
health_check_interval_s = 10
# additional meta info for each proxy
meta_var1 = 123
meta_var2 = 234
线路说明
江苏和浙江为普通线路,可以根据需要切换,但江苏和浙江线路的端口范围不同,切换后需要修改对应的 remote_port端口
江苏专线为需要使用特殊端口的用户,如 445,8080,1688 等, 不可与其他线路切换
frp 默认开启 http/https 后,有404,或者默认页面,这也就让别人知道我们是通过 frp 来实现,这个时候如果 frp 存在漏洞则有可以被别人利用
修改 404 有两种,第一种:
源码文件在
frp 文件目录 pkg/util/vhost/resource.go
代码段是:
import (
"bytes"
"io"
"net/http"
"os"
frpLog "github.com/fatedier/frp/pkg/util/log"
"github.com/fatedier/frp/pkg/util/version"
)
var (
NotFoundPagePath = ""
)
const (
NotFound = `<!DOCTYPE html>
<html>
<head>
<title>Not Found</title>
<style>
body {
width: 35em;
margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif;
}
</style>
</head>
<body>
<h1>The page you requested was not found.</h1>
<p>Sorry, the page you are looking for is currently unavailable.<br/>
Please try again later.</p>
<p>The server is powered by <a href="https://github.com/fatedier/frp">frp</a>.</p>
<p><em>Faithfully yours, frp.</em></p>
</body>
</html>
`
)