Package Details: samdump2 3.0.0-4

Git Clone URL: https://aur.archlinux.org/samdump2.git (read-only, click to copy)
Package Base: samdump2
Description: Dump password hashes from a Windows NT/2k/XP installation.
Upstream URL: http://sourceforge.net/projects/ophcrack/files/samdump2/
Licenses: GPL
Submitter: jerry73204
Maintainer: jerry73204
Last Packager: jerry73204
Votes: 4
Popularity: 0.51
First Submitted: 2015-12-06 07:09 (UTC)
Last Updated: 2018-01-30 04:19 (UTC)

Latest Comments

lacsaP commented on 2018-01-30 08:16 (UTC)

thanks @(SiliciousReese && jerry73204)

jerry73204 commented on 2018-01-30 04:20 (UTC)

Thanks Silicious. I've uploaded your patch, enjoy!

SiliciousReese commented on 2017-12-30 10:19 (UTC) (edited on 2017-12-30 10:21 (UTC) by SiliciousReese)

FIXED: I managed to compile on linux by making some small changes to samdump2.c. I compiled directly from upstream, but I'm pretty sure the changes will work here.

Sorry I don't know how to submit a patch, but here is the git dif. I captilized the calls to openssl des functions and added the dereference operator where it was missing in a few function calls and included the crypto library.

diff --git a/Makefile b/Makefile
index 1e05c59..0b6a9df 100644
--- a/Makefile
+++ b/Makefile
@@ -29,8 +29,8 @@ BINDIR    = $(PREFIX)/bin
 MANDIR    = $(PREFIX)/share/man/man1
 INSTALL   = $(shell which install)
 CC       = $(shell which gcc)
-CFLAGS    = -Wall
-LIBS      = -lssl
+CFLAGS    = -Wall
+LIBS      = -lssl -lcrypto

 # Default target
 all: build
diff --git a/samdump2.c b/samdump2.c
index 2726f9c..5149c32 100644
--- a/samdump2.c
+++ b/samdump2.c
@@ -58,7 +58,7 @@

 void str_to_key(unsigned char *str,unsigned char *key)
 {
-       // void des_set_odd_parity(des_cblock *);
+       // void des_set_odd_parity(DES_cblock *);
        int i;

        key[0] = str[0]>>1;
@@ -72,7 +72,7 @@ void str_to_key(unsigned char *str,unsigned char *key)
        for (i=0;i<8;i++) {
                key[i] = (key[i]<<1);
        }
-       des_set_odd_parity((des_cblock *)key);
+       DES_set_odd_parity((DES_cblock *)key);
 }

 /*
@@ -210,8 +210,8 @@ unsigned char* utf16_to_utf8 (unsigned char *dest, unsigned short int *src, size
   unsigned char hbootkey[0x20];

   /* Des */
-  des_key_schedule ks1, ks2;
-  des_cblock deskey1, deskey2;
+  DES_key_schedule ks1, ks2;
+  DES_cblock deskey1, deskey2;

   int i, j;

@@ -419,15 +419,15 @@ unsigned char* utf16_to_utf8 (unsigned char *dest, unsigned short int *src, size

       /* Get the two decrpt keys. */
       sid_to_key1(rid,(unsigned char *)deskey1);
-      des_set_key_checked((des_cblock *)deskey1,ks1);
+      DES_set_key_checked((DES_cblock *)deskey1,&ks1);
       sid_to_key2(rid,(unsigned char *)deskey2);
-      des_set_key_unchecked((des_cblock *)deskey2,ks2);
+      DES_set_key_unchecked((DES_cblock *)deskey2,&ks2);

       /* Decrypt the lanman password hash as two 8 byte blocks. */
-      des_ecb_encrypt((des_cblock *)obfkey,
-                     (des_cblock *)fb, ks1, DES_DECRYPT);
-      des_ecb_encrypt((des_cblock *)(obfkey + 8),
-                     (des_cblock *)&fb[8], ks2, DES_DECRYPT);
+      DES_ecb_encrypt((DES_cblock *)obfkey,
+                     (DES_cblock *)fb, &ks1, DES_DECRYPT);
+      DES_ecb_encrypt((DES_cblock *)(obfkey + 8),
+                     (DES_cblock *)&fb[8], &ks2, DES_DECRYPT);



@@ -472,16 +472,16 @@ unsigned char* utf16_to_utf8 (unsigned char *dest, unsigned short int *src, size
       if (lm_size != 0x14) {
        /* Get the two decrpt keys. */
        sid_to_key1(rid,(unsigned char *)deskey1);
-       des_set_key((des_cblock *)deskey1,ks1);
+       DES_set_key((DES_cblock *)deskey1,&ks1);
        sid_to_key2(rid,(unsigned char *)deskey2);
-       des_set_key((des_cblock *)deskey2,ks2);
+       DES_set_key((DES_cblock *)deskey2,&ks2);
       }

       /* Decrypt the NT md4 password hash as two 8 byte blocks. */
-      des_ecb_encrypt((des_cblock *)obfkey,
-                     (des_cblock *)fb, ks1, DES_DECRYPT);
-      des_ecb_encrypt((des_cblock *)(obfkey + 8),
-                     (des_cblock *)&fb[8], ks2, DES_DECRYPT);
+      DES_ecb_encrypt((DES_cblock *)obfkey,
+                     (DES_cblock *)fb, &ks1, DES_DECRYPT);
+      DES_ecb_encrypt((DES_cblock *)(obfkey + 8),
+                     (DES_cblock *)&fb[8], &ks2, DES_DECRYPT);

       /* sf27 wrap to sf25 */
       //sf27( obfkey, (int*)&rid, fb );

lacsaP commented on 2017-04-29 09:36 (UTC)

hi, samdump2 no longer compile under linux 4.9.25-1-lts : samdump2.c:75:22: erreur : « des_cblock » undeclared (first use in this function) des_set_odd_parity((des_cblock *)key); ... samdump2.c:484:22: erreur : expected expression before « ) » token (des_cblock *)&fb[8], ks2, DES_DECRYPT); regards.

GI_Jack commented on 2016-12-29 00:41 (UTC)

==> ERROR: license should be an array