Skip to content

Instantly share code, notes, and snippets.

@mikeclarke
Created December 12, 2010 21:48
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 mikeclarke/738366 to your computer and use it in GitHub Desktop.
Save mikeclarke/738366 to your computer and use it in GitHub Desktop.
Locating credit card data in log files
find /var/log/application/* -name "*.log" -type f -mtime -1
-exec egrep -Hn \
'\b(?:4[0-9]{12}(?:[0-9]{3})?
|5[1-5][0-9]{14}
|6(?:011|5[0-9][0-9])[0-9]{12}
|3[47][0-9]{13}
|3(?:0[0-5]|[68][0-9])[0-9]{11}
|(?:2131|1800|35\d{3})\d{11})\b'
{} > ~/output.out \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment