Featured post
ssh - Linux server, locating files containing nothing but 4 specific lines -
i'm dealing compromised website, in hackers injected htaccess instruction redirect traffic. can locate .htaccess files contain forwarding hack, in cases directory contained htaccess file, appended dangerous instructions, cannot deleted htaccess file or harm site letting formerly pw-protected directories wide open, or urlrewrite instructions (wordpress) deleted, etc. not find way locate files contain 4 lines of redirect hack, shed light ? far, using
find . -type f -exec grep -q targetpiratedomain {} \; -exec echo rm {} \;
thanks !
use 1 of .htaccess files template. issue following command:
find . -type f -name .htaccess -exec cmp -s <template> {} \; -exec rm {} \;
cmp
compare file template file , if returns true, rm
executed. might want test first echo
or cat
instead of rm
.
be sure rename or move template file before starting command, else template removed during process.
- Get link
- X
- Other Apps
Comments
Post a Comment