Advertisement
askanton

Ловим хакеров

Feb 4th, 2021
315
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. Проверяем конфиг ssh
  2. grep -i port /etc/ssh/sshd_config
  3. меняем порт
  4. nano /etc/ssh/sshd_config
  5. #Port 22 → Port 2279
  6.  
  7. systemctl restart sshd
  8. grep -i port /etc/ssh/sshd_config
  9.  
  10. nano /usr/local/bin/hitme.sh
  11. chmod +x /usr/local/bin/hitme.sh
  12.  
  13. #!/bin/bash
  14. token="ваш токен"
  15. chat_id="ваш id"
  16. sendmsg="https://api.telegram.org/bot$token/sendMessage?parse_mode=html"
  17. msg=/tmp/ssh_msg.tcdxt
  18. tail -n 1 /var/log/auth.log > $msg
  19. curl $sendmsg -d chat_id=$chat_id -d text="$(<$msg)"
  20. rm /tmp/ssh_msg_info.txt
  21.  
  22.  
  23. ставим Incron
  24. apt-get install incron
  25. Разрешаем рут
  26. nano /etc/incron.allow
  27. incrontab -l
  28. incrontab -e
  29.  
  30. /var/log/auth.log IN_MODIFY /usr/local/bin/hitme.sh
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement