ALT Linux Community general discussions
 help / color / mirror / Atom feed
From: Afanasov Dmitry <ender@comp-mir.ru>
To: community@altlinux.ru
Subject: Re: [Comm] iptables и nmap : DROP, REJECT -> filtered
Date: Mon, 12 Sep 2005 12:41:46 +0400
Message-ID: <20050912084146.GA9996@nick.comp-mir.ru> (raw)
In-Reply-To: <431D707D.5070908@stc.donpac.ru>

[-- Attachment #1: Type: text/plain, Size: 1290 bytes --]

On Tue, Sep 06, 2005 at 02:33:33PM +0400, Eugene Prokopiev wrote:
> Здравствуйте!
> 
> Когда-то, читая Андерсона в переводе Киселева, запомнил, что цель REJECT 
> в iptables не просто убивает пакеты, приходящие на определенный порт, а 
> посылает отправителю icmp-сообщение port-unreachable. Ну и домыслил, что 
> nmap должен видеть такие порты как closed.
> 
> Сегодня впервые попробовал это сделать и был немного разочарован 
> результатом:
> 
процесс подключения: syn -> syn-ack -> ack
процесс обрыва подключения: пакет -> rst (reset)

если подключающаяся сторона не получит ни SA, ни A, ни RST пакета, то
считается, то происходит отввал по timeout'у (nmap достаточно долго
начинает сканировать).

если на S пакет пришёл icmp - ясно понятно, что это firewall - tcp/ip стек
так не действует.

зато если на S пришёл R (так показывает tcpdump, кстати), то именно так и
надо сбрасывать tcp подключения по rfc.

в итоге правило:

-j REJECT --reject-with tcp-reset

(icmp отлуп имеет смысл давать только для udp - там нет механизма сброса
подключения. только тут стоит учесть частоту отлупов: из-за возможности
DoS'а linux kernel 5 раз в секунду вроде бы выдаёт их, не более. так что
для udp надо ещё -m limit пристроить)
-- 
 С уважением,
 Афанасов Дмитрий

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

      parent reply	other threads:[~2005-09-12  8:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-06 10:33 Eugene Prokopiev
2005-09-06 10:43 ` Dmytro O. Redchuk
2005-09-06 12:04   ` [Comm] " Michael Shigorin
2005-09-07  5:05     ` Eugene Prokopiev
2005-09-07  5:09       ` Eugene Prokopiev
2005-09-07  5:43         ` Dmytro O. Redchuk
2005-09-07  5:46           ` Re[2]: " Alexandr A. Alexandrov
2005-09-12  8:41 ` Afanasov Dmitry [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050912084146.GA9996@nick.comp-mir.ru \
    --to=ender@comp-mir.ru \
    --cc=community@altlinux.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

ALT Linux Community general discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 community community/ http://lore.altlinux.org/community \
		mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
	public-inbox-index community

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.community


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git