Click here to Skip to main content
Licence CPOL
First Posted 15 May 2009
Views 25,123
Downloads 2,241
Bookmarked 22 times

Brute Force

By | 15 May 2009 | Article
Brute Force algorithm with MD5 & SHA Hashing

Introduction

This is my attempt to create a brute force algorithm that can use any hash or encryption standard.

Background

Bruteforcing has been around for some time now, but it is mostly found in a pre-built application that performs only one function. My attempt to bruteforcing started when I forgot a password to an archived rar file. I decided to create a bruteforce algorithm that can be used in a plug-and-play manner. At the moment, the basic hashing algorithms (MD5 & SHA) are supported but nothing stops you from using it to brute a Microsoft SQL password (* using pwdencrypt and pwdcompare).

Using the Code

Using the method is straight forward. Set up your character and password array and call the brute() or bruteUI() method.

//Password array
string[] passwordArray;
//Lowercare character array
string[] lower = { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", 
	"n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z" };
//Uppercase character array
string[] upper = { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", 
	"N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z" };
//Digits array
string[] digits = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" }; 

private void setupCharArray()
{
   if (ckhLower.Checked)
   {
      characterArray.AddRange(lower);
   }

   if (chkUpper.Checked)
   {
      characterArray.AddRange(upper);
   }

   if (chkDigits.Checked)
   {
      characterArray.AddRange(digits);
   }
}

private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
{
   brute();
}

Points of Interest

An MD5 and SHA Hash class make it easy to choose a hash type. While your PC is bruting away, a CPU monitor shows you the load on the system.

History

  • 15th May, 2009: Initial post

This is my first attempt to Bruteforcing and like I said it is expandable to many other hash types and encryption standards.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Linoxxis

Software Developer (Senior)
Process Computing Technology
South Africa South Africa

Member



Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
QuestionIt works but you cant use it for like hotmail or something? Pinmemberswerdiofire1:34 13 Nov '11  
GeneralMy vote of 4 Pinmemberc4th0d33:23 8 Oct '11  
GeneralMy vote of 4 PinmemberUhlume10:19 28 Sep '11  
QuestionWrong Average PW/sec Calculation PinmemberMember 81486429:14 9 Aug '11  
GeneralSymmetries PinadminChris Maunder14:51 15 May '09  
GeneralRe: Symmetries PinmemberLinoxxis22:25 3 Dec '09  
Jokewanted to say hi! PinmembereRRaTuM14:22 15 May '09  
GeneralHehe... Pinmemberaxelriet11:50 15 May '09  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Mobile
Web02 | 2.5.120517.1 | Last Updated 15 May 2009
Article Copyright 2009 by Linoxxis
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid