Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Juniper/NetBSD sha1crypt #1204
A potential new hash target.
Name: Juniper/NetBSD sha1crypt
Use: Currently used on Juniper routers and switches, and also available on NetBSD systems, and maybe other BSDs (but not modern FreeBSD or OpenBSD).
sha1crypt is not the default algorithm on Junipers, and must be enabled with this Junos OS command (and then committing the configuration):
It is also apparently automatically enabled when using the Junos-FIPS variant of the OS (ref here).
While perhaps less common, sha1crypt is interesting for a few reasons:
I anticipate that the use of sha1crypt on Junipers will increase. Since the only other options supported by Junos OS
Source code: Access to original Junos OS source code is limited, but the NetBSD implementation appears to be very similar. From its commit message:
Complexity requirements: These will vary by platform, since they are customizable. There are complexity configuration options on Juniper gear, but it is not yet clear what the defaults are, though this reference may be informative, and says:
The plain string 'hashcat' does not meet the default FIPS requirements. The native Juniper examples below are complex enough to meet them. On the NetBSD side, we can presume that the NetBSD implementation is similar to other Unix-like hashes such as md5crypt on that platform, as 'hashcat' is happily accepted.
The hashes are of the form:
The following two example hashes have been verified by a colleague as usable to directly log into a Juniper device:
The following two hashes appear in a thread about the format that includes actual Juniper employees:
On a NetBSD 6.0 amd64 system,
As a cross-check, JtR-jumbo successfully cracks all of the hashes listed above:
P.S. @philsmd, I'm told that I first need to convince you to write a parser for this algorithm. :)
Thanks! You and @jsteube were my primary target audience, so if it's a good writeup (and a successful one!), then mission accomplished. I also wanted to try to create a good example for others to use as a reference.
Minor edit: I added a few more 'hashcat' NetBSD examples, to demonstrate the spread of the iteration counts.
While sha1crypt may not currently be common, I anticipate that its use will in crease. Since the only other options on JunOS appear to be descrypt and md5cry pt, it is currently the strongest option on that platform.
FWIW recent Junos supports more options including those found in recent FreeBSD.
On Thu, 23 Mar 2017 07:34:19 -0700, Royce Williams writes:
Minor edit: I added a few more 'hashcat' NetBSD examples, to demonstrate the s pread of the iteration counts.
Yes, the number of iterations was semi-randomized to make dictionary attacks more expensive, goal was approximate 1s runtime.
As expected, a pretty slow hash: