download: http://erikimh.com/code/rmcodeinjections.sh
this will remove all iframe injections from a particular file or wildcard set of files
usage example: ./rmcodeinjections.sh *.php
Replacing /var/named domains IP addresses with perl
Sometimes you need to replace an instance of one string in a file with another string. If there's multiple occurrences, this can be a pain. Here's a simple example of how you can use perl to replace all instances of an IP address for a moved a domain.
To do it:
perl -i.bak -pe "s/0.0.0.0/1.2.3.4/g" /var/named/domain.com.db
This example shows how to change from IP 0.0.0.0 to 1.2.3.4
This will also makes a backup of /var/named/domain.com.db as /var/named/domain.com.db.bkp
If you're feeling ballsy and do not want backup run:
perl -i -pe "s/0.0.0.0/1.2.3.4/g" /var/named/domain.com.db
One alternate way would be (without perl):
replace 0.0.0.0 1.2.3.4 -- /var/named/domain.com.db
No comments:
Post a Comment