In Progress

linux script or command line to clean hacked files

I have a server what was hacked due to a breach when I was reinstalling mod-security and firewall.

All .htaccess files were filled with a spammer code injected.

In attachment you will see an example of one of the .htaccess file injected.

Note that have good lines with correct codes, these can´t be deleted. The inected lines is in the middle of the file, after a lot of blank lines.

I need a script or command line to search all .htaccess in /home/users folders and clean the injected code of each .htaccess file.

It´s important do first a backup of each .htacces file in /home/bkp_htaccess_injected folder, and preserv any other commands what is not the the injected code.

I prefer a command line.

4 actions must be taken:

1) copy the .htaccess to /home/bkp_htaccess_injected

2) The injected code starts after a lot of blank lines, with "" and ends with "". Inside this tags are many lines with different words in the middle. Just delete all text in the middle of these two tags.

3) Also have a commented line after "" with a hash number, what I want to be deleted too.

4) Finally, delete "" tags and blank lines.

Access to the server is impossible, only us. You can use the attachment to produce the command and send to me, I will use in my server. If the code not work i will call back to you to repair the command and try again until code works.

I use CENTOS 6.3 x86_64

Fast job please.

Cheap and fast will get the work.

Regards.

Skills: Apache, Linux, Perl, System Admin, UNIX

See more: what job can i get with a linux, clean home, cheap produce, Linux script, linux firewall, home security system, home security job, home clean, command, clean files, clean back, line job work home, text hash, command command, centos perl, file access impossible, linux home server, linux call, linux perl admin, centos firewall, linux clean script, work home perl, perl script copy files folders server, clean text, script home security

About the Employer:
( 21 reviews ) Sao Paulo, Brazil

Project ID: #4355939

Awarded to:

pabloz1974

I can do this

$30 USD in 3 days
(0 Reviews)
0.0

10 freelancers are bidding on average $35 for this job

osmanbsd

Please check PM

$40 USD in 1 day
(82 Reviews)
6.9
ielkfarna

Please, See my private Message.

$50 USD in 2 days
(20 Reviews)
4.8
techguru91

!00% tested command ..... I personally have tested it to your given .htaccess file. Working Like charm. Just reply me.

$30 USD in 1 day
(24 Reviews)
4.6
goodperlcoder

This is good job for me - I have forders-tree scanning/proccessing perl script already and I'm expert in RegExp for cutting of this text between If ... /If and #line after it (with empty lines arround) fast and hig qu More

$50 USD in 0 days
(11 Reviews)
3.9
morissette

I have a lot of years of experience programming and my wife is pregnant so need the extra cash. I've already finished the script

$30 USD in 0 days
(2 Reviews)
2.2
Mohsen6558

hi I can write a program for find and replace injected codes in files ready to start..

$30 USD in 3 days
(0 Reviews)
0.0
mfumia

Greetings, I am interested in your project. I can create a Korn shell script to complete the tasks your described. I am available to begin work on your project immediately. -Matt

$30 USD in 0 days
(0 Reviews)
0.0
perisa

I'm system admin for many years. I can do script.

$30 USD in 1 day
(0 Reviews)
0.0
XBobJacobX

I am comfortable with command line tools and I can propose you a command line quickly. Check your PM.

$30 USD in 1 day
(0 Reviews)
0.0