Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added pkzip kernels 17200, 17210, 17220 and 17230 #1962

Merged
merged 24 commits into from May 15, 2019

Conversation

Projects
None yet
9 participants
@s3inlc
Copy link
Contributor

commented Mar 21, 2019

Added four kernel types for cracking pkzip hashes (extracted with zip2john):

  • 17200: one file extracted, compressed
  • 17210: one file extracted, uncompressed (note that there might be collisions as there are only 40bits to validate the plain)
  • 17220: multiple files extracted, compressed
  • 17230: multiple files extracted with checksums only, at least 3 files recommended with 2 checksum bytes or 6-8 files recommended with 1 checksum only.

These new kernels should close issue #69.

Additional notes:

  • The speed can vary a lot, depending on the exact file hash type and length. Also there may be large differences between attack types.
  • Currently no mixed multiple files hashes are supported (compressed and uncompressed) and also no multiple files with all no compression. They might be added at a later time.
  • If the wrong hash type is used, it should catch it in the parser for most of the cases, but be careful to select the correct kernel for your hash.

s3inlc added some commits Mar 21, 2019

@dropdeadfu
Copy link
Contributor

left a comment

very good, the handwriting looks almost like atoms

@RolfHashcat

This comment has been minimized.

Copy link
Contributor

commented Mar 22, 2019

17200 and 17220 fail to compile on an Intel CPU during benchmark, 17210 and 17230 do not have such a problem.

hashcat.exe -D 1,2 -b -m 17200
hashcat (v5.1.0-762-g59ecdbd3+) starting in benchmark mode...

OpenCL Platform #1: NVIDIA Corporation
======================================
* Device #1: GeForce GTX 1080, 2048/8192 MB allocatable, 20MCU

OpenCL Platform #2: Intel(R) Corporation
========================================
* Device #2: Intel(R) Core(TM) i7-5960X CPU @ 3.00GHz, 8151/32605 MB allocatable, 16MCU

Benchmark relevant options:
===========================
* --opencl-device-types=1,2
* --optimized-kernel-enable

Hashmode: 17200 - PKZIP (Compressed)

clBuildProgram(): CL_BUILD_PROGRAM_FAILURE

Compilation started
In file included from 1:87:
OpenCL\inc_zip_inflate.cl:180:16: error: pointers to functions are not allowed
typedef void *(*mz_alloc_func)(void *opaque, size_t items, size_t size);
               ^
OpenCL\inc_zip_inflate.cl:181:15: error: pointers to functions are not allowed
typedef void (*mz_free_func)(void *opaque, void *address);
              ^
OpenCL\inc_zip_inflate.cl:182:16: error: pointers to functions are not allowed
typedef void *(*mz_realloc_func)(void *opaque, void *address, size_t items, size_t size);
               ^
Compilation failed

* Device #2: Kernel /Rolf/hashcat/OpenCL/m17200_a3-pure.cl build failed - proceeding without this device.

Speed.#1.........:  3959.0 MH/s (84.43ms) @ Accel:1024 Loops:512 Thr:32 Vec:1
Speed.#*.........:  3959.0 MH/s
hashcat.exe -D 1,2 -b -m 17210
hashcat (v5.1.0-762-g59ecdbd3+) starting in benchmark mode...

OpenCL Platform #1: NVIDIA Corporation
======================================
* Device #1: GeForce GTX 1080, 2048/8192 MB allocatable, 20MCU

OpenCL Platform #2: Intel(R) Corporation
========================================
* Device #2: Intel(R) Core(TM) i7-5960X CPU @ 3.00GHz, 8151/32605 MB allocatable, 16MCU

Benchmark relevant options:
===========================
* --opencl-device-types=1,2
* --optimized-kernel-enable

Hashmode: 17210 - PKZIP (Uncompressed)

Speed.#1.........:  1162.1 MH/s (71.91ms) @ Accel:1024 Loops:128 Thr:32 Vec:1
Speed.#2.........: 92230.4 kH/s (90.74ms) @ Accel:1024 Loops:512 Thr:1 Vec:8
Speed.#*.........:  1254.3 MH/s
hashcat.exe -D 1,2 -b -m 17220
hashcat (v5.1.0-762-g59ecdbd3+) starting in benchmark mode...

OpenCL Platform #1: NVIDIA Corporation
======================================
* Device #1: GeForce GTX 1080, 2048/8192 MB allocatable, 20MCU

OpenCL Platform #2: Intel(R) Corporation
========================================
* Device #2: Intel(R) Core(TM) i7-5960X CPU @ 3.00GHz, 8151/32605 MB allocatable, 16MCU

Benchmark relevant options:
===========================
* --opencl-device-types=1,2
* --optimized-kernel-enable

Hashmode: 17220 - PKZIP (Compressed Multi-File)

clBuildProgram(): CL_BUILD_PROGRAM_FAILURE

Compilation started
In file included from 1:87:
OpenCL\inc_zip_inflate.cl:180:16: error: pointers to functions are not allowed
typedef void *(*mz_alloc_func)(void *opaque, size_t items, size_t size);
               ^
OpenCL\inc_zip_inflate.cl:181:15: error: pointers to functions are not allowed
typedef void (*mz_free_func)(void *opaque, void *address);
              ^
OpenCL\inc_zip_inflate.cl:182:16: error: pointers to functions are not allowed
typedef void *(*mz_realloc_func)(void *opaque, void *address, size_t items, size_t size);
               ^
Compilation failed

* Device #2: Kernel /Rolf/hashcat/OpenCL/m17220_a3-pure.cl build failed - proceeding without this device.

Speed.#1.........:  4227.0 MH/s (39.32ms) @ Accel:1024 Loops:256 Thr:32 Vec:1
Speed.#*.........:  4227.0 MH/s
hashcat.exe -D 1,2 -b -m 17230
hashcat (v5.1.0-762-g59ecdbd3+) starting in benchmark mode...

OpenCL Platform #1: NVIDIA Corporation
======================================
* Device #1: GeForce GTX 1080, 2048/8192 MB allocatable, 20MCU

OpenCL Platform #2: Intel(R) Corporation
========================================
* Device #2: Intel(R) Core(TM) i7-5960X CPU @ 3.00GHz, 8151/32605 MB allocatable, 16MCU

Benchmark relevant options:
===========================
* --opencl-device-types=1,2
* --optimized-kernel-enable

Hashmode: 17230 - PKZIP (Compressed Multi-File Checksum-Only)

Speed.#1.........:  7039.3 MH/s (92.83ms) @ Accel:1024 Loops:1024 Thr:32 Vec:1
Speed.#2.........:   115.3 MH/s (72.55ms) @ Accel:1024 Loops:512 Thr:1 Vec:8
Speed.#*.........:  7154.6 MH/s
@s3inlc

This comment has been minimized.

Copy link
Contributor Author

commented Mar 22, 2019

Ok, I'll take a look into this, on my OS X the Intel Runtime accepts it. Will try to reproduce it on Linux.

@s3inlc

This comment has been minimized.

Copy link
Contributor Author

commented Mar 22, 2019

@RolfHashcat can you please try with the newest commit if you still have issues?

@RolfHashcat

This comment has been minimized.

Copy link
Contributor

commented Mar 23, 2019

Hello, none of the 4 pkzip modes work now, as inc_vendor.cl is missing.

clBuildProgram(): CL_BUILD_PROGRAM_FAILURE

In file included from <kernel>:87:
OpenCL\inc_zip_inflate.cl:64:10: fatal error: 'inc_vendor.cl' file not found
#include "inc_vendor.cl"
         ^

* Device #1: Kernel /Rolf/hashcat/OpenCL/m17200_a3-pure.cl build failed - proceeding without this device.

clBuildProgram(): CL_BUILD_PROGRAM_FAILURE

Compilation started
In file included from 1:87:
OpenCL\inc_zip_inflate.cl:64:10: fatal error: 'inc_vendor.cl' file not found
#include "inc_vendor.cl"
         ^~~~~~~~~~~~~~~
Compilation failed

* Device #2: Kernel /Rolf/hashcat/OpenCL/m17200_a3-pure.cl build failed - proceeding without this device.

s3inlc added some commits Mar 25, 2019

@s3inlc

This comment has been minimized.

Copy link
Contributor Author

commented Mar 25, 2019

Please try again now, unfortunate timing that atom just refactored stuff after my commits.

@RolfHashcat

This comment has been minimized.

Copy link
Contributor

commented Mar 25, 2019

Benchmarks work correctly now, with both cpu and gpu opencl kernels.

@andrewtch

This comment has been minimized.

Copy link

commented Apr 22, 2019

Any chance for this to be accepted? )

@jsteube

This comment has been minimized.

Copy link
Member

commented Apr 22, 2019

Of course! I just did some deep changes and send it to @s3inlc (offline) and now waiting for him to update the PR.

@gs135269

This comment has been minimized.

Copy link

commented May 2, 2019

@RolfHashcat I am very happy to see that your benchmark can support pkzip. How do you make hashcat support pkzip? I am not adding some plugins to the hashcat directory. How are these plugins added?
This is what prompted me in my hashcat.
Hashcat (v5.1.0) starting in benchmark mode...

Benchmarking uses hand-optimized kernel code by default.
You can use it in your cracking session by setting the -O option.
Note: Using optimized kernel code limits the maximum supported password length.
To disable the optimized kernel code in benchmark mode, use the -w option.

OpenCL Platform #1: NVIDIA Corporation

  • Device #1: GeForce GTX 1080 Ti, 2816/11264 MB allocatable,

OpenCL Platform #2: Intel(R) Corporation

  • Device #2: Intel(R) Celeron(R) CPU G3900 @ 2.80GHz, skipped.

Benchmark relevant options:

  • --optimized-kernel-enable

Unknown hash-type '17200' selected.

Started: Fri May 03 00:36:51 2019
Stopped: Fri May 03 00:36:52 2019

@philsmd

This comment has been minimized.

Copy link
Member

commented May 2, 2019

@gs135269 this is literally work in progress, the code is not within hashcat releases yet (not even in beta). This github tab/page itself (#1962) implies that this is a PR (pull request). The code needs to be reviewed and merged first, before the code will be in the master branch.

You can always use the patch itself and use "git apply" https://patch-diff.githubusercontent.com/raw/hashcat/hashcat/pull/1962.diff or use @s3inlc branch from https://github.com/s3inlc/hashcat to compile the code yourself and run it. This is advanced stuff and only developers normally (need to) do this. for the average user it's just important to have some patience and wait until the next release notes say that pkzip is finally supported. It's as easy as this.

@alter

This comment has been minimized.

Copy link

commented May 4, 2019

"make win" doesn't work, I need in exe for windows =(

@alter

This comment has been minimized.

Copy link

commented May 4, 2019

Also, when I use hash.file, which start from $pkzip2$ and ends with $/pkzip2$, I get a message "No hashes loaded", could you give an example of hash file?

@dummys

This comment has been minimized.

Copy link

commented May 9, 2019

Get this error using -m 17220:

* Device #7: Kernel cracking/hashcat_dev/hashcat/OpenCL/m17220_a0-pure.cl build failed - proceeding without this device.

clBuildProgram(): CL_BUILD_PROGRAM_FAILURE

<kernel>:966:17: error: no member named 'zalloc' in 'struct mz_stream_s'
      infstream.zalloc    = Z_NULL;
      ~~~~~~~~~ ^
<kernel>:967:17: error: no member named 'zfree' in 'struct mz_stream_s'
      infstream.zfree     = Z_NULL;
      ~~~~~~~~~ ^

s3inlc added some commits May 9, 2019

s3inlc added some commits May 14, 2019

@jsteube

This comment has been minimized.

Copy link
Member

commented May 15, 2019

Just awesome

@jsteube

This comment has been minimized.

Copy link
Member

commented May 15, 2019

Many thanks

@jsteube jsteube merged commit a5301f0 into hashcat:master May 15, 2019

1 of 2 checks passed

continuous-integration/appveyor/pr Waiting for AppVeyor build to complete
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.