there are 3 scripts here , fwknock.rsc , miknock.rsc & knockgen.py The fwknock.rsc adds the static Firewall rules on your mikrotik for to craete an static IP as
Admin address list (Change it for your desired IP) and also due to it after ping and knock 2 ports the dynamic Admin will be add to address list for 1 hour.
you can use miknock.rsc for to scheduler daily change knock port numbers. Change the Salt , SaltPort and MainPort for to customize the calculation ports.
The final scrip knockgen.py can help you for to create the command that you can use on your PC for knocking the MIkrotik. Be sure the Salt , SaltPort and MainPort are the same with in the miknock.rsc if you changed , also change the IP to your Mikrotik IP
Are you aware that port-knocking is nothing else than different variant of plain-text password? It is not even security-by-obscurity because those ports are clearly visible to anyone on the link.
I don’t understand why people still spend so much effort implementing such insecure approach.
Can you edit your post and add som information in the top on what this is and what its used for.
Also use the code tag button to add code tags around your script. Button look like this above the post </>
I added code tags .
The first script just adds the simple knock port firewall and the second script changes the ports daily according
to the time and date and for to create the different values I added some Salts that you can change it yourself.
Not everyone is on same link. ISP where server is connected can see the ports, ISP where I’m connecting from can too, and so can anyone in between. But random internet hackers from elsewhere can’t, they have to guess the right ports. So as a very simple first layer, why not.
You are literary arguing in favour of plain-text passwords. Can you imagine logging into your Gmail or Hotmail on plain old http?
Sorry, I just can’t agree with this approach. And I will warn people every time I notice someone promoting port-knocking as a “security measure”.
No, I’m just saying that it may be good enough as simple additional protection (not in any definitive sense) against random bots. So they won’t start guessing real service’s passwords right away, but they will have to guess some ports first. It is slightly better with it than without it…
Port knocking at least 4 ports in the correct order provide a layer of security. High port, Low Port, High Port, Low Port.
Port scanning all ports not responding
Attacker would have to know you are using Port Knocking
Port Knocking only allows the IP address that did the port knocking in and can be limited to a certain period of time 20 min
4.Changing the ports daily would increase the security.