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

Problematic ports #25

Open
cramhead opened this issue Nov 8, 2015 · 5 comments
Open

Problematic ports #25

cramhead opened this issue Nov 8, 2015 · 5 comments

Comments

@cramhead
Copy link

cramhead commented Nov 8, 2015

Question: I'm not sure what the problem exactly is, but when I used port 80 as part of the knock sequence it would often fail. I switched another port and it seemed to work correctly. Is this expected?

@airwoflgh
Copy link
Contributor

Are you running a service on port 80 as well and have TCP flags configured as part of the sequence?

@cramhead
Copy link
Author

cramhead commented Dec 8, 2015

Yes. I did. When I removed port 80 the issue was resolved.

@airwoflgh
Copy link
Contributor

What was your configuration out of interest (particularly interested in the tcpflags setting)?

Am relatively new to the codebase so might be wrong, but I have spotted something interesting that might cause this. In the sniff function, there's a check to see if the TCP flags match on the first port and if they don't skip over them:

if(!flags_match(door, ip, tcp)) {
        continue;
}

My guess is if you happen to be using the service at the same time as the knock with different TCP flags, it would invalidate the knock sequence at that time.

I see a way of mitigating this would be to send known encoded information in the IP packet using something like IND-CCA possibly so knockd can determine between a knock request and other usage of the service running on the knock port.

@cramhead
Copy link
Author

cramhead commented Dec 9, 2015

In this case all the port requests were made using tcp.

@airwoflgh
Copy link
Contributor

Have added this to the TODO file and have slated it for a 0.9 release.

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