http://conference.hackinthebox.org/hitbsecconf2010dxb/



hackinthebox
 ::  hitb portal  ::  hitb portal (SSL)  ::  hitb forum (SSL)  ::  hitb security conference  ::  hitb training ::  hitb irc  ::  hitb photos  ::  hitb videos :: 
Who's Online
There are 200 unregistered users and 0 registered users on-line.

You can log-in or register for a user account here.



Main Menu

Top Stories for Today
[325] Special Report: HITB2009 CTF Weapons of Mass Destruction
[286] How to Jailbreak iPhone 3.1.3 IPSW with PwnageTool 3.1.5
[215] Adobe apologizes for festering Flash crash bug
[196] Hackers training website shut down by China government
[186] Microsoft's Windows 7 chief: It's not us; it's your batteries
[177] Germany to purchase stolen Swiss bank data for $3.5 million
[161] Conficker outbreak infects Leeds hospital servers
[159] AMD Reveals Fusion CPU+GPU, To Challege Intel in Laptops
[154] How O2 secured its network for the iPhone
[153] Former Intel Exec Pleads Guilty in Galleon Insider Case
[151] YouTube confirms IPv6 support
[148] £150m sting to infect computers with porn
[132] Open source means freedom from 'anti-features'
[129] Google warns Chinese copycat Web site
[128] Inside CloudLinux's New Linux-Based Cloud OS
[120] Intel, IBM roll out new computer network chips
[113] IT hiring jumps in January
[112] 95% of user-generated content was malicious in 2H 2009
[111] Critical infrastructure under constant cyberattack
[111] IT Outsourcing: Why It Pays to Appraise Your Contract
[107] Korean government to spend $341M on IT workforce training

View the Top 50 articles

Top 20 of the Last 2 Weeks

E-Zine Archive

Past Articles
Tuesday, February 09
·Hackers training website shut down by China government (0)
Monday, February 08
·Blackberry spyware source code released (0)
·P2P Snoopers Know What's In Your Wallet  (0)
·Symantec hit with class-action lawsuit over auto-renewals (0)
·Internet Overuse Invites Depression, Study Says (0)
·Recovery, Transformation for IT, Telecom in 2010 (0)
·iPad Study: The More You Know, The Less You Want One (0)
·BlackBerry has spyware risk too, researcher says (0)
·High-tech to keep Super Bowl on track (0)
·AU Gov't Still Wants ISPs To Solve Illegal Downloads (0)
·How the NSA Deal Could Kill Google (0)
·Apple's new beta of Mac OS X 10.6.3 includes few changes (0)
·Security flaw puts iPhone users at risk of phishing attacks (Updated) (0)
·Unannounced Core i7 Apple MacBook Pro surfaces in benchmarks logs (0)
·Indian IT Giant Tata Consultancy Services Hacked (0)
·ShmooCon: Inside FarmVille's sinister underbelly (0)
·Six golden rules for strong passwords (0)
·The FBI Wants to Know Where You are Online (0)
Friday, February 05
·Taiwan-based Aurora cyber attack part of larger hack than previously reported (0)
·The 10 best IT jobs right now (0)
·German grocery stores experiment with payment by fingerprint (0)
·How Trend Micro addresses cloud security (0)
·We've got a file on you - Dutch privacy under threat (0)
·Hack Your Kindle to Support Bluetooth (0)
·Encrypting your iPhone backups? Time to choose a better password (0)
·Pentagon seeks billions to battle terror abroad (0)
·Hospitality Industry Hit Hardest By Hacks (0)
·Do Google's search warrant police run IE6? (0)
·Microsoft slates colossal Windows patch next week (0)
·Google Asks NSA to Help Secure Its Network (0)
 Older articles

Hosting Provided By

SAM Files and NT Password Hashes
Posted by L33tdawg on Monday, March 18, 2002 - 11:17 PM (Reads: 345615)
Source:



By: Grifter (2600 Salt Lake City)

§ Introduction

I know that this topic has been covered by others on more than one occasion, but I figured I'd go over it yet again and throw in an update or two. Let me start with what this is all about: SAM Files & NT Password Hashes.

NT Password Hashes - When you type your password into a Windows NT, 2000, or XP login Windows encrypts your password using an encryption scheme that turns your password into something that looks like this:

7524248b4d2c9a9eadd3b435c51404ee

This is a password Hash. This is what is actually being checked against when you type your password in. It encrypts what you typed and bounces it against what is stored in the Registry and/or SAM File.

SAM File - Holds the user names and password hashes for every account on the local machine, or domain if it is a domain controller. Simple enough wouldn't you say?

§ Where do I find the SAM/Hashes?

You can find what you're looking for in several locations on a given machine.

It can be found on the hard drive in the folder %systemroot%system32config. However this folder is locked to all accounts including Administrator while the machine is running. The only account that can access the SAM file during operation is the "System" account.

You may also be able to find the SAM file stored in %systemroot% epair if the NT Repair Disk Utility a.k.a. rdisk has been run and the Administrator has not removed the backed up SAM file.

The final location of the SAM or corresponding hashes can be found in the registry. It can be found under HKEY_LOCAL_MACHINESAM. This is also locked to all users, including Administrator, while the machine is in use.

So the three locations of the SAMHashes are:

- %systemroot%system32config

- %systemroot% epair (but only if rdisk has been run)

- In the registry under HKEY_LOCAL_MACHINESAM

§ Obtaining the SAMPassword Hashes

Wow, how wonderful. Now we know where the goods are, and the problem is this... "How do I get my hands on those hashes?" The answer is "One of four ways."

1) Probably the easiest way to do this is to boot your target machine to an alternate OS like NTFSDOS or Linux and just copy the SAM from the %systemroot%system32config folder. It's quick, it's easy, and it's effective. You can get a copy of NTFSDOS from Sysinternals(http://www.sysinternals.com) The regular version of NTFSDOS is freeware, which is always nice, but only allows for Read-Only access. This should be fine for what you want to do, however, if you're the kind of person that just has to have total control and has some money to burn. NTFSDOS Pro, which is also by Sysinternals has read/write access but it'll cost you $299.

2) Once again, you may be able to obtain the SAM from %systemroot% epair if rdisk has been run and you are lucky enough to have a sloppy admin.

3) You can also get password hashes by using pwdump2. pwdump uses .DLL injection in order to use the system account to view the password hashes stored in the registry. It then pulls the hashes from the registry and stores them in a handy little text file that you can then import into a password cracking utility like l0phtcrack.

4) The final way to obtain password hashes is to listen directly to the network traffic as it floats by your computer and grab hashes using the above mentioned l0phtcrack.

§ Cracking Password Hashes

With the hashes in hand and an eagerness to find out what passwords lie waiting. Let's get cracking. While there are numerous programs available for the use of password cracking I will quickly cover two of the most popular ones.

John the Ripper - John the Ripper is to many, the old standby password cracker. It is command line which makes it nice if you're doing some scripting, and best of all it's free. The only real thing that JtR is lacking is the ability to launch Brute Force attacks against your password file. But look at it this way, even though it is only a dictionary cracker, that will probably be all you need. I would say that in my experience I can find about 85-90% of the passwords in a given file by using just a dictionary attack. Not bad, not bad at all.

L0phtCrack - Probably the most wildly popular password cracker out there. L0phtCrack is sold by the folks at @Stake. And with a pricetag of $249 for a single user license it sure seems like every one owns it. Boy, @Stake must be making a killing. :) This is probably the nicest password cracker you will ever see. With the ability to import hashes directly from the registry ala pwdump and dictionary, hybrid, and brute-force capabilities. No password should last long. Well, I shouldn't say "no password". But almost all will fall to L0phtCrack given enough time.

§ Injecting Password Hashes into the SAM

Probably one of my favorite and easiest ways to gain Administrator privileges on a machine, is by injecting password hashes into the SAM file. In order to do this you will need physical access to the machine and a brain larger than a peanut. Using a utility called "chntpw" by Petter Nordhal-Hagen you can inject whatever password you wish into the SAM file of any NT, 2000, or XP machine thereby giving you total control. I would suggest backing up the SAM file first by using an alternate OS. Go in, inject the password of your choosing. Login using your new password. Do what you need to do. Then restore the original SAM so no one knows you were there.

§ Password Strength

By looking at the methods above, you can see the importance in keeping strong passwords. Someone may be able to get there hands on your hashes, but it's whether or not they can crack them that is the real test. Don't make it easy on them.

When I create a password I like to use the first letter of each word in a phrase. Like "Password Strength is important so I pick good passwords" would be "psiisipgp". Now you have a 9 character password that isn't in any dictionary I know of. Bye Bye John the Ripper.

Now I like to flank passwords in special characters like "@$%?", now your password is ?psiisipgp?. This will ensure L0phtCrack takes a long time cracking it, giving you time to change it if you discover a breach, or just change your passwords regularly.

If you want to get insane, like I do, you can add non-printable ascii characters to your passwords. Using the Alt key and the numbers on your number pad, hold Alt and key in 149. you should get a character like this "ò". Flank your password with this before your question marks and now you've got a secure password. ?òpsiisipgpò? can't be cracked by L0phtCrack since it doesn't allow for non-printable ascii characters. Bye Bye L0phtCrack.

I know this may seem like a lot to do, but let's face it, a weak password is a cracked password.

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

NTFSDOS - (http://www.sysinternals.com)

pwdump2 - (http://www.webspan.net/~tas/pwdump2/)

John the Ripper - (http://www.openwall.com/john/)

L0phtCrack - (http://www.atstake.com/research/lc3/)

chntpw - (http://home.eunet.no/~pnordahl/ntpasswd/)

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-

© 2600SLC.ORG 2002

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-



1.) The Linux Hackers Intro to assembly language (Pt. 1) - argc
2.) Intro to PGP on Windows - madirish
3.) Hacking Windows Shares from Linux with Samba - madirish
4.) DVD Ripping the Right Way - A
5.) SAM Files and NT Password Hashes - Grifter
6.) SQL Interjection Attack - Fiend
7.) Raw Socket Access in Windows XP - Tierra
8.) The Tuxtendo's Tuxkit Rootkit Analysis - Spoonfork

(Printer-friendly page Send this story to someone)

 
Top 10 Articles from the last 2 weeks for Articles

· Articles Postings

· Postings by L33tdawg


SAM Files and NT Password Hashes | Log-in or register a new user account | 8 Comments
Comments are statements made by the person that posted them.
They do not necessarily represent the opinions of the site editor.
Re: SAM Files and NT Password Hashes (Score: 1)
by MIKE11114 on Nov 16, 2003 - 12:31 PM

(User information | Send a message)
I am trying to get admin access to my schools computers and am useing pwdump2 to extract the encrypted sam files. Some how it is not able to execute lsass.exe (it is running in the command prompt) it has no trouble finding the pid. Do any of you have any suddestions and/or alternet methods?
Thanx


Re: SAM Files and NT Password Hashes (Score: 1)
by mity on Sep 14, 2006 - 10:50 AM

(User information | Send a message)
I have a copy of sam but I can't extract the hashes stored in it. How to do this? You can recommend me a soft hor this? ( sam have 262kb and is on same machine ; I copy him booting by dischette with ntfsdos free , can copy little files on dischettes.


Login
 



 


 Log in Problems?
 New User? Sign Up!

Last 15 Postings to HITB Forum

Packet Storm Security Latest
· HPSBUX02503-SSRT100019.txt
HP Security Bulletin - Potential security vulnerabilities have been identified in Java Runtime Environment (JRE) and Java Developer Kit (JDK) running on HP-UX. These vulnerabilities could allow remote unauthorized access, privilege escalation, and Denial of Service (DoS).
· MDVSA-2010-034.txt
Mandriva Linux Security Advisory 2010-034 - Some vulnerabilities were discovered and corrected in the Linux 2.6 kernel. Array index error in the gdth_read_event function in drivers/scsi/gdth.c in the Linux kernel before 2.6.32-rc8 allows local users to cause a denial of service or possibly gain privileges via a negative event index in an IOCTL request. The collect_rx_frame function in drivers/isdn/hisax/hfc_usb.c in the Linux kernel before 2.6.32-rc7 allows attackers to have an unspecified impact via a crafted HDLC packet that arrives over ISDN and triggers a buffer under-read. Additionally, the Linux kernel was updated to the stable release 2.6.27.45.
· nightdahack2010-cfp.txt
Night Da Hack 2010 Call For Proposals - This conference will take place from 4 PM through 7 AM, June 19th through the 20th, 2010 in Paris, France.
· CORELAN-10-010.txt
GeFest Web HomeServer version 1.0 suffers from a directory traversal vulnerability.
· wsnguestdb-disclose.txt
WSN Guest Database appears to suffer from a database disclosure vulnerability.
· bluedove-sql.txt
Blue Dove suffers from a remote SQL injection vulnerability.
· synspam_0.4.0-1.tar.gz
Synspam uses Netfilter NFQUEUE to catch the source IP address of any machine connecting to your mail server, running multiple tests against it possible, a scoring system is used. If the source IP address is believed to be a spammer IP address, the connection can be dropped. There is a dry run mode if you just want to test it, which is the default.
· as3flexdb-sqldisclose.txt
AS3FlexDB suffer from remote database login information disclosure and remote SQL execution vulnerabilities.

Topics
· All topics
· AMD News (Feb 09, 2010)
· Apple News (Feb 09, 2010)
· Articles (Mar 03, 2009)
· Ask Us (Feb 01, 2003)
· Audio/Video (Feb 03, 2010)
· Encryption (Jan 15, 2010)
· Games (Feb 04, 2010)
· Hardware (Feb 08, 2010)
· HITB News (Feb 09, 2010)
· Industry News (Feb 09, 2010)
· Intel News (Feb 03, 2010)
· Law and Order (Feb 09, 2010)
· Linux (Feb 09, 2010)
· Microsoft (Feb 09, 2010)
· Networking (Feb 09, 2010)
· PDAs (Feb 09, 2007)
· Privacy (Feb 08, 2010)
· Red Hat (Nov 18, 2009)
· Science (Feb 04, 2010)
· Security (Feb 09, 2010)
· Software & Programming (Feb 09, 2010)
· Spam (Jan 26, 2010)
· Technology (Feb 09, 2010)
· Transmeta (Jul 07, 2007)
· Viruses & Malware (Feb 09, 2010)
· Wireless (Dec 28, 2009)

Follow us
Join our Facebook Group

Follow us on Twitter

Follow our RSS feed


HITB Affiliates

Page created in 0.96101307869 seconds.