Архив для ‘ Work ’ Категории

How to autodetect infected or spammer users and temporary block the SMTP output mikrotik

/ip firewall filter

add chain=forward protocol=tcp dst-port=25 src-address-list=spammer
action=drop comment="BLOCK SPAMMERS OR INFECTED USERS"

add chain=forward protocol=tcp dst-port=25 connection-limit=30,32 limit=50,5 action=add-src-to-address-list
address-list=spammer address-list-timeout=1d comment="Detect and add-list SMTP virus or spammers"

 

http://forum.mikrotik.com/viewtopic.php?t=109662

add chain=tcp protocol=tcp dst-port=25 action=add-src-to-address-list \
comment=»add src smtp»

add chain=tcp protocol=tcp dst-port=465 action=add-src-to-address-list \
comment=»add src smtp»

add chain=udp protocol=udp dst-port=587 action=add-src-to-address-list \
comment=»add src smtp»

add chain=udp protocol=udp dst-port=25 action=add-src-to-address-list \
comment=»add src smtp»

add chain=udp protocol=udp dst-port=465 action=add-src-to-address-list \
comment=»add src smtp»

add chain=udp protocol=udp dst-port=587 action=add-src-to-address-list \
comment=»add src smtp»

zimbra

8.7 install
%d0%bc%d0%b8%d0%b3%d1%80%d0%b0%d1%86%d0%b8%d1%8f-%d0%bd%d0%b0-zimbra-%d1%81-%d0%bf%d0%be%d1%81%d1%82%d0%be%d1%80%d0%be%d0%bd%d0%bd%d0%b5%d0%b3%d0%be-%d0%bf%d0%be%d1%87%d1%82%d0%be%d0%b2%d0%b8%d0%ba

www.securitylab.ru
%d1%81%d0%be%d0%b7%d0%b4%d0%b0%d0%bd%d0%b8%d0%b5-%d0%bf%d0%b0%d1%80%d0%b0%d0%bb%d0%b5%d0%bb%d1%8c%d0%bd%d0%be%d0%b3%d0%be-%d0%bf%d0%be%d1%87%d1%82%d0%be%d0%b2%d0%be%d0%b3%d0%be-%d1%81%d0%b5%d1%80

setup-zimbra-centos7

how-to-install-zimbra-8-5_1
how-to-install-zimbra-8-5_2

How To Install Zimbra 8.5.0 on CentOS 7 Part 1

How To Easy Install Zimbra 8.5 on CentOS 7

Zimbra 8.6 на CentOS 6.5
Setting Up Internal GAL Sync
Авторизация пользователей Active Directory в Zimbra
%d0%b0%d0%b2%d1%82%d0%be%d1%80%d0%b8%d0%b7%d0%b0%d1%86%d0%b8%d1%8f-%d0%bf%d0%be%d0%bb%d1%8c%d0%b7%d0%be%d0%b2%d0%b0%d1%82%d0%b5%d0%bb%d0%b5%d0%b9-active-directory-%d0%b2-zimbra-jnotes

Настройка проверки подлинности (SSO) через AD
zimbra-sso-ad

How To Install Zimbra Collaboration Suite 8.6.0 On CentOS 7
how-to-install-zimbra-collaboration-suite-8-6

Install Zimbra 8.6 on CentOS 7 (hosted by ESXi 5.5) behind NAT
it-area_-%d1%83%d1%81%d1%82%d0%b0%d0%bd%d0%be%d0%b2%d0%ba%d0%b0-zimbra-8-6-%d0%bd%d0%b0-centos-7-%d0%b2%d0%b8%d1%80%d1%82%d1%83%d0%b0%d0%bb%d1%8c%d0%bd%d0%b0%d1%8f-%d0%bc%d0%b0%d1%88%d0%b8%d0%bd

Как настроить почтовый сервер Zimbra на CentOS
%d0%ba%d0%b0%d0%ba-%d0%bd%d0%b0%d1%81%d1%82%d1%80%d0%be%d0%b8%d1%82%d1%8c-%d0%bf%d0%be%d1%87%d1%82%d0%be%d0%b2%d1%8b%d0%b9-%d1%81%d0%b5%d1%80%d0%b2%d0%b5%d1%80-zimbra-%d0%bd%d0%b0-centos

mikrotik ssh ftp telnet winbox — bruteforce

/ip firewall filter add chain=input protocol=tcp dst-port=21 src-address-list=ftp_blacklist action=drop comment="drop ftp brute forcers"
/ip firewall filter add chain=output action=accept protocol=tcp content="530 Login incorrect" dst-limit=1/1m,9,dst-address/1m
/ip firewall filter add chain=output action=add-dst-to-address-list protocol=tcp content="530 Login incorrect" address-list=ftp_blacklist address-list-timeout=3h
/ip firewall filter add chain=input protocol=tcp dst-port=22 src-address-list=ssh_blacklist action=drop comment="drop ssh brute forcers" disabled=no
/ip firewall filter add chain=input protocol=tcp dst-port=22 connection-state=new src-address-list=ssh_stage3 action=add-src-to-address-list address-list=ssh_blacklist address-list-timeout=10d comment="" disabled=no
/ip firewall filter add chain=input protocol=tcp dst-port=22 connection-state=new src-address-list=ssh_stage2 action=add-src-to-address-list address-list=ssh_stage3 address-list-timeout=1m comment="" disabled=no
/ip firewall filter add chain=input protocol=tcp dst-port=22 connection-state=new src-address-list=ssh_stage1 action=add-src-to-address-list address-list=ssh_stage2 address-list-timeout=1m comment="" disabled=no
/ip firewall filter add chain=input protocol=tcp dst-port=22 connection-state=new action=add-src-to-address-list address-list=ssh_stage1 address-list-timeout=1m comment="" disabled=no
/ip firewall filter add chain=input action=drop protocol=tcp src-address-list=telnet_blacklist dst-port=23 comment="drop telnet brute forcers"
/ip firewall filter add chain=input action=add-src-to-address-list connection-state=new protocol=tcp src-address-list=telnet_stage3 address-list=telnet_blacklist address-list-timeout=1w3d dst-port=23
/ip firewall filter add chain=input action=add-src-to-address-list connection-state=new protocol=tcp src-address-list=telnet_stage2 address-list=telnet_stage3 address-list-timeout=1m dst-port=23
/ip firewall filter add chain=input action=add-src-to-address-list connection-state=new protocol=tcp src-address-list=telnet_stage1 address-list=telnet_stage2 address-list-timeout=1m dst-port=23
/ip firewall filter add chain=input action=add-src-to-address-list connection-state=new protocol=tcp address-list=telnet_stage1 address-list-timeout=1m dst-port=23
/ip firewall filter add chain=input action=drop protocol=tcp src-address-list=winbox_blacklist dst-port=8291 comment="drop winbox brute forcers"
/ip firewall filter add chain=input action=add-src-to-address-list connection-state=new protocol=tcp src-address-list=winbox_stage3    address-list=winbox_blacklist address-list-timeout=1w3d dst-port=8291
/ip firewall filter add chain=input action=add-src-to-address-list connection-state=new protocol=tcp src-address-list=winbox_stage2 address-list=winbox_stage3 address-list-timeout=1m dst-port=8291
/ip firewall filter add chain=input action=add-src-to-address-list connection-state=new protocol=tcp src-address-list=winbox_stage1 address-list=winbox_stage2 address-list-timeout=1m dst-port=8291
/ip firewall filter add chain=input action=add-src-to-address-list connection-state=new protocol=tcp address-list=winbox_stage1 address-list-timeout=1m dst-port=8291

 

mikrotik rdp brutforce

http://serverfault.com/questions/548923/prevent-rdp-logon-brute-force-in-mikrotik-router-via-winbox
prevent-rdp-logon-brute-force-in-mikrotik-router-via-winbox-server-fault

/ip firewall filter add chain=forward protocol=tcp dst-port=3389 src-address-list=rdp_blacklist action=drop comment="drop rdp brute forcers" disabled=no

/ip firewall filter add chain=forward protocol=tcp dst-port=3389 connection-state=new src-address-list=rdp_stage3 action=add-src-to-address-list address-list=rdp_blacklist address-list-timeout=10d comment="" disabled=no

/ip firewall filter add chain=forward protocol=tcp dst-port=3389 connection-state=new src-address-list=rdp_stage2 action=add-src-to-address-list address-list=rdp_stage3 address-list-timeout=1m comment="" disabled=no

/ip firewall filter add chain=forward protocol=tcp dst-port=3389 connection-state=new src-address-list=rdp_stage1 action=add-src-to-address-list address-list=rdp_stage2 address-list-timeout=1m comment="" disabled=no

/ip firewall filter add chain=forward protocol=tcp dst-port=3389 connection-state=new action=add-src-to-address-list address-list=rdp_stage1 address-list-timeout=1m comment="" disabled=no

 

Samba AD

Настройка Samba AD в 4.4 на Centos 7
Installing Samba 4.4.0 AD DC on CentOS 7.1511
installing-samba-4-4-0-ad-dc-on-centos-7

kinit administrator@BALES.LAN — Домен пишется СТРОГО ЗАГЛАВНЫМИ!!!

Если мешает NetworkManager в resolf.conf

sudo /etc/init.d/NetworkManager stop
chkconfig NetworkManager off

Также, можно пойти другим путем и использовать systemctl:
systemctl disable NetworkManager
systemctl stop NetworkManager

———————————————

Unit SystemD
vim /lib/systemd/system/samba.service

[Unit]
Description= Samba 4 Active Directory
After=syslog.target
After=network.target

[Service]
Type=forking
PIDFile=/usr/local/samba/var/run/samba.pid
LimitNOFILE=16384
EnvironmentFile=-/etc/conf.d/samba
ExecStart=/usr/local/samba/sbin/samba
ExecReload=/usr/bin/kill -HUP $MAINPID

[Install]
WantedBy=multi-user.target

systemctl enable samba
systemctl start samba

——————————————

Прописывание обратной зоны для 192.168.10.5

Теперь давайте добавим зону traning.kz в наш сервер:
samba-tool dns zonecreate traning.kz 10.168.192.in-addr.arpa -UAdministrator%’Traning.kz!’

Создаём PTR запись для сервера dc.traning.kz:
samba-tool dns add dc.traning.kz 10.168.192.in-addr.arpa 1 PTR dc.traning.kz -UAdministrator%’Traning.kz!’

Теперь создадим А запись для нашего сервера gateway:
samba-tool dns add 192.168.10.5 traning.kz gateway A 192.168.10.1 -UAdministrator%’Traning.kz!’

Давайте проверим:
ping gateway

После создания зоны Самбу необходимо перезапустить:

systemctl restart samba
————————————————-
Ошибки

Ввод ubuntu в домен

AD + Samba Backend Centos 6.8 (4.5)
Samba 4.5 in CentOS 6.8 as Secondary DC with Microsoft Active Directory 2012R2

—————————————————

Полный гайд по PDC и BDC на Samba — все, что нужно.
http://yvision.kz/post/542170 — samba-4-PDC AD DC-centos-7 PDC

http://yvision.kz/post/577878 — samba-4-BDC SDC

——————————————————
Перемещаемые профили windows 7

https://www.stefanwienert.de/blog/2014/07/02/samba-4-active-directory-controller-with-windows-7-roaming-profiles-plus-linux-login-the-definitive-guide/
samba-4-active-directory-controller-with-windows-7-roaming-profiles-linux-login-the-complete-guide-_-stefanwienert

How to configure Samba 4 as Secondary Domain Controller

Samba4 provisioning
Доменный контроллер Samba4 на CentOS
%d0%b4%d0%be%d0%bc%d0%b5%d0%bd%d0%bd%d1%8b%d0%b9-%d0%ba%d0%be%d0%bd%d1%82%d1%80%d0%be%d0%bb%d0%bb%d0%b5%d1%80-samba4-%d0%bd%d0%b0-centos-medium

Миграция доменного контроллера Windows 2008R2 в Samba4
%d0%bc%d0%b8%d0%b3%d1%80%d0%b0%d1%86%d0%b8%d1%8f-%d0%b4%d0%be%d0%bc%d0%b5%d0%bd%d0%bd%d0%be%d0%b3%d0%be-%d0%ba%d0%be%d0%bd%d1%82%d1%80%d0%be%d0%bb%d0%bb%d0%b5%d1%80%d0%b0-windows-2008r2-%d0%b2-samba4

https://wiki.samba.org/index.php/Setup_Samba_as_an_AD_Domain_Member

Ошибка «Удаленный сеанс отключен, поскольку отсутствуют клиентские лицензии удаленного рабочего стола»

Ошибка «Удаленный сеанс отключен, поскольку отсутствуют клиентские лицензии удаленного рабочего стола»


%d0%be%d1%88%d0%b8%d0%b1%d0%ba%d0%b0-%d1%83%d0%b4%d0%b0%d0%bb%d0%b5%d0%bd%d0%bd%d1%8b%d0%b9-%d1%81%d0%b5%d0%b0%d0%bd%d1%81-%d0%be%d1%82%d0%ba%d0%bb%d1%8e%d1%87%d0%b5%d0%bd-%d0%bf%d0%be%d1%81

Centos — удаление ядер

1 способ.
После обновления в системе остаются старые ядра, которые ненужны.

rpm -qa|grep kernel

kernel-headers-2.6.18-128.4.1.el5
kernel-2.6.18-92.el5
ovzkernel-2.6.18-92.1.13.el5.028stab059.6
kernel-2.6.18-92.1.22.el5
kernel-2.6.18-128.4.1.el5
ovzkernel-2.6.18-128.2.1.el5.028stab064.4

Пригодится нам могут только два посление. Поэтому:

yum remove kernel-2.6.18-92.el5

И с остальными ненужными поступаем аналогично.

2 способ.
1.Просмотр установленных ядер:

# rpm -q kernel

2.Устанавливаем пакет yum-utils:

# yum install yum-utils

3.Используем утилиту package-cleanup, который входит в состав пакета yum-utils для удаления всех старых ядер , оставляя при этом два самых свежих ядра

# package-cleanup —oldkernels —count=2

4.Просмотр оставшихся установленных ядер:

# rpm -q kernel
5. При необходимости определяем кол-во установленных в системе ядер

# nano /etc/yum.conf

installonly_limit=3

Включение sftp на openssh

Debian 7

cat /etc/ssh/sshd_config
Subsystem sftp /usr/lib/sftp-server

или сначала найти файл sftp-server
find / -name sftp-server

проблемы с кодировкой пр переносе сайтов

.htaccess
AddDefaultCharset UTF-8
php_value default_charset «utf-8»

или

AddDefaultCharset windows-1251
php_value default_charset «windows-cp1251»

Перенос сайта wordpress на сервер Vesta CP

%d0%bf%d0%b5%d1%80%d0%b5%d0%bd%d0%be%d1%81-%d1%81%d0%b0%d0%b9%d1%82%d0%b0-%d1%81-wordpress-%d0%bd%d0%b0-%d1%81%d0%b5%d1%80%d0%b2%d0%b5%d1%80-vesta-cp

Перенос сайта с хостинга на сервер при помощи панели Vesta CP