Loess.ru

having fun

Windows RDP bruteforce logging

Включаем аудит: secpol.msc -> Local Policy > Audit Policy and right click the Audit account logon events policy option and choose Properties
Смотрим журнал: eventvwr.msc -> Windows logs — Security

Решения: использовать адреслисты по превышению трафика/соединений, port-knocking, VPN, фильтр по ip

Backing up Mikrotik RouterOS config to Git repository

#!/bin/sh
cd /home/user/mikrot-config/
/usr/bin/ssh -i /home/user/.ssh/id_rsa admin-ssh-account@ip.address.of.mikrot "export" > /home/user/mikrot-config/mikrot.conf 2>&1
#deletes first line with datetime for committing only config changes
/bin/sed -i '1{/by RouterOS 6/d;}' /home/user/mikrot-config/mikrot.conf
git add ./mikrot.conf
git commit -m "backup as of $(/bin/date +\%Y-\%m-\%d-\%H-\%M-\%S)"

if you need to backup a lot of hosts and webface for backup control, check https://www.ekzorchik.ru/2019/03/backing-up-mikrotik-via-oxidized/ (pdf)