How to close nc port in Debian 9?
up vote
0
down vote
favorite
I am struggling to close these ports which seem to be backdoors -- or at least I have never opened and used them. How can I close or shutdown nc and close these ports?
netstat -lntup | grep nc
ps-ef
linux services netstat port
New contributor
|
show 2 more comments
up vote
0
down vote
favorite
I am struggling to close these ports which seem to be backdoors -- or at least I have never opened and used them. How can I close or shutdown nc and close these ports?
netstat -lntup | grep nc
ps-ef
linux services netstat port
New contributor
You may able to use the PPID of thenc
processes to identify where the processes are coming from. Perhaps a runaway script?
– Haxiel
Nov 23 at 11:28
thanks, I am new linux OS, should I check process id?
– ARH
Nov 23 at 11:35
Yes, you can runps -ef|grep nc
and add the output to the question.
– Haxiel
Nov 23 at 11:38
Thanks @Haxiel, I haved added the output for ps
– ARH
Nov 23 at 12:09
I can see the update, but please don't post images of text. The third column in that output is the parent PID of a process. You can examine parent process usingps -p PID
. For example, the first nc process (925) has process 922 as its parent, which again has 921 as its parent. Keep tracing the process parent and see if you can get any useful information.
– Haxiel
Nov 23 at 12:35
|
show 2 more comments
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I am struggling to close these ports which seem to be backdoors -- or at least I have never opened and used them. How can I close or shutdown nc and close these ports?
netstat -lntup | grep nc
ps-ef
linux services netstat port
New contributor
I am struggling to close these ports which seem to be backdoors -- or at least I have never opened and used them. How can I close or shutdown nc and close these ports?
netstat -lntup | grep nc
ps-ef
linux services netstat port
linux services netstat port
New contributor
New contributor
edited Nov 25 at 15:28
Jeff Schaller
36.9k1052121
36.9k1052121
New contributor
asked Nov 23 at 10:27
ARH
1092
1092
New contributor
New contributor
You may able to use the PPID of thenc
processes to identify where the processes are coming from. Perhaps a runaway script?
– Haxiel
Nov 23 at 11:28
thanks, I am new linux OS, should I check process id?
– ARH
Nov 23 at 11:35
Yes, you can runps -ef|grep nc
and add the output to the question.
– Haxiel
Nov 23 at 11:38
Thanks @Haxiel, I haved added the output for ps
– ARH
Nov 23 at 12:09
I can see the update, but please don't post images of text. The third column in that output is the parent PID of a process. You can examine parent process usingps -p PID
. For example, the first nc process (925) has process 922 as its parent, which again has 921 as its parent. Keep tracing the process parent and see if you can get any useful information.
– Haxiel
Nov 23 at 12:35
|
show 2 more comments
You may able to use the PPID of thenc
processes to identify where the processes are coming from. Perhaps a runaway script?
– Haxiel
Nov 23 at 11:28
thanks, I am new linux OS, should I check process id?
– ARH
Nov 23 at 11:35
Yes, you can runps -ef|grep nc
and add the output to the question.
– Haxiel
Nov 23 at 11:38
Thanks @Haxiel, I haved added the output for ps
– ARH
Nov 23 at 12:09
I can see the update, but please don't post images of text. The third column in that output is the parent PID of a process. You can examine parent process usingps -p PID
. For example, the first nc process (925) has process 922 as its parent, which again has 921 as its parent. Keep tracing the process parent and see if you can get any useful information.
– Haxiel
Nov 23 at 12:35
You may able to use the PPID of the
nc
processes to identify where the processes are coming from. Perhaps a runaway script?– Haxiel
Nov 23 at 11:28
You may able to use the PPID of the
nc
processes to identify where the processes are coming from. Perhaps a runaway script?– Haxiel
Nov 23 at 11:28
thanks, I am new linux OS, should I check process id?
– ARH
Nov 23 at 11:35
thanks, I am new linux OS, should I check process id?
– ARH
Nov 23 at 11:35
Yes, you can run
ps -ef|grep nc
and add the output to the question.– Haxiel
Nov 23 at 11:38
Yes, you can run
ps -ef|grep nc
and add the output to the question.– Haxiel
Nov 23 at 11:38
Thanks @Haxiel, I haved added the output for ps
– ARH
Nov 23 at 12:09
Thanks @Haxiel, I haved added the output for ps
– ARH
Nov 23 at 12:09
I can see the update, but please don't post images of text. The third column in that output is the parent PID of a process. You can examine parent process using
ps -p PID
. For example, the first nc process (925) has process 922 as its parent, which again has 921 as its parent. Keep tracing the process parent and see if you can get any useful information.– Haxiel
Nov 23 at 12:35
I can see the update, but please don't post images of text. The third column in that output is the parent PID of a process. You can examine parent process using
ps -p PID
. For example, the first nc process (925) has process 922 as its parent, which again has 921 as its parent. Keep tracing the process parent and see if you can get any useful information.– Haxiel
Nov 23 at 12:35
|
show 2 more comments
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
After further investigation through chat, the problem was identified with a specific crontab on OP's system. This was identified using the parent PID of the nc
process, which showed the following connection:
nc -l -p 45454 -e /usr/sbin/link
-> /bin/sh -c nc -l -p 45454 -e /usr/sbin/link
-> /usr/sbin/CRON -f
The user account associated with the nc
process was named 'link', and had a crontab associated with it. This crontab contained a cron job with the same nc
command, scheduled to be run every minute. Since the nc
command had been specified to listen indefinitely, new nc
processes were being created every minute.
The issue was resolved by commenting out the specific entry in the crontab file.
1
That chain of processes has some suspicious properties:/usr/sbin/link
is not a standard command, although the name closely resembles the standard/usr/bin/link
, which would be nonsensical to call fromnc
like that. Likewise,/usr/sbin/CRON
in all-caps is different from the standard/usr/sbin/cron
. You should see if/usr/sbin/link
and/or/usr/sbin/CRON
actually exist, and get them analyzed if they do exist; you may find that they are parts of an intruder's toolkit. There might be an innocent explanation too, but it is possible that someone has (clumsily) hacked this system.
– telcoM
Nov 25 at 12:36
@telcoM Thanks for the useful info. I'll point OP to your comment from chat.
– Haxiel
Nov 25 at 13:13
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
After further investigation through chat, the problem was identified with a specific crontab on OP's system. This was identified using the parent PID of the nc
process, which showed the following connection:
nc -l -p 45454 -e /usr/sbin/link
-> /bin/sh -c nc -l -p 45454 -e /usr/sbin/link
-> /usr/sbin/CRON -f
The user account associated with the nc
process was named 'link', and had a crontab associated with it. This crontab contained a cron job with the same nc
command, scheduled to be run every minute. Since the nc
command had been specified to listen indefinitely, new nc
processes were being created every minute.
The issue was resolved by commenting out the specific entry in the crontab file.
1
That chain of processes has some suspicious properties:/usr/sbin/link
is not a standard command, although the name closely resembles the standard/usr/bin/link
, which would be nonsensical to call fromnc
like that. Likewise,/usr/sbin/CRON
in all-caps is different from the standard/usr/sbin/cron
. You should see if/usr/sbin/link
and/or/usr/sbin/CRON
actually exist, and get them analyzed if they do exist; you may find that they are parts of an intruder's toolkit. There might be an innocent explanation too, but it is possible that someone has (clumsily) hacked this system.
– telcoM
Nov 25 at 12:36
@telcoM Thanks for the useful info. I'll point OP to your comment from chat.
– Haxiel
Nov 25 at 13:13
add a comment |
up vote
1
down vote
accepted
After further investigation through chat, the problem was identified with a specific crontab on OP's system. This was identified using the parent PID of the nc
process, which showed the following connection:
nc -l -p 45454 -e /usr/sbin/link
-> /bin/sh -c nc -l -p 45454 -e /usr/sbin/link
-> /usr/sbin/CRON -f
The user account associated with the nc
process was named 'link', and had a crontab associated with it. This crontab contained a cron job with the same nc
command, scheduled to be run every minute. Since the nc
command had been specified to listen indefinitely, new nc
processes were being created every minute.
The issue was resolved by commenting out the specific entry in the crontab file.
1
That chain of processes has some suspicious properties:/usr/sbin/link
is not a standard command, although the name closely resembles the standard/usr/bin/link
, which would be nonsensical to call fromnc
like that. Likewise,/usr/sbin/CRON
in all-caps is different from the standard/usr/sbin/cron
. You should see if/usr/sbin/link
and/or/usr/sbin/CRON
actually exist, and get them analyzed if they do exist; you may find that they are parts of an intruder's toolkit. There might be an innocent explanation too, but it is possible that someone has (clumsily) hacked this system.
– telcoM
Nov 25 at 12:36
@telcoM Thanks for the useful info. I'll point OP to your comment from chat.
– Haxiel
Nov 25 at 13:13
add a comment |
up vote
1
down vote
accepted
up vote
1
down vote
accepted
After further investigation through chat, the problem was identified with a specific crontab on OP's system. This was identified using the parent PID of the nc
process, which showed the following connection:
nc -l -p 45454 -e /usr/sbin/link
-> /bin/sh -c nc -l -p 45454 -e /usr/sbin/link
-> /usr/sbin/CRON -f
The user account associated with the nc
process was named 'link', and had a crontab associated with it. This crontab contained a cron job with the same nc
command, scheduled to be run every minute. Since the nc
command had been specified to listen indefinitely, new nc
processes were being created every minute.
The issue was resolved by commenting out the specific entry in the crontab file.
After further investigation through chat, the problem was identified with a specific crontab on OP's system. This was identified using the parent PID of the nc
process, which showed the following connection:
nc -l -p 45454 -e /usr/sbin/link
-> /bin/sh -c nc -l -p 45454 -e /usr/sbin/link
-> /usr/sbin/CRON -f
The user account associated with the nc
process was named 'link', and had a crontab associated with it. This crontab contained a cron job with the same nc
command, scheduled to be run every minute. Since the nc
command had been specified to listen indefinitely, new nc
processes were being created every minute.
The issue was resolved by commenting out the specific entry in the crontab file.
answered Nov 25 at 11:23
Haxiel
51139
51139
1
That chain of processes has some suspicious properties:/usr/sbin/link
is not a standard command, although the name closely resembles the standard/usr/bin/link
, which would be nonsensical to call fromnc
like that. Likewise,/usr/sbin/CRON
in all-caps is different from the standard/usr/sbin/cron
. You should see if/usr/sbin/link
and/or/usr/sbin/CRON
actually exist, and get them analyzed if they do exist; you may find that they are parts of an intruder's toolkit. There might be an innocent explanation too, but it is possible that someone has (clumsily) hacked this system.
– telcoM
Nov 25 at 12:36
@telcoM Thanks for the useful info. I'll point OP to your comment from chat.
– Haxiel
Nov 25 at 13:13
add a comment |
1
That chain of processes has some suspicious properties:/usr/sbin/link
is not a standard command, although the name closely resembles the standard/usr/bin/link
, which would be nonsensical to call fromnc
like that. Likewise,/usr/sbin/CRON
in all-caps is different from the standard/usr/sbin/cron
. You should see if/usr/sbin/link
and/or/usr/sbin/CRON
actually exist, and get them analyzed if they do exist; you may find that they are parts of an intruder's toolkit. There might be an innocent explanation too, but it is possible that someone has (clumsily) hacked this system.
– telcoM
Nov 25 at 12:36
@telcoM Thanks for the useful info. I'll point OP to your comment from chat.
– Haxiel
Nov 25 at 13:13
1
1
That chain of processes has some suspicious properties:
/usr/sbin/link
is not a standard command, although the name closely resembles the standard /usr/bin/link
, which would be nonsensical to call from nc
like that. Likewise, /usr/sbin/CRON
in all-caps is different from the standard /usr/sbin/cron
. You should see if /usr/sbin/link
and/or /usr/sbin/CRON
actually exist, and get them analyzed if they do exist; you may find that they are parts of an intruder's toolkit. There might be an innocent explanation too, but it is possible that someone has (clumsily) hacked this system.– telcoM
Nov 25 at 12:36
That chain of processes has some suspicious properties:
/usr/sbin/link
is not a standard command, although the name closely resembles the standard /usr/bin/link
, which would be nonsensical to call from nc
like that. Likewise, /usr/sbin/CRON
in all-caps is different from the standard /usr/sbin/cron
. You should see if /usr/sbin/link
and/or /usr/sbin/CRON
actually exist, and get them analyzed if they do exist; you may find that they are parts of an intruder's toolkit. There might be an innocent explanation too, but it is possible that someone has (clumsily) hacked this system.– telcoM
Nov 25 at 12:36
@telcoM Thanks for the useful info. I'll point OP to your comment from chat.
– Haxiel
Nov 25 at 13:13
@telcoM Thanks for the useful info. I'll point OP to your comment from chat.
– Haxiel
Nov 25 at 13:13
add a comment |
ARH is a new contributor. Be nice, and check out our Code of Conduct.
ARH is a new contributor. Be nice, and check out our Code of Conduct.
ARH is a new contributor. Be nice, and check out our Code of Conduct.
ARH is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f483646%2fhow-to-close-nc-port-in-debian-9%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
You may able to use the PPID of the
nc
processes to identify where the processes are coming from. Perhaps a runaway script?– Haxiel
Nov 23 at 11:28
thanks, I am new linux OS, should I check process id?
– ARH
Nov 23 at 11:35
Yes, you can run
ps -ef|grep nc
and add the output to the question.– Haxiel
Nov 23 at 11:38
Thanks @Haxiel, I haved added the output for ps
– ARH
Nov 23 at 12:09
I can see the update, but please don't post images of text. The third column in that output is the parent PID of a process. You can examine parent process using
ps -p PID
. For example, the first nc process (925) has process 922 as its parent, which again has 921 as its parent. Keep tracing the process parent and see if you can get any useful information.– Haxiel
Nov 23 at 12:35