Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于服务端ip加密的问题 #3

Open
n1u7 opened this issue Jan 2, 2023 · 8 comments
Open

关于服务端ip加密的问题 #3

n1u7 opened this issue Jan 2, 2023 · 8 comments

Comments

@n1u7
Copy link

n1u7 commented Jan 2, 2023

image
image
image
不知道是哪里出了问题,直接填原ip是没问题的

@0e0w
Copy link
Member

0e0w commented Jan 2, 2023

同时需要修改代码中的值。https://github.com/Goqi/Erfrp/blob/main/pkg/dscrypto/var.go

@hkxueqi
Copy link

hkxueqi commented Jan 5, 2023

同样的问题:
2023/01/05 11:25:09 [I] [value.go:100] Local load ini file
2023/01/05 11:25:19 [W] [service.go:132] login to server failed: connection write timeout
connection write timeout

上面所说的Erfrp/blob/main/pkg/dscrypto/var.go
/pkg/dscrypto/var.go
都已经修改,写死AESencryptCode,依然连接失败
当frpc.ini 中写明文可以连接:server_addr = 192.168.1.1
但是当写入 AESencryptCode 值就连接失败。server_addr= 3mt3Rrdhw8yQbqATAV1/jQ==

大概看了下源码:
Erfrp-main/pkg/client/service.go 292行

我改为如下,当字节大于15(就是加密了)从配置文件读取解密:
if len(svr.cfg.ServerAddr) <= 15 { //IP地址的长度小于15
conn, err = libdial.Dial(
net.JoinHostPort(svr.cfg.ServerAddr, strconv.Itoa(svr.cfg.ServerPort)),
dialOptions...)
} else {
conn, err = libdial.Dial(
net.JoinHostPort(dscrypto.AesDecrypt(svr.cfg.ServerAddr, dscrypto.AESKey), strconv.Itoa(svr.cfg.ServerPort)),
dialOptions...)
}
依然是连接失败

@hkxueqi
Copy link

hkxueqi commented Jan 5, 2023

加了打印,调试,解密是正常的
else {
fmt.Println("Aescode")
conn, err = libdial.Dial(
net.JoinHostPort(dscrypto.AesDecrypt(svr.cfg.ServerAddr, dscrypto.AESKey), strconv.Itoa(svr.cfg.ServerPort)),
dialOptions...)
fmt.Println(dscrypto.AesDecrypt(svr.cfg.ServerAddr, dscrypto.AESKey))
}

测试输出:
2023/01/05 11:39:05 [I] [value.go:100] Local load ini file
Aescode
172.16.14.3
2023/01/05 11:39:15 [W] [service.go:132] login to server failed: connection write timeout
connection write timeout

编译环境:macOS 、go 1.19
测试环境:macOS 、kali2022、win7

服务端用win 、kali

客户端 三个环境都试过

@0e0w
Copy link
Member

0e0w commented Jan 5, 2023

加了打印,调试,解密是正常的 else { fmt.Println("Aescode") conn, err = libdial.Dial( net.JoinHostPort(dscrypto.AesDecrypt(svr.cfg.ServerAddr, dscrypto.AESKey), strconv.Itoa(svr.cfg.ServerPort)), dialOptions...) fmt.Println(dscrypto.AesDecrypt(svr.cfg.ServerAddr, dscrypto.AESKey)) }

测试输出:

2023/01/05 11:39:05 [I] [value.go:100] Local load ini file
Aescode
172.16.14.3
2023/01/05 11:39:15 [W] [service.go:132] login to server failed: connection write timeout
connection write timeout
编译环境:macOS 、go 1.19 测试环境:macOS 、kali2022、win7

服务端用win 、kali

客户端 三个环境都试过

AESKey和AESencryptoCode的值都修改了吗?
方便发下var.go和frpc.ini的相关代码吗?

// 对服务器IP进行隐藏需要修改此处的AESKey和AESencryptCode。
// 同时需要对frpc.ini中的server_addr进行修改,修改成AESencryptCode。

@hkxueqi
Copy link

hkxueqi commented Jan 5, 2023

解决了,跑起来了
image

@lmlyd22
Copy link

lmlyd22 commented Jan 6, 2023

AESKey没动使用默认 改了Erfrp-0.1\pkg\dscrypto\var.go的值VpsIP和AESencryptCode(加密后的)编译后使用frps端不动 frpc端也不动仅修改server_addr加密后的值连接失败 我操作有问题吗。

@0e0w
Copy link
Member

0e0w commented Jan 6, 2023

// 对服务器IP进行隐藏需要修改此处的AESKey和AESencryptCode。
// 同时需要对frpc.ini中的server_addr进行修改,修改成AESencryptCode。

看你的描述操作没问题,再试试?

// 对服务器IP进行隐藏需要修改此处的AESKey和AESencryptCode。
// 同时需要对frpc.ini中的server_addr进行修改,修改成AESencryptCode。

其他地方无需修改。

@wind226
Copy link

wind226 commented Feb 23, 2023

AESKey不使用默认修改了Erfrp-0.1\pkg\dscrypto\var.go的值VpsIP和AESencryptCode(加密后的)编译后使用frps端不活动frpc端也不活动只修改的server_addr代理我代理操作有问题吗。

大佬,解决了吗,我也遇到和你一样的问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants