Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8614707
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T05:11:06+00:00 2026-06-12T05:11:06+00:00

It seems like some malicious script have found it’s way onto the server where

  • 0

It seems like some malicious script have found it’s way onto the server where I hold my webpages. I have several accounts and they are all “infected” (not sure if this is the right word).

Anyway. All index.php files have been prepended with the following code:

<marquee style="position: absolute; width: 0px;">
<a href="http://istanbulescort-ilan.com/" title="escort bayan">escort bayan</a>
<a href="http://istanbulescort-ilan.com/" title="bayan escort">bayan escort</a>
<a href="http://ankaraescortlari.org/" title="ankara escort">ankara escort</a>
<a href="http://ankaraescortlari.org/" title="ankara escort bayan">ankara escort bayan</a>
<a href="http://ankaraescortlari.org/" title="escort ankara">escort ankara</a>
...
<a href="http://hurhaberci.com" title="son haberler">son haberler</a>
</marquee>

This code messes up headers and web pages don’t render well. Not to mention I have some escort services links on all of my webpages.

I’ve found this script, but I’m not sure how to correctly modify it to remove all of the above code from all index.php files on each of accounts on the server. I don’t want to run it and then find out I have to restore hudge backup.

for i in /directory/*.java
do
   # echo 'Working on $i file'
   copy $i tempfil.txt
   sed   -e '/\} catch/,/^\}/d' tempfil.txt > $i
done

[EDIT]

Ok, so I managed to scrape this together. Can someone please just confirm it will work or give any suggestions about what should be changed?

read -d '' hacked <<"EOF"
<marquee style="position: absolute; width: 0px;">
<a href="http://istanbulescort-ilan.com/" title="escort bayan">escort bayan</a>
...
<a href="http://gidasayfasi.com" title="gida">gida</a></marquee>
EOF
find -name \*.php | xargs replace ${hacked} ""  --
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T05:11:07+00:00Added an answer on June 12, 2026 at 5:11 am

    To delete prepended text (assuming there is not something useful inside the prepended text):

    sed '/<marquee/,/marquee>/ d' index.php
    

    /EXP1/, /EXP2/ d means that sed matches lines between expression EXP1 and expression EXP2, then apply action ‘d’ (which is ‘delete’).

    Hope this helps.

    —- edit according to the comment below —
    —- there may be correct code inside the malicious one —-
    You can imagine to copy/paste the portion of text to delete in a text file name ‘tobedeleted.txt’. Then write the following script process.sh (where $1 is the file to clean up)

    #/bin/bash
    diff --suppress-common-lines $1 tobedeleted.txt | grep -e '^<' | sed 's/^< //'
    

    the diff command above show you only the difference between the reference malicious code and the content of file $1. The difference is computed line by line and shows a markup character ‘< ‘ before the line (see man diff).
    Please try this command first.

    You can call the script (do a chmod u+x process.sh first to make it executable) and redirect the result into another script, for example:

    process.sh index.php > new_index.php
    

    So, to correct a large number of files, do a script like:

    #/bin/bash
    find . -name "*.php" | while read pathfile
    do
       file=${pathfile##*/} # remove the path from the fullpath to the file
       pathonly=${pathfile%/*} # keep only the path
       cp $pathfile ${pathonly}/${file}.org # copy original file to save it, in case of...
       process.sh  ${pathonly}/${file}.org > ${pathfile} # apply correction
    done
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

It seems like some tables are inheriting styles that they shouldn't. I have a
Seems like i need some help with a project. I have a routine ,
I'm having some trouble with a SQL Server 2005 database that seems like it's
Seems like some Android devices have Share option. Which is available when user go
I am learning WPF and it seems like some properties like Content are of
It seems like nutch indexes only (some) parse results. It runs the indexing filters
This really seems like a bug to me, but perhaps some databinding gurus can
In asking around and doing some research, it seems like many people are really
Sometimes it seems like some architectural techniques are not for the Web application I
I apologize because this seems like such a simple thing. What's the correct way

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.