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

can't test https connections #515

Open
roland-github opened this issue May 16, 2022 · 1 comment
Open

can't test https connections #515

roland-github opened this issue May 16, 2022 · 1 comment

Comments

@roland-github
Copy link

Deployed docker honeytrap playground version
Need to use http and https services
http is working fine but https is disconnecting:
client error:
$ curl -k https://10.9.121.15:443/index.html curl: (52) Empty reply from server
server/honeytrap container error:
14:40:12.033 honeytrap/server ▶ DEBU 1d8 Accepted connection for 10.9.103.17:44322 => 172.18.0.4:443 14:40:12.033 honeytrap/server ▶ DEBU 1d9 Handling connection for 10.9.103.17:44322 => 172.18.0.4:443 https(https) 14:40:12.206 honeytrap/server ▶ DEBU 1da Disconnected connection for 10.9.103.17:44322 => 172.18.0.4:443 %!s(<nil>) > %!s(<nil>) > date=2022-05-16 14:40:12.20624518 +0000 UTC m=+9176.628632464, destination-ip=172.18.0.4, destination-port=443, message=runtime error: invalid memory address or nil pointer dereference, source-ip=10.9.103.17, source-port=44322, stacktrace=goroutine 228 [running]:\x0aruntime/debug.Stack(0xc001046ca0, 0xd56940, 0xc007748478)\x0a\x09/usr/local/go/src/runtime/debug/stack.go:24 +0x9f\x0agithub.com/honeytrap/honeytrap/event.Stack.func1(0xc00103af00)\x0a\x09/src/honeytrap/event/event.go:267 +0x26\x0agithub.com/honeytrap/honeytrap/event.New(0xc00008d8a0, 0x5, 0x5, 0x1)\x0a\x09/src/honeytrap/event/map.go:53 +0xeb\x0agithub.com/honeytrap/honeytrap/server.(*Honeytrap).handle.func2(0xc00006cf60, 0x100f2f8, 0xc00640a010)\x0a\x09/src/honeytrap/server/honeytrap.go:692 +0x211\x0apanic(0xda12a0, 0x15342f0)\x0a\x09/usr/local/go/src/runtime/panic.go:965 +0x1b9\x0agithub.com/honeytrap/honeytrap/services.(*httpService).Handle(0xc0005fa1e0, 0x1004130, 0xc000038030, 0x100eed8, 0xc00103a9f0, 0x0, 0x0)\x0a\x09/src/honeytrap/services/http.go:138 +0x7bd\x0agithub.com/honeytrap/honeytrap/services.(*httpsService).Handle(0xc0005fa1e0, 0x1004130, 0xc000038030, 0x100f090, 0xc0065d00c0, 0x4, 0x4)\x0a\x09/src/honeytrap/services/https.go:161 +0x2d5\x0agithub.com/honeytrap/honeytrap/server.(*Honeytrap).handle(0xc00006cf60, 0x100f2f8, 0xc00640a010)\x0a\x09/src/honeytrap/server/honeytrap.go:719 +0x5e6\x0acreated by github.com/honeytrap/honeytrap/server.(*Honeytrap).Run\x0a\x09/src/honeytrap/server/honeytrap.go:667 +0x2bca\x0a, token=ca120kuf87dg00dbj930, type=fatal

We are expecting a https connection after SSL negotiation just like on http

Test env is a centos VM with 4vpcu, 8GB memory for all the playground containers (kibana, elastic, honeytrap)
No other system/resource errors

@ycamper
Copy link

ycamper commented Oct 10, 2023

FYI, for anyone that comes here that is experiencing the same issue with this:

The code calls the http handler after its done processing the TLS stuff, but never sets the output channel. So you get a nil deref when trying to access s.c. So update services/https.go to call s.httpService.SetChannel(s.c) sometime before it calls s.httpService.Handle()

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

2 participants