Skip to content

Instantly share code, notes, and snippets.

@biojazzard
Created August 2, 2012 08:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save biojazzard/3235542 to your computer and use it in GitHub Desktop.
Save biojazzard/3235542 to your computer and use it in GitHub Desktop.
CLI-DICT
# Encontrar texto en archivo
find <directory to search> -type f | xargs grep -rl '<text to search for>'
# Ex:
find ./ -type f | xargs grep -rl 'eval(base64_decode'
# Encontrar archivo más viejo que, con extension:
find ./ -mtime +1200 -name "*.php"
# copiar/subir por ssh
scp archivo.tgz user@server:/folder/to/files
#WordPress
find ./ -type f | xargs grep -rl 'strrev'
Resultado correcto:
.//wp-admin/includes/post.php
.//wp-content/plugins/akismet/akismet_last.php
.//wp-includes/class-simplepie.php
find ./ -type f | xargs grep -rl 'eval(base64_decode'
Resultado correcto: VACIO
find ./ -type f | xargs grep -rl 'error_reporting(0)'
Resultado correcto:
./wp-admin/load-styles.php
./wp-admin/setup-config.php
./wp-admin/gears-manifest.php
./wp-admin/load-scripts.php
./wp-includes/class-http.php
./wp-includes/js/tinymce/wp-tinymce.php
find ./ -type f | xargs grep -rl 'eval($_POST'
Resultado correcto: VACIO
find ./ -type f | xargs grep -rl 'edoced_46esab(lave'
Resultado correcto: VACIO
find ./ -type f | xargs grep -rl '(lave'
Resultado correcto: VACIO
find ./ -type f | xargs grep -rl 'create_function'
./wp-admin/import.php
./wp-admin/includes/import.php
./wp-admin/includes/media.php
./wp-includes/pomo/mo.php
./wp-includes/pomo/translations.php
./wp-includes/pomo/po.php
./wp-includes/category-template.php
./wp-includes/atomlib.php
./wp-content/plugins/contact-form-7/includes/formatting.php
./wp-content/plugins/google-analyticator/class.analytics.stats.php
*** Puede que bien desde WP 3.0.0
./wp-admin/maint/edit-form-header.php
./wp-includes/pomo/class-https.php
./wp-includes/https.php
./wp-includes/post-template.php
./wp-content/themes/isuri/screenshot.php
./wp-content/plugins/simple-post-thumbnails/wp-ajax-gadget.php
find ./ -type f | xargs grep -rl 'strrev' -exec rm -rf {} \;
find ./ -type f | xargs grep -rl 'eval(base64_decode' -exec rm -rf {} \;
find ./ -name '*.old.php' -exec rm -rf {} \;
Eliminar archivos invisibles de OSX
find . -name ._\* -exec rm -f {} \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment