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

feat: support service banner for TCP #168

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

milinddethe15
Copy link

fixes #53

TCP handler can handle other target ports without need of seperate port handlers.

Signed-off-by: milinddethe15 <[email protected]>
Copy link
Member

@glaslos glaslos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a README.md into the responses folder with a not where the responses are sourced from.

protocols/tcp/tcp.go Outdated Show resolved Hide resolved
protocols/tcp/tcp.go Outdated Show resolved Hide resolved
protocols/tcp/tcp.go Outdated Show resolved Hide resolved
protocols/tcp/tcp.go Outdated Show resolved Hide resolved
protocols/tcp/tcp.go Outdated Show resolved Hide resolved
@milinddethe15
Copy link
Author

Just to confirm:

  1. Banner should be send intially, when connected
  2. then read conn
  3. and if read conn payload > max_tcp_payload: send random data and break?

@glaslos
Copy link
Member

glaslos commented Jan 30, 2025

1 and 2 is correct. For 3, just read once, no need to read until max payload, that is just protection.

Signed-off-by: milinddethe15 <[email protected]>
@milinddethe15
Copy link
Author

what tool should I use to hit the target?
I tried telnet 127.0.0.1 4444 but banner wasn't received when connected.

@glaslos
Copy link
Member

glaslos commented Jan 30, 2025

try netcat: nc

@milinddethe15
Copy link
Author

I tried to test it and the banner isn't sent as soon as connected, but until attacker's payload. Is this how it should work?

@glaslos
Copy link
Member

glaslos commented Jan 31, 2025

You need to send the banner before we peek the connection here

Signed-off-by: milinddethe15 <[email protected]>
@milinddethe15
Copy link
Author

Tested locally with TCP port 4444. works good.

@milinddethe15 milinddethe15 requested a review from glaslos January 31, 2025 09:47
protocols/tcp/banners.go Outdated Show resolved Hide resolved
protocols/tcp/banners.go Outdated Show resolved Hide resolved
protocols/tcp/banners.go Show resolved Hide resolved
protocols/protocols.go Outdated Show resolved Hide resolved
@glaslos
Copy link
Member

glaslos commented Jan 31, 2025

Have a look at the failing test.

Signed-off-by: milinddethe15 <[email protected]>
@milinddethe15 milinddethe15 requested a review from glaslos February 5, 2025 20:50
@milinddethe15 milinddethe15 changed the title feat: Add responses for TCP feat: support service banner for TCP Feb 5, 2025
@milinddethe15
Copy link
Author

Tests are failing....
Looking into it.

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

Successfully merging this pull request may close these issues.

Add honeytrap service banners
2 participants