grep && find


Find Command
Find .php in folder
find path -name "*.php"

หาไฟล์ที่ถูกแก้ไขในช่วง 1 วัน (ภายในโฟลเดอร์)
find . -mtime -1 -print



GREP Command
Options
-n แสดง line number กับ output lines
-R ค้นหาในไดเร็กทอรี
-r ค้นหาในไดเร็กทอรี+ลิงค์
-P Perl regular expression

Example
grep -R "keyword" *
grep -r "keyword" /home
grep -Rn "passthru *(" /var/www
grep -RPn "(passthru|shell_exec|system|phpinfo|base64_decode|chmod|mkdir|fopen|fclose|readfile) *\(" /var/www

ปล.กรณีที่แอบโค้ด PHP ไว้ในไฟล์ภาพก็ไม่รอดเช่นกัน :P