Firewall causes false postives in port scans?

From: Randy Lawrence (jm_at_zzzzzzzzzzzz.com)
Date: 06/09/04


Date: Wed, 09 Jun 2004 17:49:57 GMT

I ran a Nessus scan on a remote server recently and it detected port 21
as open and running an unknown (non-ftp) service.

When I ran "netstat -aln" on the server, it didn't show anything
listening on port 21.

When I activated these 2 iptables rules and rescanned, port 21 was STILL
being detected as open (yes, "venet0" is correct and it correctly blocks
all other ports without problems):

   /sbin/iptables -A INPUT -p tcp -i venet0 --dport 21 -j DROP
   /sbin/iptables -A INPUT -p udp -i venet0 --dport 21 -j DROP

When manually connecting to the remote server via FTP client, this is
the result (happens both with AND without the above iptables rules active):

   $ ftp 123.123.123.123
   Connected to 123.123.123.123.
   421 Service not available, remote server has closed connection
   ftp>

NOTE: when the 2 iptables rules listed above are active, the "421"
message appears after a much longer delay after the "Connected to" message.

The explanation the hosting company gave was that their firewall must be
accepting the FTP connection and then realizing there's no service
running on the destination host--which causes the initial connection to
be accepted and then dropped.

Does this make sense? Has anyone else seen firewalls do this?

I'm trying to find out if their firewall is ACTUALLY doing this rather
than some infected router somewhere or a trojan running on the server.



Relevant Pages

  • RE: Telnet/ftp problems SBS2000
    ... Please make sure your client computers are configured as both Firewall ... will find two options "Enable folder view for FTP sites" and "Use Passive ... that the control connection has been successfully established, ... (other than port 21) ...
    (microsoft.public.windows.server.sbs)
  • Re: IPSwitch, Inc. WS_FTP Server
    ... > bounce attack as well as PASV connection hijacking. ... > The FTP bounce vulnerability allows a remote attacker to cause the ... > anonymously along with any internal addresses that the FTP server has ... That means it's got to handle a PORT ...
    (Bugtraq)
  • RE: FTP Window of opportunity?
    ... target on the line when in reality it was just a firewall lying to them. ... The connection connects and then immediately ... Subject: FTP Window of opportunity? ... the FTP port shows up. ...
    (Pen-Test)
  • Re: Iptables FTP question
    ... think all other related would be from specific modules,the FTP and IRC ... Keep in mind that connection ... source port of 20 if it is for port mode data connections(for a standard ... I would also break down your rules into chains instead of appending such ...
    (comp.security.firewalls)
  • Re: Passive means what during FTP?
    ... :227 Entering Passive Mode ... :ftp: connect: No route to host ... The FTP data transfer uses a connection that is separate from the ... address and port number to connect to for the data transfer. ...
    (comp.os.linux.setup)