Cisco-Port-Knocking-EEM-applet: различия между версиями
Материал из noname.com.ua
Перейти к навигацииПерейти к поискуSirmax (обсуждение | вклад) |
Sirmax (обсуждение | вклад) |
||
Строка 52: | Строка 52: | ||
</PRE> |
</PRE> |
||
− | ==<code>Interface |
+ | ==<code>Interface Po2.54</code>== |
<PRE> |
<PRE> |
||
+ | interface Port-channel2.54 |
||
+ | description ---== Uplink ===--- |
||
+ | encapsulation dot1Q 54 |
||
+ | ip address 172.31.0.1 255.255.255.252 |
||
+ | ip nat outside |
||
+ | ip access-group KNOCK_TCP_32022 in |
||
</PRE> |
</PRE> |
Версия 10:07, 1 июля 2024
Port Knocking EEM applet
Оригинал: https://davideaves.com/2014/11/cisco-port-knocking-eem/
Это пример плохого решения так как
permit tcp any any eq 32022 log
- попадает в том числе и транзитный траффик, а не только трафик к самому устройству, чего хотелось бы. (сам ACL см ниже)
event manager applet
event manager environment KNOCK_ACL outside-in4 no event manager applet KNOCK event manager applet KNOCK event syslog pattern "%FMANFP-6-IPACCESSLOGP: SIP0: fman_fp_image: list outside-in4 permitted tcp *" action 1.0 regexp "[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+" "$_syslog_msg" ADDR action 1.1 regexp "\([0-9]+\)," "$_syslog_msg" PORT action 1.2 regexp "[0-9]+" "$PORT" PORT action 2.0 syslog msg "Received a knock from $ADDR on port $PORT..." action 2.1 syslog msg "Adding $ADDR to the $KNOCK_ACL ACL" action 3.0 cli command "enable" action 3.1 cli command "configure terminal" action 3.2 cli command "ip access-list extended $KNOCK_ACL" action 3.3 cli command "1 permit tcp host $ADDR any eq 22" action 3.4 cli command "2 permit tcp host $ADDR any eq 23" action 4.0 wait 60 action 5.0 syslog msg "Removing $ADDR to the $KNOCK_ACL ACL" action 6.0 cli command "no permit tcp host $ADDR any eq 22" action 6.1 cli command "no permit tcp host $ADDR any eq 23" action 6.2 cli command "exit" ! exit
ip access-list extended outside-in4
no ip access-list extended outside-in4 ip access-list extended outside-in4 remark *** KNOCK *** permit tcp any any eq 32022 log remark *** TRUSTED *** permit tcp any any established remark *** DENIED *** deny tcp any any remark *** PERMITED *** permit ip any any
Interface Po2.54
interface Port-channel2.54 description ---== Uplink ===--- encapsulation dot1Q 54 ip address 172.31.0.1 255.255.255.252 ip nat outside ip access-group KNOCK_TCP_32022 in