mirror of
https://github.com/gbudny93/RouterOS_Useful_Scripts.git
synced 2025-06-22 09:53:31 +02:00
26 lines
705 B
Text
26 lines
705 B
Text
|
# RouterOS Function
|
||
|
# Copyright (c) Grzegorz Budny
|
||
|
# Port Knock from RouterOS
|
||
|
|
||
|
:global PortKnock do={
|
||
|
|
||
|
|
||
|
:foreach sourceAddress, destinationPort in $base do={
|
||
|
|
||
|
:log info "...:::Port Knocking Sequance Started:::...";
|
||
|
:log warning ("Knocking to ".$destinationAddress." on port ".$destinationPort." from ".$sourceAddress);
|
||
|
|
||
|
/system ssh src-address=$sourceAddress port=$destinationPort address=$destinationAddress;
|
||
|
|
||
|
|
||
|
}
|
||
|
|
||
|
:log info ("...:::Port Knocking Finished check access to ".$destinationAddress);
|
||
|
|
||
|
}
|
||
|
|
||
|
:global knockBase {"sourceIP1"="port23"; \
|
||
|
"sourceIP2"="port22" \
|
||
|
};
|
||
|
|
||
|
$PortKnock base=$knockBase destinationAddress=destinationIP;
|