Showing posts with label grep. Show all posts
Showing posts with label grep. Show all posts

Tuesday, June 5, 2012

Apache grep big log file


I need to parse Apache log file to look for specific suspicious patterns (like SQL injections).

Sunday, June 3, 2012

Exclude .svn directories from grep


When I grep my Subversion working copy directory, the results include a lot of files from the .svn directories. Is it possible to recursively grep a directory, but exclude all results from .svn directories?

Thursday, May 24, 2012

Exploitable PHP functions


I'm trying to build a list of functions that can be used for arbitrary code execution. The purpose isn't to list functions that should be blacklisted or otherwise disallowed. Rather, I'd like to have a grep -able list of red-flag keywords handy when searching a compromised server for back-doors.

Sunday, May 20, 2012

How can I get `find` to ignore .svn directories?


I often use the find command to search through source code, delete files, whatever. Annoyingly, because Subversion stores duplicates of each file in its .svn/text-base/ directories my simple searches end up getting lots of duplicate results. For example, I want to recursively search for uint in multiple messages.h and messages.cpp files:

Thursday, May 17, 2012

grep a file, but show several surrounding lines?


I would like to grep for a string, but show the preceding 5 lines and following 5 lines as well as the matched line. I'm scanning for errors in a logfile, and want to see the context.