Skip to content

Conversation

@milinddethe15
Copy link

fixes #53

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

Signed-off-by: milinddethe15 <milinddethe15@gmail.com>
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.

@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 <milinddethe15@gmail.com>
@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 <milinddethe15@gmail.com>
@milinddethe15
Copy link
Author

Tested locally with TCP port 4444. works good.

@milinddethe15 milinddethe15 requested a review from glaslos January 31, 2025 09:47
@glaslos
Copy link
Member

glaslos commented Jan 31, 2025

Have a look at the failing test.

Signed-off-by: milinddethe15 <milinddethe15@gmail.com>
@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.

Signed-off-by: milinddethe15 <milinddethe15@gmail.com>
Signed-off-by: milinddethe15 <milinddethe15@gmail.com>
@milinddethe15
Copy link
Author

Test is getting timeout error.
I guess it is expecting user data when peeking the conn.
Before this PR changes, wasn't test peeking the conn?? Its confusing..

@glaslos
Copy link
Member

glaslos commented Mar 2, 2025

I pushed a change to the main branch introducing the timeout on the buffered connection we use for peeking.
After peeking the connection, you have to use the bufConn, not the original conn. Also make sure you set an actual read deadline instead of SetReadDeadline(time.Time{})

milinddethe15 and others added 2 commits March 3, 2025 00:17
Signed-off-by: milinddethe15 <milinddethe15@gmail.com>
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