Created
February 28, 2012 15:24
-
-
Save ramayac/1933114 to your computer and use it in GitHub Desktop.
Un sencillo script de ruby para quitar encabezados con contenido malicioso en archivos .php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
Dir.glob('**/*.php').each do|f| | |
puts f | |
begin | |
contents = File.read(f) | |
contents = contents.gsub(/\<\?php \/\*\*\/ eval\(.*\)\);\?\>/, "") | |
File.open(f, 'w') {|f| f.write(contents) } | |
rescue | |
puts "FILE ERROR" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment