1.Устанавливаю portsentry из портов
2. Правлю конфиг /usr/local/etc/portsentry.conf
Код: Выделить всё
TCP_PORTS="1,11,15,23,79,81,111,119,540,635,1080,1524,2000,5742,6667,8080,8085"
UDP_PORTS="1,7,9,69,513,635,640,641,700"
ADVANCED_PORTS_TCP="1024"
ADVANCED_PORTS_UDP="1024"
ADVANCED_EXCLUDE_TCP="113,139"
ADVANCED_EXCLUDE_UDP="520,138,137,67"
IGNORE_FILE="/usr/local/etc/portsentry.ignore"
HISTORY_FILE="/usr/local/etc/portsentry.history"
BLOCKED_FILE="/usr/local/etc/portsentry.blocked"
RESOLVE_HOST = "1"
BLOCK_UDP="1"
BLOCK_TCP="1"
KILL_ROUTE="/sbin/ipfw add 2 deny all from $TARGET$:255.255.255.255 to any"
KILL_RUN_CMD_FIRST = "0"
KILL_RUN_CMD="/usr/script/work/scan_port_mail.sh $TARGET$ $PORT$"
SCAN_TRIGGER="0"
Код: Выделить всё
${FwCMD} add allow tcp from any to ${IpOut} \
1,11,15,23,79,81,111,119,540,635 via ${LanOut}
${FwCMD} add allow tcp from any to ${IpOut} \
1080,1524,2000,5742,6667,8080,8085 via ${LanOut}
${FwCMD} add allow udp from any to ${IpOut} \
1,7,9,69,513,635,640,641,700 via ${LanOut}
Код
sh rc.firewall &
/usr/local/etc/rc.d/portsentry.sh start
5. Смотрю открытые порты
sockstat | grep ports
Код: Выделить всё
root portsentry 564 0 udp4 *:1 *:*
root portsentry 564 1 udp4 *:7 *:*
root portsentry 564 2 udp4 *:9 *:*
root portsentry 564 3 udp4 *:69 *:*
root portsentry 564 4 udp4 *:513 *:*
root portsentry 564 5 udp4 *:635 *:*
root portsentry 564 6 udp4 *:640 *:*
root portsentry 564 7 udp4 *:641 *:*
root portsentry 564 8 udp4 *:700 *:*
root portsentry 562 0 tcp4 *:1 *:*
root portsentry 562 1 tcp4 *:11 *:*
root portsentry 562 2 tcp4 *:15 *:*
root portsentry 562 3 tcp4 *:23 *:*
root portsentry 562 4 tcp4 *:79 *:*
root portsentry 562 5 tcp4 *:81 *:*
root portsentry 562 6 tcp4 *:111 *:*
root portsentry 562 7 tcp4 *:119 *:*
root portsentry 562 8 tcp4 *:540 *:*
root portsentry 562 9 tcp4 *:635 *:*
root portsentry 562 10 tcp4 *:1080 *:*
root portsentry 562 11 tcp4 *:1524 *:*
root portsentry 562 12 tcp4 *:2000 *:*
root portsentry 562 13 tcp4 *:5742 *:*
root portsentry 562 14 tcp4 *:6667 *:*
root portsentry 562 15 tcp4 *:8080 *:*
root portsentry 562 16 tcp4 *:8085 *:*
В итоге скан проходин и portsenry его не останавливает.
В чем проблема?
ЗЫ: ОС FreeBSD 6.1