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

runtime error: invalid memory address or nil pointer dereference #2

Closed
wgetnz opened this issue Jun 1, 2022 · 9 comments
Closed

runtime error: invalid memory address or nil pointer dereference #2

wgetnz opened this issue Jun 1, 2022 · 9 comments

Comments

@wgetnz
Copy link

wgetnz commented Jun 1, 2022

██████╗ ███████╗██████╗ ██████╗ ██╗ ██╗ █████╗ ██████╗ ██████╗
██╔══██╗██╔════╝██╔══██╗ ██╔════╝ ██║ ██║██╔══██╗██╔══██╗██╔══██╗
██████╔╝█████╗ ██║ ██║ ██║ ███╗██║ ██║███████║██████╔╝██║ ██║
██╔══██╗██╔══╝ ██║ ██║ ██║ ██║██║ ██║██╔══██║██╔══██╗██║ ██║
██║ ██║███████╗██████╔╝ ╚██████╔╝╚██████╔╝██║ ██║██║ ██║██████╔╝ -V 22.5.26.1716 Alpha
╚═╝ ╚═╝╚══════╝╚═════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═════╝

Github:https://github.com/wikiZ/RedGuard

RedGuard is a C2 front flow control tool,Can avoid Blue Teams,AVs,EDRs check.

[2022-05-31 23:16:35] A default SSL certificate is being generated for the reverse proxy...
[2022-05-31 23:16:35] HostTarget: {"360.net":"http://127.0.0.1:8080","360.com":"https://127.0.0.1:4433"}
[2022-05-31 23:16:35] Proxy Listen Port :8080 (HTTP)
[2022-05-31 23:16:35] Proxy Listen Port :8443 (HTTPS)
2022/05/31 23:16:40 http: TLS handshake error from 116.7.20.49:1549: remote error: tls: unknown certificate
2022/05/31 23:16:42 http: TLS handshake error from 116.7.20.49:1595: remote error: tls: unknown certificate
[2022-05-31 23:16:42] [REQUEST] GET /
2022/05/31 23:16:42 http: panic serving 116.7.20.49:1596: runtime error: invalid memory address or nil pointer dereference
goroutine 23 [running]:
net/http.(*conn).serve.func1(0xc00047c1e0)
c:/go/src/net/http/server.go:1801 +0x147
panic(0x7e9140, 0xc01100)
c:/go/src/runtime/panic.go:975 +0x47a
RedGuard/core.MalleableFilter(0xc000329021, 0x13, 0xc00019ca00, 0x0)
C:/Users/风起/GolandProjects/RedGuard/core/ProxyFilter.go:64 +0xb8
RedGuard/core.ProxyFilterManger(0xc00019ca00, 0x85c5fe)
C:/Users/风起/GolandProjects/RedGuard/core/ProxyFilter.go:169 +0x715
RedGuard/core.(*baseHandle).ServeHTTP(0xc63640, 0x942ea0, 0xc00027a0e0, 0xc00019ca00)
C:/Users/风起/GolandProjects/RedGuard/core/ProxyHandler.go:72 +0x6fb
net/http.serverHandler.ServeHTTP(0xc000464000, 0x942ea0, 0xc00027a0e0, 0xc00019ca00)
c:/go/src/net/http/server.go:2843 +0xa3
net/http.(*conn).serve(0xc00047c1e0, 0x9439e0, 0xc00014c640)
c:/go/src/net/http/server.go:1925 +0x8ad
created by net/http.(*Server).Serve
c:/go/src/net/http/server.go:2969 +0x36c
2022/05/31 23:16:43 http: TLS handshake error from 116.7.20.49:1619: remote error: tls: unknown certificate
[2022-05-31 23:16:43] [REQUEST] GET /
2022/05/31 23:16:43 http: panic serving 116.7.20.49:1620: runtime error: invalid memory address or nil pointer dereference
goroutine 12 [running]:
net/http.(*conn).serve.func1(0xc0000b4280)
c:/go/src/net/http/server.go:1801 +0x147
panic(0x7e9140, 0xc01100)
c:/go/src/runtime/panic.go:975 +0x47a
RedGuard/core.MalleableFilter(0xc000025f21, 0x13, 0xc00019c500, 0x0)
C:/Users/风起/GolandProjects/RedGuard/core/ProxyFilter.go:64 +0xb8
RedGuard/core.ProxyFilterManger(0xc00019c500, 0x85c5fe)
C:/Users/风起/GolandProjects/RedGuard/core/ProxyFilter.go:169 +0x715
RedGuard/core.(*baseHandle).ServeHTTP(0xc63640, 0x942ea0, 0xc0004640e0, 0xc00019c500)
C:/Users/风起/GolandProjects/RedGuard/core/ProxyHandler.go:72 +0x6fb
net/http.serverHandler.ServeHTTP(0xc000464000, 0x942ea0, 0xc0004640e0, 0xc00019c500)
c:/go/src/net/http/server.go:2843 +0xa3
net/http.(*conn).serve(0xc0000b4280, 0x9439e0, 0xc0002c8080)
c:/go/src/net/http/server.go:1925 +0x8ad
created by net/http.(*Server).Serve
c:/go/src/net/http/server.go:2969 +0x36c
2022/05/31 23:16:48 http: TLS handshake error from 116.7.20.49:1777: remote error: tls: unknown certificate
[2022-05-31 23:16:48] [REQUEST] GET /
2022/05/31 23:16:48 http: panic serving 116.7.20.49:1778: runtime error: invalid memory address or nil pointer dereference
goroutine 13 [running]:
net/http.(*conn).serve.func1(0xc00024c000)
c:/go/src/net/http/server.go:1801 +0x147
panic(0x7e9140, 0xc01100)
c:/go/src/runtime/panic.go:975 +0x47a
RedGuard/core.MalleableFilter(0xc000329981, 0x13, 0xc00015ed00, 0x0)
C:/Users/风起/GolandProjects/RedGuard/core/ProxyFilter.go:64 +0xb8
RedGuard/core.ProxyFilterManger(0xc00015ed00, 0x85c5fe)
C:/Users/风起/GolandProjects/RedGuard/core/ProxyFilter.go:169 +0x715
RedGuard/core.(*baseHandle).ServeHTTP(0xc63640, 0x942ea0, 0xc0004641c0, 0xc00015ed00)
C:/Users/风起/GolandProjects/RedGuard/core/ProxyHandler.go:72 +0x6fb
net/http.serverHandler.ServeHTTP(0xc000464000, 0x942ea0, 0xc0004641c0, 0xc00015ed00)
c:/go/src/net/http/server.go:2843 +0xa3
net/http.(*conn).serve(0xc00024c000, 0x9439e0, 0xc000343d80)
c:/go/src/net/http/server.go:1925 +0x8ad
created by net/http.(*Server).Serve
c:/go/src/net/http/server.go:2969 +0x36c
An error occurred...

@wikiZ
Copy link
Owner

wikiZ commented Jun 1, 2022

Please use my compiled version

@wgetnz
Copy link
Author

wgetnz commented Jun 1, 2022

Please use my compiled version

是你编译版本,我发现加入c2配置文件就会出现这个错误,MalleableFile = /root/cs/c2.profile,我使用的是正规签发的ca证书,不知道是否因为这个原因

@wikiZ
Copy link
Owner

wikiZ commented Jun 1, 2022

加我微信吧,我看看咋搞的。

@wgetnz
Copy link
Author

wgetnz commented Jun 1, 2022

加我微信吧,我看看咋搞的。

已添加,另外 Redirect = https://tencent.com 如果跳转的地址是二级域名,如https://yun.tencent.com 就不会跳转,显示404

@wgetnz
Copy link
Author

wgetnz commented Jun 1, 2022

初步确定是c2配置文件解析的问题

@wikiZ
Copy link
Owner

wikiZ commented Jun 1, 2022

这个跳转应该跟二级域名无关,主要是这里采取的是劫持获取响应的方式,所以一些站点是无法去这么做的,后面我会考虑加上重定向这种

@wikiZ
Copy link
Owner

wikiZ commented Jun 1, 2022

目前profile就是针对URI、UA、Header进行过滤请求,你可以排查一下。

@leojjj
Copy link

leojjj commented Jun 24, 2022

有解决吗我也是同样的报错

@wikiZ
Copy link
Owner

wikiZ commented Jun 24, 2022

jarm指纹随机化和自定义证书不兼容的问题,过两天下个版本已经优化了这个问题。

@wikiZ wikiZ closed this as completed Jul 17, 2022
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

3 participants