Logo
word_search.pl PDF Print E-mail
Written by Keven Murphy   
Saturday, 13 December 2008 19:29

This perl script will allow you to search a file for keywords and pull out the lines that contain them. The script relies on a couple of comand line options (see below for an explaination). Upon statup of the script, it will create files with file names as the keywords in the output directory. Hence if you have a keyword such as dog you will find a file in your output directory called dog. As it finds each keyword, it will take the line and place it into the keyword file. After the script is complete, check out the keyword files in the output directory. If the file has 0 bytes then it did not find that keyword.

How to use:

1) Take your binary file and run strings on it.
For example:

  • ASCII: strings -t d {file} > {filename.ascii}
  • UNICODE: strings -t d -el {file} > {filename.ascii}

2) Generate your keyword file with one keyword per line. Do not leave any blank lines at the end of the file!
3) Create your output directory
4) Run the command:

  • ./word_search.pl --file {filename of string file} --wordfile {keyword file} --output {dir/output}

 

Conveats: The more keywords you have the longer the search will take.

Feedback: Please by all means contact us, if you find a bug or have a way to improve the script.

License: GPL version 2
Download: word_search_v2.pl.gz

Last Updated on Monday, 29 December 2008 17:02