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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T20:38:54+00:00 2026-05-29T20:38:54+00:00

My web server got hacked (Despite the security team telling me nothing was compromised)

  • 0

My web server got hacked (Despite the security team telling me nothing was compromised) and an uncountable number of files have an extra line of PHP code generating a link to some Vietnamese website.

Given there are tens of thousands of files across my server, is there a way I can go in with SSH and remove that line of code from every file it’s found in?

Please be specific in your answer, I have only used SSH a few times for some very basic tasks and don’t want to end up deleting a bunch of my files!

  • 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-29T20:38:55+00:00Added an answer on May 29, 2026 at 8:38 pm

    Yes, a few lines of shell script would do it. I hesitate to give it to you, though, as if something goes wrong I’ll get blamed for messing up your web server. That said, the solution could be as simple as this:

    for i in `find /where/ever -name '*.php'`; do
        mv $i $i.bak
        grep -v "http://vietnamese.web.site" $i.bak >> $i
    done
    

    This finds all the *php files under /where/ever, and removes any lines that have http://vietnamese.web.site in them. It makes a *.bak copy of every file. After you run this and all seems good, you could delete the backups with

    find . -name '*.php.bak' -exec rm \{\} \;
    

    Your next task would be to find a new provider, as not only did they get hacked, but they apparently don’t keep backups. Good luck.

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

Sidebar

Related Questions

We've got a Python-based web server that unpickles a number of large data files
We've got a web server which has been running a number of separate applications
I have a got a file server and a web server. They are running
I have my 1and1 hosted web site. I've got server-side php I need to
I've got a web server that sends email (from IIS 5.1) to clients throughout
I've got an apache web server, and when a certain user accesses a certain
I've got a project where I'm using Twisted for my web server. When exceptions
I've got a java server (not web based, more like a big, many-threaded standalone
We've got a web system running SQL Server 2005 for the back end, and
I'm doing a OpenSSL project and I'm completely new to web server. I've got

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.