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

Add support for port knocking prior to establishing MQTT connection #69

Open
ben423423n32j14e opened this issue Nov 20, 2018 · 3 comments

Comments

@ben423423n32j14e
Copy link

ben423423n32j14e commented Nov 20, 2018

Can we please have support for port knocking prior to establishing a connection to an MQTT server?

Eg, knock ports 1, 2, 3 then establish the MQTT connection.

Also it would need to re-knock the ports when re-establishing a connection if it drops out.

This would let me not directly expose my MQTT server to the internet.

Thanks

@deepessh
Copy link
Owner

Not sure how this could be implemented. Do you have any suggestions/ideas?

@ben423423n32j14e
Copy link
Author

ben423423n32j14e commented Jan 17, 2019

@dc297 this is how I do it on OS X using a bash script:

nc -G 1 -vz 192.168.0.5 2351 &> /dev/null &
sleep 0.1
nc -G 1 -vz 192.168.0.5 7182 &> /dev/null &
sleep 0.1
nc -G 1 -vz 192.168.0.5 874 &> /dev/null &

It just needs to make a request on each port (in this case combination of 3 ports). I'm using Netcat in the example but I could also do it by making a http request to each port using a web browser. It just needs to make the requests on each port which my firewall can see so it opens the port for the phones IP address.

I really like this method, because as I said it allows me to not have to directly expose my MQTT server to the internet which drastically reduces the chances of it getting hacked.

@deepessh
Copy link
Owner

Can you explain more about how this could be done via HTTP request

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