SMF - Just Installed!
:local ftpuser "user"
:local ftppassword "password"
:local ftphost "192.168..."
:local config "master"
# set timestamp for monitoring
:if ( [:len [/ip firewall address-list find where list=sync_timestamp address="0.0.0.0" disabled=yes]] = 0 ) do={
/ip firewall address-list add list=sync_timestamp address="0.0.0.0" disabled=yes
}
:local date [/system clock get date]
:local time [/system clock get time]
:local timestamp "$date_$time"
/ip firewall address-list set [/ip firewall address-list find where list=sync_timestamp address="0.0.0.0" disabled=yes] comment="timestamp: $timestamp"
#export config
/ip firewall
export file="$config"
/
# put config to slave
tool fetch address=$ftphost user=$ftpuser password=$ftppassword mode=ftp src-path=($config.".rsc") dst-path=($config.".rsc") upload=yes;:local config "master.rsc"
:if ([:len [/file find name=$config]] > 0) do={
:put "Found config from master!"
/ip firewall filter remove [/ip firewall filter find dynamic=no]
/ip firewall nat remove [/ip firewall nat find dynamic=no]
/ip firewall raw remove [/ip firewall raw find dynamic=no]
/ip firewall mangle remove [/ip firewall mangle find dynamic=no]
/ip firewall address-list remove [/ip firewall address-list find dynamic=no]
/ip firewall layer7-protocol remove [/ip firewall layer7-protocol find]
/import $config
/file remove $config
} else { :put "Config form master ($config) not found" }/ip firewall filteradd action=accept chain=input comment="accept establish & related" connection-state=established,relatedadd action=drop chain=input comment="drop invalid" connection-state=invalidadd action=accept chain=input comment="accept ICMP" protocol=icmpadd action=drop chain=input comment="drop all not from lan" in-interface=!bridge1-lanadd action=accept chain=forward comment="accept established,related" connection-state=established,relatedadd action=drop chain=forward comment="drop invalid" connection-state=invalidadd action=drop chain=forward comment="drop all from WAN to LAN" connection-nat-state=!dstnat connection-state=new in-interface=ether1-wanadd action=accept chain=forward comment="accept http & https from LAN" dst-port=80,443 in-interface=bridge1-lan out-interface=ether1-wan protocol=tcpadd action=accept chain=forward comment="accept dns from LAN" dst-port=53 in-interface=bridge1-lan out-interface=ether1-wan protocol=udpadd action=drop chain=forward comment="drop all from LAN to WAN" in-interface=bridge1-lan out-interface=ether1-wan/ip firewall natunset 0 dst-address/ip firewall nat unset 0 dst-addressprintset 0 dst-address=192.168.88.32/ip firewall nat unset 0 dst-address
>/ip firewall filter add chain=input psd=21,3s,3,1 action=add-src-to-address-list address-list=psd/ip firewall raw add chain=prerouting src-address-list=psd action=drop/ip firewall address-listadd list=ddos-attackersadd list=ddos-target/ip settings set tcp-syncookies=yes/ip firewall filteradd chain=forward connection-state=new action=jump jump-target=detect-ddosadd action=return chain=detect-ddos dst-limit=32,32,src-and-dst-addresses/10sadd action=return chain=detect-ddos dst-limit=32,32,src-and-dst-addresses/10s protocol=tcp tcp-flags=syn,ackadd action=add-dst-to-address-list address-list=ddos-target address-list-timeout=10m chain=detect-ddosadd action=add-src-to-address-list address-list=ddos-attackers address-list-timeout=10m chain=detect-ddos/ip firewall rawadd action=drop chain=prerouting dst-address-list=ddos-target src-address-list=ddos-attackerssudo vi /etc/haproxy/haprxy.cfgbackend Apache2_Server
mode http
http-request add-header X-Forwarded-For %[src]
http-request set-header X-Forwarded-Port %[dst_port]sudo a2enmod remoteipsudo vi /etc/apache2/apache2.confRemoteIPHeader X-Forwarded-Forsudo apache2ctl configtestsudo systemctl apache2 restartxfs_growfs /dev/centos/rootsudo -u www-data php8.2 occ upgradesudo -u www-data php8.2 occ maintenance:mode --offopenssl s_client -starttls smtp -connect smtp.yandex.ru:587openssl s_client -connect smtp.yandex.ru:465ehloЦитировать250-relay.im-cloud.site Hello [192.168.0.15]
250-SIZE 10485760
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-X-ANONYMOUSTLS
250-AUTH LOGIN PLAINT
250-X-EXPS GSSAPI NTLM
250-8BITMIME
250-BINARYMIME
250-CHUNKING
250-XEXCH50
250-XRDST
250 XSHADOW
echo -ne "текст" | base64[System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes("текст"))perl -MMIME::Base64 -e "print encode_base64('текст');"AUTH LOGINЦитировать334 VXNlcm5hbWU6
ZG1vc2s=Цитировать334 UGFzc3dvcmQ6
cGFzc3dvcmQ=Цитировать235 2.0.0 Authentication successful
echo -ne "\0username\0password" | base64[System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes("\0username\0password"))AUTH PLAINЦитировать334 VXNlcm5hbWU6