Why are there mulitple ports open and listening?

Need help? Post your questions here.

Moderator: moderators

Why are there mulitple ports open and listening?

Postby ericvonnine » Thu Mar 12, 2015 2:40 pm

I run my subsonic instance behind an apache proxy to handle everything over https. So (I think) I have configured subsonic to only listen on the loopback interface. netstat confirms that, indeed it is listening there:
Code: Select all
tcp6       0      0 :::9412                 :::*                    LISTEN      11059/java     
tcp6       0      0 127.0.0.1:4040          :::*                    LISTEN      11059/java     
tcp6       0      0 X.X.X.X:54763           :::*                    LISTEN      11059/java
tcp6       0      0 :::60399                :::*                    LISTEN      11059/java


Where X.X.X.X is my external IP address.

That is a whole pile of open ports when it _should_ be listening to 127.0.0.1:4040 only. Why are these extra TCP ports open?
ericvonnine
 
Posts: 16
Joined: Wed Jan 28, 2015 5:59 pm

Re: Why are there mulitple ports open and listening?

Postby ericvonnine » Thu Mar 19, 2015 3:02 pm

Is this the wrong place to ask this question? Do any of the devs read this forum?
ericvonnine
 
Posts: 16
Joined: Wed Jan 28, 2015 5:59 pm

Re: Why are there mulitple ports open and listening?

Postby acroyear » Sun Mar 29, 2015 9:42 pm

Something like this was mentioned in the API users group.

This is normal for Java based web servers like Jetty and Tomcat (and JBoss and other J2EE servers). They keep ports open for internal communications. It is not necessary to open them up to anybody outside your firewall, and generally they restrict any attempt to connect from a different machine unless the administrator has specifically configured them for site mirroring in a production cloud environment.

tl;dr? don't worry about it. It's a Java thing. :)

Joe
--
Joe Shelby
http://subfiresuite.com/
http://subfireplayer.net/
User avatar
acroyear
 
Posts: 779
Joined: Wed Mar 27, 2013 8:05 pm
Location: Northern, VA

Re: Why are there mulitple ports open and listening?

Postby ericvonnine » Thu Apr 02, 2015 2:21 pm

Thanks for the reply.

It is pretty spooky that Java would be listening without being told to do so. If it were localhost only, I would be fine, but this is attempting to listen to the outside world.
ericvonnine
 
Posts: 16
Joined: Wed Jan 28, 2015 5:59 pm

Re: Why are there mulitple ports open and listening?

Postby acroyear » Thu Apr 02, 2015 7:55 pm

it is actually necessary because of the nature of sockets and IPs. if the internal tried to connect to 'localhost' but something about the network library at the OS level made it come from the machine's IP (192.168.x.y), then the connect would fail. That isn't something that can be as tightly controlled as Java would like.

That said, "outside world" is relative. don't open those ports on your firewall and only your LAN can see them. don't open those ports on your machine's personal firewall, and only your box can see them. if you don't trust yourself, who can you trust?

In addition, the protocol they are expected is extremely tight, white-list driven, and generally binary. it isn't easy to spoof. I've known of no vulnerabilities that took advantage of those ports in at last 12 years.
--
Joe Shelby
http://subfiresuite.com/
http://subfireplayer.net/
User avatar
acroyear
 
Posts: 779
Joined: Wed Mar 27, 2013 8:05 pm
Location: Northern, VA


Return to Help

Who is online

Users browsing this forum: No registered users and 10 guests