User Tools

Site Tools


сервис_portsentry

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
сервис_portsentry [2012/06/14 15:38]
val
сервис_portsentry [2017/07/05 08:07]
val [Настройка на блокировку с использованием route]
Line 1: Line 1:
 ====== Сервис Portsentry ====== ====== Сервис Portsentry ======
  
-===== Установка и настройка на блокировку с использованием route ====+!!! Отключить самописный ​веб сервер !!!
  
-==== Ubuntu ====+[[http://​www.lissyara.su/​articles/​freebsd/​security/​portsentry/​]] 
 + 
 +===== Установка ===== 
 + 
 +==== Debian/Ubuntu ====
 <​code>​ <​code>​
-gate# apt-get install portsentry+server# apt install portsentry
  
-gatetail -f /var/log/syslog+servercd /etc/portsentry 
 +</​code>​
  
-gateci -l /etc/portsentry/​portsentry.conf+==== FreeBSD ==== 
 +<​code>​ 
 +serverpkg install ​portsentry
  
-gatecat /​etc/​portsentry/​portsentry.conf+servercd /usr/local/etc/ 
 + 
 +server# cp portsentry.conf.default portsentry.conf 
 + 
 +server# cp portsentry.ignore.default portsentry.ignore  
 +</code> 
 + 
 +===== Использование в режиме без блокировки ===== 
 + 
 +<​code>​ 
 +server# cat portsentry.conf
 </​code><​code>​ </​code><​code>​
 ... ...
-BLOCK_UDP="​1+BLOCK_UDP="​0
-BLOCK_TCP="​1"+BLOCK_TCP="​0"
 ... ...
 </​code><​code>​ </​code><​code>​
-gate# /etc/init.d/portsentry restart+servertail -f /var/log/syslog 
 +или 
 +server# tail -f /​var/​log/​messages 
 +</​code>​
  
-gate# cat /​var/​lib/​portsentry/​portsentry.blocked.*+===== Настройка на блокировку с использованием libwrap =====
  
-gatenetstat -rn | grep '​!H'​ +[[Сервис Tcpwrap#Конфигурация в режиме "​все разрешено,​ кроме"​]]
-</​code>​+
  
-==== FreeBSD ==== 
 <​code>​ <​code>​
 +server# :> /​etc/​hosts.deny
  
 +server# cat portsentry.conf
 +</​code><​code>​
 +...
 +BLOCK_UDP="​1"​
 +BLOCK_TCP="​1"​
 +...
 +KILL_HOSTS_DENY="​ALL:​ $TARGET$"​
 +...
 </​code>​ </​code>​
 +
 +===== Настройка на блокировку с использованием route =====
 +
 +[[Сервисы Gateway и routing#​Управление таблицей маршрутизации]]
 +
 +<​code>​
 +server# cat portsentry.conf
 +</​code><​code>​
 +...
 +KILL_ROUTE=...
 +...
 +</​code><​code>​
 +/sbin/route del -host 192.168.N.M reject
 +</​code>​
 +===== Просмотр заблокированных хостов =====
 +<​code>​
 +server# cat /​var/​lib/​portsentry/​portsentry.blocked.*
 +или
 +server# cat /​usr/​local/​etc/​portsentry.blocked.*
 +</​code>​
 +
сервис_portsentry.txt · Last modified: 2024/05/04 13:08 by val