You send 65535 TCP SYN packets (that can be done very fast, the packets are tiny) at the router, and 65535 UDP packets. That is guaranteed to activate the 1st add-to-address-list rule.
Then you pause 30 seconds, repeat that. That activates the 2nd rule.
Then you do it again, and again. 6 times if the target has a sequence of 6 ports.
You can even do that 10 times, even if the target only requires a sequence of 3 ports. Your IP address is guaranteed to be added to the allowed list :).
That's why the solution with ICMP is much better. It's rate limited by default, and tracked as connections, sending 5000 ping packets with 5000 sizes will not help you get on the list.
For me, every ‘add-to-address-list’ rule lasts for 2 seconds, which makes things all the more difficult Only the last ‘secured’ address lasts for 5 minutes. During that time, I’m connected and therefore established,related
I use 30s because the OP has 1m timeout, but you don't have to wait. If the router drops input from WAN by default, no conntrack entry is added to the table. The next packet with the same port will still hit the rule.
That's not a problem, the attacker doesn't need 2 seconds to send 130K sub 100-byte packets towards you (that's 100Mbits) with today's home internet speed. For IPv4 TCP SYN is 40 bytes.
Does anyone know of any iOS app that lets me send these ICMP pings in the right order, with a pause in between? (I don’t want to have to keep getting my MacBook out just to do it via Terminal :-P)
Glad to stirring up a little wasp nest (good for learning purpose).
Anyway, as said, that's the first time I see these fussy rules in MT, where indeed a "drop all" one does its dirty job....
Thanks for letting us know this interesting icmp portknock approach. Maybe considering to change my knock sequence to that.
I am using a 2 step port knock: first knock on some high tcp port, adds to address list with 1s timeout. second knock must be on another high udp port, within the 1s timeout and must match a "content" payload. For that complex sequence I use https://f-droid.org/packages/me.impa.knockonports
Yes, it's faster with dedicated port-knocking app, you can get in instantly. The ping method is much slower and manual, due to the conntrack timeout requirement, you really have to wait. But it's great for emergency remote router management without tools on locked down foreign computers (if you put www-ssl behind the address list check).
Great, you find the way, forgot previously to suggest iSH Shell app which I’m using for some things, it also has functionality to create shortcuts for running shell scripts, so it similar to app which you are using. It is Alpine linux based, it has apk package manager for installing cli tools, possibility to mount host dir from iOS, etc…