joelanford / goscan

A simple tool to scan text, binary, and archive files for keywords
MIT License
2 stars 2 forks source link

Not windows compatible #17

Closed qarth closed 7 years ago

qarth commented 7 years ago

I tried to install it after adding a windows bin of unrar, however I get the following error when run on windows: mkdir D:\TEMP\goscan606445587/c:: The filename, directory name, or volume label syntax is incorrect.

Just thought I would save others the trouble of trying on windows 👍 Cheers

joelanford commented 7 years ago

@qarth - Thanks for the report. I think I found and fixed the bug. Can you pull the latest master and try again?

joelanford commented 7 years ago

Also to clarify, you need unar, not unrar, if you want to be able to extract and scan archives and compressed files. I updated the README to include instructions for installing unar on Windows.

qarth commented 7 years ago

I added unar to path, thanks for detailing that in the readme. I ran go get -u is that equivalent to git cloning the master?

root@DESKTOP-UB21P28 MINGW64 /o/test/Databases
$ goscan -scan.words keys.yml O:\test\Databases\Other\test.us-mpgh.txt
D:\TEMP\goscan531003079/O_\test\Databases

root@DESKTOP-UB21P28 MINGW64 /o/test/Databases
$ unar
unar v1.8.1 (Oct  3 2013), a tool for extracting the contents of archive files.
Usage: unar [options] archive [files ...]
joelanford commented 7 years ago

Yes -- looks like you've got the latest. In your example, it looks like your O:\test\Databases\Other\test.us-mpgh.txt file does not contain any of the scan keywords in your keys.yml file.

I also noticed I accidentally left a debug print statement in there that prints out the temp directory that gets created. I'll get that cleaned up.

If your file did contain hits, you would see JSON output lines that detail the file that contained the hit with context and location of the hit in the file.

Lastly, it looks like you're scanning what looks like a simple text file. While goscan can handle that no problem, the big advantage of goscan over something like grep is that it can recursively unarchive .zip, .tar, .tar.gz, .iso, and a whole bunch of other compression and archive file formats and scan all of the files contained within them.