Codeigniter Code Injected in Index.php - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: Codeigniter Code Injected in Index.php (/showthread.php?tid=66074) |
Codeigniter Code Injected in Index.php - umeshchakor30 - 09-01-2016 I have a Code: codeigniter Code: index.php Some code is added automatically every time on the top of the index.php page and my site is redirect on third party url whenever i click anywhere The injected code as follows : Code: error_reporting(0); RE: Codeigniter Code Injected in Index.php - Diederik - 09-02-2016 Most likely your project (either some functionality you created inside codeigniter or some plugin) allows a user to upload a malicious php file to some writeable location inside your document root. Think in the lines of uploading an image without a file extention check, or a script that caches/rips images or other files from oither domains and places it on your server, an outdated wysywig editor with broken upload capabilities etc. That uploaded script (example yourdomain.com/tmp/badscript.php) gets called externally and injects the malicious code into your index.php. To trace where your badscript is located you could check your access logs for any strange requests, or download all the files localy and try to search within the files for a string like "include_once(sys_get_temp_dir()". After that you can figure out how badscript.php got uploaded in the first place and fix the issue. A quick "solution" would be to disable executing php files all together except for index.php, edit your .htaccess: Code: Order Deny,Allow Your security issue wont be fixed but it will stop the malicious script from getting called and infecting your index.php again. It should give you some time to properly fix the issue itself. RE: Codeigniter Code Injected in Index.php - InsiteFX - 09-02-2016 Also make sure that your index.php file is set to chmod 0644 this only give the owner of the file write access. |