- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Turning off ports 80, 443 and 137-139
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-22-2005 08:52 AM
тАО11-22-2005 08:52 AM
Turning off ports 80, 443 and 137-139
80 (http)
443 (shttp)
137,138,139 (NetBios)
This is on HP-UX 11iv2. How do I do that, is it enough to edit /etc/services and comment them out or is something else involved?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-22-2005 10:03 AM
тАО11-22-2005 10:03 AM
Re: Turning off ports 80, 443 and 137-139
/etc/services is like a reservation file. Merely removing the entries is a good start but it doesn't protect your system. Oracle operates on port 1521 and others with no entry at all in the /etc/services file.
Bill Hassell has a great explanation of what /etc/services really is. I'm telling you though that changing it does not protect your system.
I firewall can protect your system blocking the ports above. IPfileter is an example of that.
In general people don't use IPFILTER, they use a third party firewall product or block the traffic on a router.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-22-2005 10:22 AM
тАО11-22-2005 10:22 AM
Re: Turning off ports 80, 443 and 137-139
So in a nutshell you are saying that there is nothing I can do on the system to disable these ports and that it is a firewall issue?
I realize that ports 137-139 are NetBios and it can activate them without the /etc/services file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-22-2005 10:12 PM
тАО11-22-2005 10:12 PM
Re: Turning off ports 80, 443 and 137-139
I think what Steven is trying to stress is that /etc/services (which you mentioned in your original post) has little or nothing to do with the question of what service is running on a given port.
After all, a process running as root can bind any low-numbered port it wants, and serve up any service it sees fit. You can have telnetd on port 80 if you are perverse enough to want it !
Unless it has changed since 11.0, /var/adm/inetd.sec may be of more to you, as it controls what remote machines may access each service/port. You could deny all hosts to port 80 etc., or all except 127.0.0.1
As well as that, you would be well advised to simply not start any unwanted services.
netstat -a will confirm what ports have listeners on them. Finding the daemon that has opened that port to listen is less trivial, however.
Most daemons are started from scripts in /sbin/init.d/ at startup time, based on configuration settings in the parameter files in /etc/rc.config.d
If the daemon doesn't start, the port could be considered "turned off". At least it will not respond to a port scanner, which may be all you want ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-23-2005 12:43 AM
тАО11-23-2005 12:43 AM
Re: Turning off ports 80, 443 and 137-139
To drop packets - you need a firewall - ipfilter does the work nicely on HP-UX:
http://h20293.www2.hp.com/portal/swdepot/displayProductInfo.do?productNumber=B9901AA
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-23-2005 01:38 AM
тАО11-23-2005 01:38 AM
Re: Turning off ports 80, 443 and 137-139
If you don't start http services (e.g., apache) then these pports will not be in use.
To check, look at the utility 'nmap' available from the gatekeep.cs.utah.edu. Or if you have a Linux system then nmap is included with the installation disks. You may have to select it for install.
An example, scanning the ports on my localhost;
[root@myhost ~]# nmap localhost
Starting nmap 3.70 ( http://www.insecure.org/nmap/ ) at 2005-11-23 07:35 MST
Interesting ports on localhost (127.0.0.1):
(The 1650 ports scanned but not shown below are in state: closed)
PORT STATE SERVICE
22/tcp open ssh
111/tcp open rpcbind
199/tcp open smux
6000/tcp open X11
Nmap run completed -- 1 IP address (1 host up) scanned in 0.361 seconds
This can tell you what ports are open and listening
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-23-2005 02:49 AM
тАО11-23-2005 02:49 AM
Re: Turning off ports 80, 443 and 137-139
THe NetBios ports might be enabled via inetd. Have a look at the /etc/inetd.conf file and see if there are lines for NetBios there. If so, comment them out ( a # at the beginning of the line) and then run 'inetd -c' to have inetd re-read its configuration file.
Yes a firewall is an option, but the better option is to turn the ports off completely.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-23-2005 01:39 PM
тАО11-23-2005 01:39 PM
Re: Turning off ports 80, 443 and 137-139
/etc/services is a primarily documentation file. Some programs use a library call to find a particular service, but /etc/services neither enables or disables access to a network port, or more accurately, enables or disables a network daemon that would open this port. /etc/inetd.conf is where virtually all network services are enabled. If the service is not shown in that file, then the daemon is never scheduled and the port is never open.
For completeness, it should be noted that anyone can write a program to open a specific port or set of ports. File permissions and locking can keep random programs from opening ports that are typically part of kernel networking processes.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-24-2005 09:19 PM
тАО11-24-2005 09:19 PM
Re: Turning off ports 80, 443 and 137-139
The best way u can turn off the ports by executing the command iptables.
#iptables -A INPUT -P TCP --dport 80 -J REJECT
#iptables -A OUTPUT -P TCP --dport 80 -J REJECT
#iptables -A INPUT -P TCP --dport 443 -j REJECT
#iptables -A OUTPUT -P TCP --dport 443 -j REJECT
#iptables -A INPUT -P TCP --dport 137 -j REJECT
#iptables -A OUTPUT -P TCP --dport 137 -j REJECT
#iptables -A OUTPUT -P TCP --dport 137 -j REJECT
#iptables -A INPUT -P TCP --dport 138 -j REJECT
#iptables -A OUTPUT -P TCP --dport 138 -j REJECT
#iptables -A INPUT -P TCP --dport 139 -j REJECT
#iptables -A OUTPUT -P TCP --dport 139 -j REJECT
if u face any problem, check man iptables.
it should solve ur issue..
cheers
indrajit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-24-2005 09:27 PM
тАО11-24-2005 09:27 PM
Re: Turning off ports 80, 443 and 137-139
BH notes the obvious and best solution (which I should have done btw) that if no application is listening on the port, there is no need to do anything further. Turn off the web server and don't run Samba and there is nothing further to do.
If any of these answers has been helpful etc, please consider assigning points. Its how we recognize good help here.
Good Luck,
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com