Find Jobs
Hire Freelancers

Search/replace Perl or Bash script

$30-250 USD

Completed
Posted over 14 years ago

$30-250 USD

Paid on delivery
Hi All, Here is the logic that I need: I'm not a perl or bash script expert, so my syntax is not correct. We have a server that has been hacked and was injected with lines like: <iframe frameborderMODIFIED="0" onlMODIFIEDoad="if (![login to view URL]){ this.src='[login to view URL]'; this.height='0'; this.width='0';}" >mpjekrjkyxsjdivcdgobvmcrmdsqfoy</iframe> (I injected the word MODIFIED so that no harm will be caused to anyone surfing here). Running: grep -lr ":8080" * > [login to view URL] Captures the list of all the infected files. To MANUALLY clean each file I use the following [login to view URL] file: for example: ./[login to view URL] [login to view URL] server #less [login to view URL] #!/usr/bin/perl -i undef $/; $_ = <>; s/<iframe frameborder.*?iframe>//msg ; print "$_"; Now, this is doing the work for a Single file. However, I have hundreds of files that need to be sanitized, so I want to run the [login to view URL] on every file that is in the [login to view URL] I tried to run the following logic, but I'm not a good bash/perl developer, so this is where I need your assistance in creating the right loop that will run correctly: #!/usr/bin/perl -i grep -lr ":8080" * > [login to view URL] open (FILE, "<listofbadfiles.txt>") or die "Can't open file!"; while (<FILE>) { undef $/; $_ = <>; s/<iframe frameborder.*?iframe>//msg ; print "$_"; } This is a short script/project, probably a 5 minutes script. When you bid,. please make sure you know Perl and Bash scripting. I want to be able to run: ./[login to view URL] and have the script grep recursivly all the files in the directory and below, and then process them accordingly. Very simple,. very short. Good luck and Happy bidding.
Project ID: 539247

About the project

4 proposals
Remote project
Active 15 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
Hi. I can do it. Details is in PM.
$30 USD in 1 day
5.0 (27 reviews)
4.9
4.9
4 freelancers are bidding on average $30 USD for this job
User Avatar
Hello, I've already solved that problem and I have the required script. Please see pmb for details.
$30 USD in 0 day
5.0 (5 reviews)
4.2
4.2
User Avatar
Hi. Please check PMB. Thanks
$30 USD in 1 day
5.0 (8 reviews)
4.0
4.0
User Avatar
I can do this project in 1 day I am linux webserver admin from the past 4 years and have encountered this same problem in our servers and fixed it. You can contact me on my business email
$30 USD in 1 day
0.0 (0 reviews)
0.0
0.0

About the client

Flag of UNITED STATES
New York, United States
5.0
36
Payment method verified
Member since Sep 24, 2004

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.