You can do this way :
Block every ports and open one by one
example
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -A INPUT --source xx.xx.xx.xx -p tcp --dport 21 -j ACCEPT
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A OUTPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
so this rules
iptables -A INPUT --source xx.xx.xx.xx -p tcp --dport 21 -j ACCEPT
will only allow from xx.xx.xx.xx ip, and will block everything
You can use
netstat -an or lsof -i:TCP
lsof-i:UDP
to see what tcp or udp ports are listenning.
also you can use some external website to check which ports are open in your server
Main Topics
Browse All Topics





by: remoteuserPosted on 2009-07-22 at 20:52:32ID: 24921673
One more thing I forgot to add I want to penetration test to my server and new for this, except nmap what toll use to generate security report.. Is it possible to get some sample pen test report
Thanks