Repository navigation
pse2john: port script to Python 3 and handle multiple PSE files - #6040
martingalloar wants to merge 2 commits into
Conversation
martingalloar
commented
Sep 21, 2026
- Port pse2john.py from Python 2 to Python 3
- Preserve John-compatible hash output
- Support multiple input files and optional output files
- Report unsupported PSE files on stderr while continuing processing
- Handle plain PSE files without aborting the batch
|
Thank you! How has this been tested? Do we have suitable sample files in https://github.com/openwall/john-samples? |
|
Oh wasn't aware of that repo! I just submitted a separate PR there :) |
exploide
left a comment
There was a problem hiding this comment.
This is clearly an improvement. Thanks!
While I left two comments, I think this would be still acceptable as is.
Side note: This is no longer compatible with python2, which is fine for me but I know that @solardiz was in favor of maintaining compatibility as far as possible. However, since this depends on a third party library that might have diverged after the EOL of Python2 (I don't know), this might be an unreasonable effort.
Yes, the core pysap library has moved into Python 3 only, and keeping backwards compatibility is not planned, so it will be a big effort to add it just for this script. |
exploide
left a comment
There was a problem hiding this comment.
Awesome, thanks for addressing the comments.
- Port pse2john.py from Python 2 to Python 3 - Preserve John-compatible hash output - Support multiple input files and optional output files - Report unsupported PSE files on stderr while continuing processing - Handle plain PSE files without aborting the batch
cd9ad6b to
54fa74d
Compare
exploide
left a comment
There was a problem hiding this comment.
You requested another review. While it looks fine so far and the script also works on the two sample files you submitted to john-samples, there is a warning now:
It is the line from pysap.SAPPSE import (SAPPSEFile, PKCS12_ALGORITHM_PBE1_SHA_3DES_CBC) which leads to WARNING: Invalid val: should be bytes. Also reproducible in a Python REPL. So I think this is unrelated to this script but a problem in pysap?
Thanks for reporting this! Yes the warning is reproducible with Scapy 2.8.0. It comes from a string default in pysap’s ASN.1 definitions that newer Scapy expects to be bytes, so it is unrelated to this script. The development branch already pins Scapy to 2.7.0 while we review and fix those instances and adjust the defaults, where the warning does not occur, but that pin hasn’t been released yet. For the current release, installing scapy==2.7.0 avoids the warning. |
|
Is this PR ready to merge? |