-4

I opened the following ports with iptables on Debian 7:

iptables -X
iptables -F
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT ACCEPT
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -p tcp --dport 21 -j ACCEPT #FTP
iptables -A INPUT -p tcp --dport 111 -j ACCEPT #RPCBIND
iptables -A INPUT -p tcp --dport 113 -j ACCEPT #AUTH
iptables -A INPUT -p tcp --dport 139 -j ACCEPT #NETBIOS-SSH
iptables -A INPUT -p tcp --dport 443 -j ACCEPT #HTTPS
iptables -A INPUT -p tcp --dport 901 -j ACCEPT #SAMBA
iptables -A INPUT -p tcp --dport 993 -j ACCEPT #IMAP
iptables -A INPUT -p tcp --dport 8080 -j ACCEPT #TOMCAT
iptables -A INPUT -p tcp --dport 1723 -j ACCEPT #PPTP
iptables -A INPUT -p tcp --dport 10000 -j ACCEPT #WEBMIN
iptables -A INPUT -j DROP 

But when I scan for open ports on my server with "nmap" some appear as closed. Can someone help me please?

~ $ nmap 172.16.17.135

Starting Nmap 6.40 ( http://nmap.org ) at 2014-08-21 14:38 PDT
Nmap scan report for 172.16.17.135
Host is up (0.00060s latency).
Not shown: 988 filtered ports
PORT      STATE  SERVICE
21/tcp    open   ftp
22/tcp    open   ssh
80/tcp    open   http
111/tcp   open   rpcbind
113/tcp   closed ident
139/tcp   closed netbios-ssn
443/tcp   open   https
901/tcp   closed samba-swat
993/tcp   closed imaps
1723/tcp  closed pptp
8080/tcp  closed http-proxy
10000/tcp closed snet-sensor-mgmt
1
  • 1
    Do you have services running on those ports? Aug 21, 2014 at 22:41

1 Answer 1

2

user3680708,

To list services with open ports:

# netstat -tulpn

That will list the PID and Service name with TCP/UDP information. If the service/port is not listed then this might explain why the port state is "closed" in your nmap scan.

Not the answer you're looking for? Browse other questions tagged .