Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi,

I am trying to retrieve the pdf hashes via a JohnTheRipper script, which can be found at (can't link it - get "permission denied") magnumripper/JohnTheRipper/bleeding-jumbo/run/pdf2john.pl under raw.githubusercontent.com

I have media-libs/exiftool-11.29 installed in the standard destination for my distribution (and media-libs/libexif-0.6.21-r2 installed, as well).

The relevant part of the environment:

$ perl -V [...] @INC: /etc/perl /usr/local/lib64/perl5/5.26.2/x86_64-linux /usr/local/lib64/perl5/5.26.2 /usr/lib64/perl5/vendor_perl/5.26.2/x86_64-linux /usr/lib64/perl5/vendor_perl/5.26.2 /usr/local/lib64/perl5 /usr/lib64/perl5/vendor_perl /usr/lib64/perl5/5.26.2/x86_64-linux /usr/lib64/perl5/5.26.2
The location of the module:
$ ls -al /usr/lib/perl5/vendor_perl/5.26.2/Image/ total 468 drwxr-xr-x 3 root root 4096 2019-05-16 02:15:48 ./ drwxr-xr-x 17 root root 4096 2019-05-16 02:22:43 ../ drwxr-xr-x 4 root root 4096 2019-05-16 02:15:48 ExifTool/ -r--r--r-- 1 root root 352517 2019-05-16 02:15:38 ExifTool.pm -r--r--r-- 1 root root 100000 2019-05-16 02:15:38 ExifTool.pod
The initial error:
$ perl pdf2john.pl file.pdf Can't locate ExifTool.pm in @INC (you may need to install the ExifTool + module) (@INC contains: ./lib /etc/perl /usr/local/lib64/perl5/5.26. +2/x86_64-linux /usr/local/lib64/perl5/5.26.2 /usr/lib64/perl5/vendor_ +perl/5.26.2/x86_64-linux /usr/lib64/perl5/vendor_perl/5.26.2 /usr/loc +al/lib64/perl5 /usr/lib64/perl5/vendor_perl /usr/lib64/perl5/5.26.2/x +86_64-linux /usr/lib64/perl5/5.26.2) at pdf2john.pl line 39. BEGIN failed--compilation aborted at pdf2john.pl line 39.
Of course, I did some searching before coming here, and found a suggested fix:
$ perl -I /usr/lib64/perl5/vendor_perl/5.26.2/Image/ pdf2john.pl file. +pdf Name "ExifTool::configFile" used only once: possible typo at pdf2john. +pl line 36. Name "ExifTool::langs" used only once: possible typo at pdf2john.pl li +ne 771. Name "ExifTool::charsetName" used only once: possible typo at pdf2john +.pl line 589. Name "ExifTool::langName" used only once: possible typo at pdf2john.pl + line 771. Can't locate object method "new" via package "ExifTool" at pdf2john.pl + line 403.
At this point, I am completely baffled as to why ExifTool can't find the "new" method.

Any idea what is going on? Thank you in advance for your assistance.

Replies are listed 'Best First'.
Re: environment and locations
by haukex (Archbishop) on May 19, 2019 at 12:44 UTC

    Your standard @INC locations contain /usr/lib64/perl5/vendor_perl/5.26.2, and the file you found, relative to that path, is Image/ExifTool.pm, i.e. Image::ExifTool, and there doesn't seem to be a plain /ExifTool.pm on CPAN anyway. What the script is looking for is a module ExifTool, not Image::ExifTool, and that's part of that repository in the lib subdirectory. Your "workaround" is unfortunately pointing Perl at the wrong ExifTool.pm. Note that when you run perl pdf2john.pl file.pdf, Perl apparently has the correct path in its @INC: "(@INC contains: ./lib ..." - an absolute pathname would be better, but assuming the correct directory layout and current working directory, this should still work. So perhaps you should check that you have the file from the repository in that location?