Welcome to MobyThreads.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in
All support for the MobyThreads Threaded phpBB MOD can now be found on welsolutions at this forum

Need to remove line of code from 1800+ files

 
   Web Hosting and Web Master Forums (Home) -> Webmaster RSS
Next:  Site needs help... take a look at this for an opp..  
Author Message
Ray E.

External


Since: May 05, 2006
Posts: 1



(Msg. 1) Posted: Fri May 05, 2006 9:02 am
Post subject: Need to remove line of code from 1800+ files
Archived from groups: alt>www>webmaster (more info?)

A gaming site that runs phpnuke got hacked. They were not up to patch
on some of the modules.

The hack inserted one line of code that opens an iframe linking to a
pay-per-view ad service. The hacker gets $.05 for every page view.

Anyway, the line was added to the bottom of every index.html and
index.php file in every directory on the server. There are over 1800
directories affected.

Does anybody know where I can get a script that will browse every
directory and remove every line of offending code? They do have ssh
access to the server.

Thanks,

-Ray

 >> Stay informed about: Need to remove line of code from 1800+ files 
Back to top
Login to vote
trevor

External


Since: Feb 17, 2006
Posts: 97



(Msg. 2) Posted: Fri May 05, 2006 1:28 pm
Post subject: Re: Need to remove line of code from 1800+ files [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Ray E. wrote:

(snip)

hi Ray. here's another approach: write a script that bangs the iframe 1000x
per minute. let the hacker get overpaid, let the client suffer, let the
client fire the hacker. then do your cleanup.

it's fighting dirty but then as they sow, so shall they reap.

 >> Stay informed about: Need to remove line of code from 1800+ files 
Back to top
Login to vote
noxwebmasterx4

External


Since: Sep 21, 2004
Posts: 170



(Msg. 3) Posted: Fri May 05, 2006 3:24 pm
Post subject: Re: Need to remove line of code from 1800+ files [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Ray E. wrote:
> A gaming site that runs phpnuke got hacked. They were not up to patch
> on some of the modules.
>
> The hack inserted one line of code that opens an iframe linking to a
> pay-per-view ad service. The hacker gets $.05 for every page view.
>
> Anyway, the line was added to the bottom of every index.html and
> index.php file in every directory on the server. There are over 1800
> directories affected.
>
> Does anybody know where I can get a script that will browse every
> directory and remove every line of offending code? They do have ssh
> access to the server.

Something like this Perl one-liner
perl -pi.bak -e "s/<htm.*neof.*tml>//g;" someinputfile

....for one file. I leave it to you to write a little
bash script to iterate this over the files. Or seek
info on Perl regular expressions if the one here
doesn't do exactly what you want.

Or, you could write a perl script using the File::Find module
to iterate over the files in the tree. A perfect way to learn
a tiny bit of Perl and regular expressions.
 >> Stay informed about: Need to remove line of code from 1800+ files 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
How to remove the white Flash border in Opera? - Please see http://touristguides.com.my . Under IE6 and NS7 everything looks fine. But in Opera 6.02, there is a white vertical line somewhere near the middle of the image - separating the Flash animation at the left and the static image on the right. Ho...

very simple one line cms? - hi all i need to have a page on a clients site that has a competition question that changes weekly. they need to be able to change the question through some kind of admin page (i was going to make a separate page that was password protected for this..

on-line games - I've taken over a fairly large, but boring alumni association web site. I'd like to install some on-line games the alums can play (either on their own or against one another) while visiting the site. Any suggestions? TIA Doug..

60 characters per line - Hey, I have a question. I have several articles in which I am thinking about submitting to a few ezines. Most ezines stipulate that they would like submitted articles to be 60 characters per line. This is ok. However, when I bring up my articles in..

How to center a line - Hi Group, With this second post, I guess I should add that I have completed the first of thousands of web pages I no doubt will be making. I am using example pages from those posting in here and of course the www. I am definitely not posting in here as...
   Web Hosting and Web Master Forums (Home) -> Webmaster All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]