Skip to content

Instantly share code, notes, and snippets.

@ramayac
Created February 28, 2012 15:24
Show Gist options
  • Save ramayac/1933114 to your computer and use it in GitHub Desktop.
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
#!/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