Pages

Showing posts with label Password Cracking. Show all posts
Showing posts with label Password Cracking. Show all posts

Dictionary Attack

In one of my previous post i wrote about the Basics of Password cracking  In this tutorial i will teach you how you can  crack  Router passwords by using a dictionary attack.


What is a Dictionary Attack?
An attack that tries all  the phrases or words in a dictionary, trying to crack a password or key .A dictionary password cracker simply takes a list of dictionary words, and one at a time encrypts them to see if they encrypt to the one way hash from the system. If the hashes are equal, the password is considered cracked, and the word tried from the dictionary list is the password.

Can I make my Own Dictionary for Cracking ?
Yes you can make your own dictionary .There are plenty of world list generators which creates different types of words you can store the words generated by  the word list generator according to your needs  in a note pad and create  your own dictionary try googling them.


What are the tools used for a Dictionary attack ?
There are many tools used for a dictionary attack you can refer my post on  Different Password Cracking Tools   But in this tutorial i will teach you how to crack router passwords using  Hydra  you can download the latest version of hydra from Here

Hacking Router  Passwords Using a Dictionary Attack 
 I will be using hydra which is installed in backtrack if you don't have Backtrack .Its ok you can do the same  by installing  Hydra - windows version

Disadvantages of  a Dictionary attack

The password should be there in the dictionary your using or this attack will fail
so always use a good dictionary for this attack . Logs will be created on PC or the router
your hacking so always use a proxy . If you don't know  How to use a proxy then go to Start Learning>Protection>Using Proxies



Brutus Password Cracker


Brutus is a well known password cracking  program .With Brutus you can either carry out a  brute force attack or a dictionary attack to crack passwords for HTTP, FTP, POP3, Telnet, SMB (Netbios), Netbus, Brutus is one of the fastest, most flexible remote password crackers you can get your hands on


Features :

Brutus version AET2 is the current release and includes the following authentication types

  • HTTP (Basic Authentication)
  • HTTP (HTML Form/CGI)
  • POP3
  • FTP
  • SMB
  • Telnet

The current release includes the following functionality :

  • 60 simultaneous target connections
  • No username, single username and multiple username modes
  • Password list, combo (user/password) list and configurable brute force modes
  • Highly customisable authentication sequences
  • Load and resume position
  • Import and Export custom authentication types as BAD files seamlessly
  • SOCKS proxy support for all authentication types
  • User and password list generation and manipulation functionality
  • HTML Form interpretation for HTML Form/CGI authentication types
  • Error handling and recovery capability inc. resume after crash/failure.

Download:

Brutus Password Cracker Tutorial:
In the following video . Most3vilone shows us How to crack Telnet passwords using Brutus
http://www.youtube.com/watch?v=XD7_6Tyz8AI&feature=player_embedded


Other types such as IMAP, NNTP, NetBus etc... are freely downloadable from this site and simply imported into your copy of Brutus. You can create your own types or use other peoples.
You can download Brutus Password Cracker From Here.

John The Ripper Tutorial


I wrote this tutorial as best I could to try to explain to the newbie how to operate JTR. Remember, this is a newbie tutorial, so I wont go into detail with all of the features. JTR is a program that decyrpts Unix passwords using DES (Data Encryption Standard).

The Process 

  • Step 1: Download JTR
  • Step 2: Extract JTR. In windows use winzip. In unix type 
tar -xzf john-1.6.tar.gz 
  • In windows open the command prompt. Go to the Start menu, click Run, type 'command' (no quotes) and press enter. 
You with me? Good. Go to whatever directory to have JTR in. Type 'john' and press enter. A whole list of options will come up:

John the Ripper Version 1.6 Copyright (c) 1996-98 by Solar Designer


Usage: /WINDOWS/DESKTOP/JTR/JOHN-16/RUN/john [OPTIONS] [PASSWORD-FILES]
-single "single crack" mode
-wordfile:FILE -stdin wordlist mode, read words from FILE or stdin
-rules enable rules for wordlist mode
-incremental[:MODE] incremental mode [using section MODE]
-external:MODE external mode or word filter
-stdout[:LENGTH] no cracking, just write words to stdout
-restore[:FILE] restore an interrupted session [from FILE]
-session:FILE set session file name to FILE
-status[:FILE] print status of a session [from FILE]
-makechars:FILE make a charset, FILE will be overwritten
-show show cracked passwords
-test perform a benchmark
-users:[-]LOGIN|UID[,..] load this (these) user(s) only
-groups:[-]GID[,..] load users of this (these) group(s) only
-shells:[-]SHELL[,..] load users with this (these) shell(s) only
-salts:[-]COUNT load salts with at least COUNT passwords only
-format:NAME force ciphertext format NAME
(DES/BSDI/MD5/BF/AFS/LM)
-savemem:LEVEL enable memory saving, at LEVEL 1..3


You wont need most of these options. In fact, you don't really need any of these options. You can simply type 'john
[filename]'. The filename must include the .txt extension. This is the regular crack. It will use bruteforce to decrypt all of the passwords in the file. If you're an impatient ass you can use a word list. This is not as effective but it's quicker (more on that later).

How to make a crackable file: Let's say that for some reason you have a DES encrypted password but no file. If you want to crack it (why else would you be here?) you need to make your own file. Just create a text file and paste in the password. Now put a username (just any old name will do) in front of it with a colon separating the two. It should look something like this:

User:gyuJo098KkLy9 

Save the file as crackme.txt (just an example) and go to the prompt and type 'john crackme.txt' (no quotes obviously). Now you just have to wait.

Options 

Here are a list of the options and what they do.

  • Single: Single crack mode. This is only recommended for weak passwords as it includes only a few rules and a small wordlist. 

Usage: john -single crackme.txt 

  • Wordfile: Uses a wordlist (basically a dictionary attack). What this does is tries every word in the list until it finds a match or you reach the end of the list. This is quicker than the default (bruteforce) attack, but I don't recommend this because it doesn't always find a match. More notes on wordlists below. 

Usage: john -wordfile:password.lst crackme.txt 

  • Rules: Lets you define the rules for using wordlists. I don't use wordlists, so if you want to use this option I wont help you. Ok, ok, I'm just lazy. Shoot me. 
  • Incremental: I like this method. It allows you to do a bruteforce attack 
under certain modes.

Usage: john -incremental:alpha crackme.txt (only letters)
       john -incremental:digits crackme.txt (only numbers)
       john -incremental:lanman crackme.txt (letters, numbers, and some special characters)
       john -incremental:all crackme.txt (all characters) 

  • External: This is a little complicated, so if you are lame don't mess with it. Basically this calls the options that are defined in the configuration settings. You can change these yourself, but I wouldn't recommend it unless you know what you're doing. No, I wont tell you how, go away. 

Usage: john -external:[MODE] crackme.txt (replace MODE with whatever the
name of your mode is). 

  • Restore: Ok, let's say that you need to stop the crack in the middle. Press crtl+break. A file will be created in the JTR directory named 'restore' (no quotes doofus, and yes, no file extention). You can start the crack back up from that restore point. If you used the-session option you probably have a different filename. 

Usage: john -restore:restore 

  • Session: Use this if you know that you will have to stop JTR in the middle of a crack. It allows you to create a new file that holds the data of your session. You can then restore your session later. 

Usage: john -session:[save to filename] crackme.txt 

  • Status: Shows how far you got before stoping a crack (provided you used the -session option). 

Usage: john -status:[filename] 

  • Show: Shows how many passwords have been cracked in a file and how many are left. 

Usage: john -show crackme.txt 

  • Test: Shows how fast JTR will work on your computer. 

Usage: john -test 

  • Users: Cracks the password only for the user or users you tell it to. 

Usage: john -users:User crackme.txt 

  • Groups: Cracks the passwords only for the group or groups you tell it to. 

Usage: john -group:lamers crackme.txt 

  • Shells: Cracks the passwords only for the shell or shells you tell it to. 

Usage: john -shells:shelly crackme.txt 

  • Salts: Cracks the salts that have at least the number of passwords you specify. 

Usage: john -salts:2 crackme.txt 

  • Format: JTR can decrypt many from many different formats, not just DES (but this is the most widely used one). Use this to force JTR to try a certain format. 

Usage: john -format:DES crackme.txt (force DES)
       john -format:BSDI crackme.txt (force BSDI)
       john -format:MD5 crackme.txt (force MD5)
       john -format:BF crackme.txt (force BF)
       john -format:AFS crackme.txt (force AFS)
       john -format:LM crackme.txt (force LM) 

  • Savemem: this tells JTR to automatically save your process at whatever 
level you specify from one to three.

Usage: john -savemem:1 crackme.txt (save at level 1)
       john -savemem:2 crackme.txt (save at level 2)
       john -savemem:3 crackme.txt (save at level 3) 



How to use a wordlist with JTR: I'll assume you already have a wordlist in the JTR directory (it comes with password.lst, if you want to make your own I'll tell you how later). Go to the prompt and type 'john -wordfile:password.lst crackme.txt' (no quotes, damnit). If the password is in the wordlist, it will work. Otherwise, you deserve it for
using a wordlist when you have bruteforce capabilities, shame on you.

How to create a wordlist to use with JTR: First I will include a few lines of the wordlist supplied with JTR:

#!comment: Common passwords, compiled by Solar Designer.
12345
abc123
password
passwd
123456 


The top line is a comment (duh). If you want to make a comment in your wordlist just follow the example. The other lines are passwords that the program will try when you use the wordlist. Put each password on a new line. In the event that you are too lazy to write your own wordlist you can download one (once again, I'm far too lazy to give you a link). It may or may not already be the right file format (.lst). If it isn't, just go to the prompt. Assuming the filename is lazy.txt, type 'rename lazy.txt lazy.lst'
Piping Output: Remember the -show option? You can get JTR to save that
output to a file. Just type 'john -show crackme.txt > crackinfo.txt'
There's my guide.



FAQ:


Q: Can I mix options? 
A: Yes, certain options can be mixed. You can mix options as long asthey don't clash. Play around with it a while. 


Q: What does "Loaded 0 passwords" mean?
A: There was a problem with either your password file or the syntax of your command. If you force BF decryption when your file has DES encryption it wont work. If your password file isn't made right it wont work. 


Q: What does "Password files required, but none specified" mean? 
A: Can you read? You can't just tell JTR to crack, you need to give it a file.


Q: What does "Unknown cyphertext format name requested" mean? 
A: When you use the -format option you need to check that you typed the name of the format correctly. 


Q: How come when I typed 'john -users: login|uid crackme.txt' (which by the way is the usage shown in the list of option by JTR) I received this error:
Option requires a parameter: "-users:"

Bad command or file name 

A: The piping symbol you used (|) can mean two different things. In this case in means 'or'. You're supposed to use login OR uid. When you type it in a dos window, you are running two separate commands. 

Q: Can I speed up the bruteforce? 
A: Sure, just toss that old ass box of yours and get a new one. 



Password Cracking Tools

Here i will list out some of the best password cracking tools


Cain and Abel

The top password recovery tool for Windows. This Windows-only password recovery tool handles an enormous variety of tasks. It can recover passwords by sniffing the network, cracking encrypted passwords using Dictionary, Brute-Force and Cryptanalysis attacks, recording VoIP conversations, decoding scrambled passwords, revealing password boxes, uncovering cached passwords and analyzing routing protocols.
Home: http://www.oxid.it 
Latest Release: cain & abel v4.9.23 
Download: http://www.oxid.it/cain.html


John the Ripper

A powerful, flexible, and fast multi-platform password hash cracker. John the Ripper is a fast password cracker, currently available for many flavors of Unix, DOS, Win32, BeOS, and OpenVMS. Its primary purpose is to detect weak Unix passwords. It supports several crypt(3) password hash types which are most commonly found on various Unix flavors, as well as Kerberos AFS and Windows NT/2000/XP LM hashes. Several other hash types are added with contributed patches.
Home: http://www.openwall.com 
Latest Release: John the Ripper 1.7 
Download: http://www.openwall.com/john/


THC Hydra

A Fast network authentication cracker which support many different services. When you need to brute force crack a remote authentication service, Hydra is often the tool of choice. It can perform rapid dictionary attacks against more then 30 protocols, including telnet, ftp, http, https, smb, several databases, and much more.
Home: http://www.thc.org 
Latest Release: THC-Hydra v5.4 
Download: http://freeworld.thc.org/thc-hydra/


L0phtcrack

Windows password auditing and recovery application
L0phtCrack, also known as LC5, attempts to crack Windows passwords from hashes which it can obtain (given proper access) from stand-alone Windows NT/2000 workstations, networked servers, primary domain controllers, or Active Directory. In some cases it can sniff the hashes off the wire. It also has numerous methods of generating password guesses (dictionary, brute force, etc).
Home: Not Available 
Latest Release: L0phtcrack v5.04 
Download: http://download.insecure.org/stf/lc5-setup.exe 
http://download.insecure.org/stf/lc5-crack.zip (keygen)


Pwdump


Windows password recovery tool. Pwdump is able to extract NTLM and LanMan hashes from a Windows target, regardless of whether Syskey is enabled. It is also capable of displaying password histories if they are available. It outputs the data in L0phtcrack-compatible form, and can write to an output file.
Home: http://www.foofus.net/fizzgig/pwdump 
Latest Release: pwdump6 version 1.7.2 
Download: http://swamp.foofus.net/fizzgig/pwdump/downloads.htm


RainbowCrack


An Innovative Password Hash Cracker. The RainbowCrack tool is a hash cracker that makes use of a large-scale time-memory trade-off. A traditional brute force cracker tries all possible plaintexts one by one, which can be time consuming for complex passwords. RainbowCrack uses a time-memory trade-off to do all the cracking-time computation in advance and store the results in so-called "rainbow tables". It does take a long time to precompute the tables but RainbowCrack can be hundreds of times faster than a brute force cracker once the precomputation is finished.
Home: http://www.antsight.com 
Latest Release: rainbowcrack v1.2 
Download: http://www.antsight.com/zsl/rainbowcrack/


Brutus


A network brute-force authentication cracker This Windows-only cracker bangs against network services of remote systems trying to guess passwords by using a dictionary and permutations thereof. It supports HTTP, POP3, FTP, SMB, TELNET, IMAP, NTP, and more.
Home: http://www.hoobie.net 
Latest Release: brutus-aet2 
Download: http://www.hoobie.net/brutus/brutus-download.html

Basics of Pasword Cracking

To become a good hacker you need to be a good password cracker .There are a variety of programs that a hacker uses to decrypt or guess a password. There are a wide variety of different types of password hacking programs but the most common methods include the following types of attacks:

Dictionary Attacks

A dictionary attack works on the premise that most computer users choose a password that is easy for them to remember so they do not have to worry about memorizing or forgetting their passwords. Dictionary attack programs use all of the words in the dictionary to try and guess your password. This includes variations of the word and different word combinations. The program will keep trying different words and combinations until it comes up with the right password.

Brute Force Attack

A brute force attack works just like the name implies. This type of attack uses brute force by using a program that keeps attempting every password that is possible until it hits the right one. Brute force attacks take a long time to execute especially if the passwords are long and contain a lot of different combinations.If you use a password cracking calculator to determine how long it will take to decrypt the password you have chosen with a password hacking program, you will find that it can be anywhere from 10 minutes to several months depending upon the complexity of the password.

I hope you understood the basic methods of password cracking In my next post i will explain some of the basic tools used for password cracking and how to use them