Giter Site home page Giter Site logo

Comments (7)

claudioandre-br avatar claudioandre-br commented on July 4, 2024

Thanks for reporting.

It's actually a bit confusing, but we just have to think about how the upstream itself works:

  1. you cannot use john-local.conf (at least I haven't found a way to use it since john doesn't have a built-in variable that points to your runtime Private home);
  2. so, you must have a full john.conf in the snap (environment) proper HOME folder. It is $HOME/snap/john-the-ripper;
  3. Probably would be nice if upstream john has a variable that points to the Private home.

So let's see how it works using an example:

DO NOT REMOVE YOUR john.pot IF IT MATTERS TO YOU. Save it first, at least.


  • I'm followiing the edge snap channel. Works the same way if you are using stable.
$ cd ~

$ john --list=build-info
Version: 1.9.0-jumbo-1+bleeding-3553509ce9 2023-05-08 13:39:36 +0200
Build: linux-gnu 64-bit x86_64 AVX2 AC OMP OPENCL
SIMD: AVX2, interleaving: MD4:3 MD5:3 SHA1:1 SHA256:1 SHA512:1
Deploy: sandboxed as a Snap app
System-wide exec: /snap/john-the-ripper/current/run
System-wide home: /snap/john-the-ripper/current/run
Private home: ~/.john
[...]
$JOHN is /snap/john-the-ripper/current/run/
[...]
# Create some sample hashes
john --format=sha512crypt -list=format-tests | cut -f3 > ~/alltests.in
  • Crack it using the "regular" packaged john
$ rm -f snap/john-the-ripper/current/.john/*.pot; john ~/alltests.in --max-run=10 --mask
Warning: detected hash type "sha512crypt", but the string is also recognized as "sha512crypt-opencl"
Use the "--format=sha512crypt-opencl" option to force loading these as that type instead
Using default input encoding: UTF-8
Loaded 6 password hashes with 4 different salts (1.5x same-salt boost) (sha512crypt, crypt(3) $6$ [SHA512 256/256 AVX2 4x])
Cost 1 (iteration count) is 5000 for all loaded hashes
Will run 8 OpenMP threads
Using default mask: ?1?2?2?2?2?2?2?3?3?3?3?d?d?d?d    ## <===== HERE ************************************
Press 'q' or Ctrl-C to abort, 'h' for help, almost any other key for status
0g 0:00:00:00  (2) 0g/s 0p/s 0c/s 0C/s
                 (?)     
1g 0:00:00:02 2.49% (3) (ETA: 12:08:28) 0g/s 728.8p/s 2550c/s 4008C/s e5..5ya
1g 0:00:00:10 8.70% (3) (ETA: 12:09:01) 0g/s 702.1p/s 2306c/s 3710C/s Eli..lzi
Use the "--show" option to display all of the cracked passwords reliably
Session stopped (max run-time reached)
  • Use your personal (edited) john.conf (compare the mask).
$ cp /snap/john-the-ripper/current/run/john.conf snap/john-the-ripper/current/.john/john.conf

$ sed -i 's/DefaultMask = ?1?2?2?2?2?2?2?3?3?3?3?d?d?d?d/DefaultMask = Hello?awor?l?l?a/g' snap/john-the-ripper/current/.john/john.conf

$ rm -f snap/john-the-ripper/current/.john/*.pot; john ~/alltests.in --max-run=10 --mask
Warning: detected hash type "sha512crypt", but the string is also recognized as "sha512crypt-opencl"
Use the "--format=sha512crypt-opencl" option to force loading these as that type instead
Using default input encoding: UTF-8
Loaded 6 password hashes with 4 different salts (1.5x same-salt boost) (sha512crypt, crypt(3) $6$ [SHA512 256/256 AVX2 4x])
Cost 1 (iteration count) is 5000 for all loaded hashes
Will run 8 OpenMP threads
Using default mask: Hello?awor?l?l?a   ## <===== HERE ************************************
Press 'q' or Ctrl-C to abort, 'h' for help, almost any other key for status
0g 0:00:00:00  (10) 0g/s 0p/s 0c/s 0C/s
                 (?)     
1g 0:00:00:02 3.09% (11) (ETA: 12:09:26) 0g/s 726.2p/s 2541c/s 3994C/s Hello.worg..Hello7woria
1g 0:00:00:10 10.82% (11) (ETA: 12:09:54) 0g/s 700.7p/s 2302c/s 3703C/s HelloIworje..Hello9worni
Use the "--show" option to display all of the cracked passwords reliably
Session stopped (max run-time reached)

from john-packages.

claudioandre-br avatar claudioandre-br commented on July 4, 2024

Lets think about the issue as documentation. I don't have a better place to add this note for now.

from john-packages.

claudioandre-br avatar claudioandre-br commented on July 4, 2024

Actually, the question and the answer apply the same way to, for example, the Docker image. You will need add a:

-v "$(pwd)":/home/JtR

To connect the 'host' file system to the running container (linking the host current folder to /home/JtR).

Then create a suitable $(pwd)/.john/john.conf file in your 'host'.


Hey, why is john.conf inside the .john folder? I don't care, anywhere upstream thinks it is valid is ok with me.

from john-packages.

claudioandre-br avatar claudioandre-br commented on July 4, 2024

Moved to the wiki: Configuring packages via john.conf

from john-packages.

mac-arno avatar mac-arno commented on July 4, 2024

Here are my own findings following yours for an approach to solve the problem:
According your approach I got command not found when calling $ john --list=build-info. So I discovered two installed versions of John on my Debian system. To be shure to use the right - Snap installed - version of John I changed into the Snap directory of John with
$ cd /snap/john-the-ripper/current/run and run it with
$ ./john --list=build-info That worked. This version was asking for missing config and log files in /home/<user>/.john/. Following this I put an altered copy of john.conf into this directory. When starting John again via
$ ./john it uses the config-file put in my user directory as described above throwing out.

from john-packages.

claudioandre-br avatar claudioandre-br commented on July 4, 2024

I'm not aware of problems in Debian. Anyway, you can use the name of the snap: john-the-ripper (the john command is an alias). It should work, otherwise you can report a bug on snapcraft itself.

./john --list=build-info
If you run it this way, you're running without confinement/sandboxing. It's not bad, but people reading this should keep that in mind.


$ which john
/snap/bin/john

$ which john-the-ripper
/snap/bin/john-the-ripper

from john-packages.

mac-arno avatar mac-arno commented on July 4, 2024

from john-packages.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.