Advertisement
kiedtink

Blokir anonymox via mikrotik

Nov 8th, 2014
314
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.73 KB | None | 0 0
  1. # Tested on mikrotik RouterOs v. 5.26
  2.  
  3. /ip firewall filter
  4. add action=drop chain=forward comment="Drop anonymox" disabled=no \
  5. dst-address-list=anonymox protocol=tcp
  6. add action=drop chain=forward disabled=no dst-address-list=anonymox protocol=\
  7. udp
  8. /system scheduler
  9. add disabled=no interval=11m name=anonymox on-event=anonymox policy=\
  10. ftp,reboot,read,write,policy,test,winbox,password,sniff,sensitive,api \
  11. start-time=startup
  12. /system script
  13. add name=anonymox policy=\
  14. ftp,reboot,read,write,policy,test,winbox,password,sniff,sensitive,api \
  15. source=":foreach i in=[/ip dns cache find] do={\r\
  16. \n:local bNew \"true\";\r\
  17. \n:local cacheName [/ip dns cache all get \$i name] ;\r\
  18. \n# :put \$cacheName;\r\
  19. \n\r\
  20. \n:if ([:find \$cacheName \"anony\"] != 0) do={\r\
  21. \n\r\
  22. \n:local tmpAddress [/ip dns cache get \$i address] ;\r\
  23. \n# :put \$tmpAddress;\r\
  24. \n\r\
  25. \n# if address list is empty do not check\r\
  26. \n:if ( [/ip firewall address-list find ] = \"\") do={\r\
  27. \n:log info (\"added entry: \$[/ip dns cache get \$i name] IP \$tmpAddress\
  28. \");\r\
  29. \n/ip firewall address-list add address=\$tmpAddress list=anonymox comment\
  30. =\$cacheName;\r\
  31. \n} else={\r\
  32. \n:foreach j in=[/ip firewall address-list find ] do={\r\
  33. \n:if ( [/ip firewall address-list get \$j address] = \$tmpAddress ) do={\
  34. \r\
  35. \n:set bNew \"false\";\r\
  36. \n}\r\
  37. \n}\r\
  38. \n:if ( \$bNew = \"true\" ) do={\r\
  39. \n:log info (\"added entry: \$[/ip dns cache get \$i name] IP \$tmpAddress\
  40. \");\r\
  41. \n/ip firewall address-list add address=\$tmpAddress list=anonymox comment\
  42. =\$cacheName;\r\
  43. \n}\r\
  44. \n}\r\
  45. \n}\r\
  46. \n}\r\
  47. \n}"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement