LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 02-26-2020, 07:42 AM   #1
vincix
Senior Member
 
Registered: Feb 2011
Distribution: Ubuntu, Centos
Posts: 1,240

Rep: Reputation: 103Reputation: 103
cannot identify process associated with open port


Hi,

I'm trying to understand why a port is kept open on my linux server, but I cannot associate it with any process whatsoever, so I'm not really sure what is running there.
netstat -tulpn shows:
Code:
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:1167            0.0.0.0:*               LISTEN      990/cdp
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      668/rpcbind
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      890/sshd
tcp        0      0 0.0.0.0:5432            0.0.0.0:*               LISTEN      11824/postgres
tcp        0      0 127.0.0.1:5433          0.0.0.0:*               LISTEN      11823/postgres
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      1182/master
tcp        0      0 0.0.0.0:33855           0.0.0.0:*               LISTEN      -
tcp        0      0 0.0.0.0:10050           0.0.0.0:*               LISTEN      9210/zabbix_agentd
tcp6       0      0 :::111                  :::*                    LISTEN      668/rpcbind
tcp6       0      0 :::5432                 :::*                    LISTEN      11824/postgres
tcp6       0      0 :::33114                :::*                    LISTEN      -
tcp6       0      0 :::10050                :::*                    LISTEN      9210/zabbix_agentd
udp        0      0 0.0.0.0:111             0.0.0.0:*                           668/rpcbind
udp        0      0 0.0.0.0:844             0.0.0.0:*                           668/rpcbind
udp6       0      0 :::111                  :::*                                668/rpcbind
udp6       0      0 :::844                  :::*                                668/rpcbind
I'm referring to 33855 and 33114.
Neither lsof or ss showed my anything.
Any ideas how I can trace that back to a process?

Thanks.
 
Old 02-26-2020, 08:06 AM   #2
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,306
Blog Entries: 3

Rep: Reputation: 3720Reputation: 3720Reputation: 3720Reputation: 3720Reputation: 3720Reputation: 3720Reputation: 3720Reputation: 3720Reputation: 3720Reputation: 3720Reputation: 3720
You'll need to run netstat as root to get the process information.
 
Old 02-26-2020, 08:12 AM   #3
vincix
Senior Member
 
Registered: Feb 2011
Distribution: Ubuntu, Centos
Posts: 1,240

Original Poster
Rep: Reputation: 103Reputation: 103
Hi,

That's not the issue. Everything is run as root. Otherwise I wouldn't have seen most (if any) of the processes that are already displayed by netstat.
Telnetting to 33855 does work, but I'm not sure what it expects.
 
Old 02-26-2020, 08:27 AM   #4
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,306
Blog Entries: 3

Rep: Reputation: 3720Reputation: 3720Reputation: 3720Reputation: 3720Reputation: 3720Reputation: 3720Reputation: 3720Reputation: 3720Reputation: 3720Reputation: 3720Reputation: 3720
Does lsof show the PID of the process at least? Then you could try looking using ps

Code:
ps -p xxxxx -o pid,ppid,user,args
 
Old 02-26-2020, 08:32 AM   #5
vincix
Senior Member
 
Registered: Feb 2011
Distribution: Ubuntu, Centos
Posts: 1,240

Original Poster
Rep: Reputation: 103Reputation: 103
PID of the process would probably have been all I wanted, but lsof doesn't show anything at all related to these two ports. Only ss and netstat do.
I should also mention that this is also the behaviour of docker swarm when you initiate it. No related process is being shown, but I know the port pops up in netstat/ss. In that case, of course, it's easy to trace it back to swarm, because it's a known port.

Last edited by vincix; 02-26-2020 at 08:33 AM.
 
Old 02-26-2020, 08:32 AM   #6
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,137
Blog Entries: 6

Rep: Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826
How about:
Code:
ss -plten

sudo lsof -ni :33855

sudo ss -tanp

sudo netstat -nlp | grep 33855

sudo fuser -vn tcp 33855
 
1 members found this post helpful.
Old 02-26-2020, 08:55 AM   #7
vincix
Senior Member
 
Registered: Feb 2011
Distribution: Ubuntu, Centos
Posts: 1,240

Original Poster
Rep: Reputation: 103Reputation: 103
Code:
ss -plten | grep 33855
LISTEN     0      64           *:33855                    *:*                   ino:14772 sk:73 <->

lsof -ni :33855 * lists nothing.
Code:
ss -tanp | grep 3385
LISTEN     0      64           *:33855                    *:*
Code:
netstat -nlp | grep 33855
tcp        0      0 0.0.0.0:33855           0.0.0.0:*               LISTEN      -
fuser -vn tcp 33855 * this also shows nothin.
 
Old 02-26-2020, 09:06 AM   #8
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,137
Blog Entries: 6

Rep: Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826
https://unix.stackexchange.com/quest...ich-has-no-pid
 
1 members found this post helpful.
Old 02-26-2020, 09:27 AM   #9
vincix
Senior Member
 
Registered: Feb 2011
Distribution: Ubuntu, Centos
Posts: 1,240

Original Poster
Rep: Reputation: 103Reputation: 103
This is what I've got based on the link you've shared.
find -inum 14772

Quote:
ls -li /usr/share/man/man2/ustat.2.gz
14772 -rw-r--r-- 1 root root 1800 Feb 15 2016 /usr/share/man/man2/ustat.2.gz
Quote:
root@prod-postgresql:~# ls -li /sys/devices/virtual/tty/tty58/dev
14772 -r--r--r-- 1 root root 4096 Feb 26 16:10 /sys/devices/virtual/tty/tty58/dev
I'm also a little bit suspscious of the fact that something has opened a sort of running service there and it's listening to. Now I'm thinking of some kind of malware, I'm not sure.
 
Old 02-26-2020, 10:28 AM   #10
vincix
Senior Member
 
Registered: Feb 2011
Distribution: Ubuntu, Centos
Posts: 1,240

Original Poster
Rep: Reputation: 103Reputation: 103
If I connect through telnet to the port, I get this:
Code:
Feb 26 16:39:01 vm1010798 kernel: [8494225.482696] RPC: fragment too large: 218762506
Feb 26 16:39:05 vm1010798 kernel: [8494229.126107] RPC: fragment too large: 218762506
Feb 26 16:39:10 vm1010798 kernel: [8494234.076411] RPC: fragment too large: 218762506
Feb 26 16:39:16 vm1010798 kernel: [8494240.059684] RPC: fragment too large: 1634929930
So it's seems to be related to the NFS client installed on the server. I'm not sure why it's listening on that port, but never mind. It's quite clear, I guess.
 
Old 02-26-2020, 01:37 PM   #11
rnturn
Senior Member
 
Registered: Jan 2003
Location: Illinois (SW Chicago 'burbs)
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,800

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
Quote:
Originally Posted by teckk View Post
Yes. I get one of these records from "netstat -anp" and it's related to running the nfs-server service. "nmap" sees it and stopping the service makes the port use go away. Not sure about the other one I'm seeing but nmap's not seeing. I'm assuming it's something similar at play so my hair's not on fire.

This is the sort of thing that would have driven the security compliance team I worked with some years ago right up the wall. (The electrical power generation industry gets a little testy about port use they cannot attribute to software that should be running on systems.)
 
  


Reply

Tags
network, sockets



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Identify PCI and USB Wired and Wireless Driver in Linux – Identify PCI Driver. Ubuntu, Debian, LXer Syndicated Linux News 0 08-20-2014 07:21 AM
Identify client process initiating TCP connection port 113 esquivalient Linux - Networking 2 12-27-2010 09:38 AM
how to identify the status of serial port ("Port Already Opened") from a C program rajmohan_tricom Linux - Software 3 02-07-2010 10:27 PM
How to read "identify" button press event, or state of "identify" blue led with IPMI? iav Linux - Server 0 01-27-2009 01:13 PM
Howto identify the file associated with an unreadable disk sector of vfat fs yafrank Linux - General 6 01-08-2009 11:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 01:59 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration