Remote Exploit Forums

Go Back   Remote Exploit Forums > Specialist Topics > Programming


Programming A place for our community to discuss their own security related coding projects.

   

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-18-2009, 05:44 AM
Junior Member
 
Join Date: Jan 2009
Posts: 26
Default Coding bruteforce dictionary generator

Hello all
I am trying to build a dictionary generator in C++ but am alittle lost with the theory so I am hoping I can pick on other peoples brains.
Anyway, I want to generate a file that will have a password length of 6 and generate all possible values from 0-9 and a-z. The only way I can think of doing this is by using a multidimensional array but that'll be really long winded and complex. Does anyone have any suggestions on approach?
Reply With Quote
  #2 (permalink)  
Old 09-18-2009, 09:19 AM
Senior Member
 
Join Date: Jun 2008
Posts: 378
Default

Code:
changed ifs

char ascii[40] = {"abcdefgh012345678"};

c++;
if(c == 35) {
    c=0;
    c1++;
}
if(c1 == 35) {
   c1=0;
   c2++;
}

temp[0] = ascii[c];
temp[1] = ascii[c1];
temp[2] = ascii[c2];

or

embed fors

for(c=0;c<=35;c++) {
    for(c1=0;c1<=35;c1++) {
        for(c2=0;c2<=35;c2++) {
             temp[2]=ascii[c2];
             temp[1] = ascii[c1];
              temp[0] = ascii[c];
        }

   }


}


fputs(temp,out);
fputs("\n",out);
hope it helps

Last edited by compaq; 09-18-2009 at 09:29 AM.
Reply With Quote
  #3 (permalink)  
Old 09-18-2009, 12:18 PM
Gitsnik's Avatar
Senior Member
 
Join Date: Jun 2009
Location: The Crystal Wind
Posts: 637
Default

compaq's code is a good start, but let's invest some time in making it a little more robust - I'll butcher C and make some complex pseudocode:
Code:
i = 5;
char buffer[i];
for(j = 0; j < i; j++) {
  buffer[j] = 'a';
}
// that has our buffer seated properly - we'll start with all 'a' characters, though technically '\0' would work

for(j = 0; j < i; j++) {
  for(k = 0; k < 26; k++) {
    buffer[j] = ascii[k];
    printf("%s\n", buffer);
  }
}
The bonus here is, if my logic is straight (I'm fairly wrecked lately from overworking), the number of characters is not hard coded into your algorithym - the idea is we start with a string x wide, and just flip characters in and out of it.

Actually after typing all that, I'm really hoping it's right
__________________
Never underestimate the power of human stupidity - it is like a force of nature, capable of destroying even the most well laid plans.
Reply With Quote
  #4 (permalink)  
Old 09-18-2009, 09:51 PM
Senior Member
 
Join Date: Jun 2008
Posts: 378
Default

Quote:
The bonus here is, if my logic is straight (I'm fairly wrecked lately from overworking), the number of characters is not hard coded into your algorithym - the idea is we start with a string x wide, and just flip characters in and out of it.
Alot nice code

your code would be something like this

Code:
memset(buffer,"a",sizeof(buffer));

for(j=0;j<=i;j++) {
temp=j;
     for(k=0;k<=26;k++) {
	buffer[j] = ascii[k];
	for(h=0;h<=(temp-1);h++) {
                  for(i=0;i<=26;i++) {
                      buffer[j-h] = ascii[k];
                   }
	} 
      printf("%c\n",buffer);		
}


}
Reply With Quote
  #5 (permalink)  
Old 09-19-2009, 09:42 PM
Senior Member
 
Join Date: Dec 2007
Location: Outside Chicago, IL
Posts: 294
Default

Just use crunch. You can find it at:
https://crunch-wordlist.svn.sourcefo...ordlist/trunk/
__________________
I like the bleeding edge, but I don't like blood loss.
Reply With Quote
  #6 (permalink)  
Old 10-06-2009, 10:39 AM
Junior Member
 
Join Date: Oct 2009
Posts: 6
Default bruteforce 0.08, wordlist creator

youtube.com/watch?v=QQuxLfTb4B8
features:
set number of words to output;
maximum numbers of chars to reach;
start word;
end word;
log last 500000 word, when importing words in pyrit from stdin, you can interrupt and resume later;
write to stdout, so you can write or not in an outfile;
implement my algorithm to skip useless words!
ex:
to find the word 'acqua' it skips 19625 words, is 3.76% for 5 chars

to print 6 to 8 chars wordlist just use:
bruteforce -p aaaaaa -m 9
to print fixed 24 chars wordlist just use:
bruteforce -p aaaaaaaaaaaaaaaaaaaaaaaa -m 25

i've to host the binary somewhere to share with others, but, for now what do you think?
Reply With Quote
  #7 (permalink)  
Old 10-18-2009, 01:26 AM
Zermelo's Avatar
Member
 
Join Date: May 2007
Posts: 53
Default

Here is my reinvention of the wheel, very simple code:

Create a wordlist of only numbers
Reply With Quote
  #8 (permalink)  
Old 10-20-2009, 06:15 PM
New Member
 
Join Date: Oct 2009
Posts: 1
Default

Hi i was looking over the internet for some information about dictionaries i coded mine and am still testing it im having a bit trouble with it it keeps on getting me a error if this can help any of you mine is done with Msword VB editor.

the error that i get is:

Quote:
Run-Time Error '4605':

this methode or property is not available because there is a memory or disk problem.

Code:
Private Sub CommandButton1_Click()
'Word Generator for use as dictionary
'by Brian Forest
'
'

Dim L1, L2, L3, L4, L5, L6, L7, L8, L9, Word As String
Dim IntL1, IntL2, IntL3, IntL4, IntL5, IntL6, IntL7, IntL8, IntL9 As Integer

L1 = ""
L2 = ""
L3 = ""
L4 = ""
L5 = ""
L6 = ""
L7 = ""
L8 = ""
L9 = ""
Word = ""

IntL1 = 32
IntL2 = 31
IntL3 = 31
IntL4 = 31
IntL5 = 31
IntL6 = 31
IntL7 = 31
IntL8 = 31
IntL9 = 31

Gen:
    If IntL9 > 217 Then
        IntL8 = IntL8 + 1
        IntL9 = 0
    End If
    If IntL8 > 218 Then
        IntL7 = IntL7 + 1
        IntL8 = 32
    End If
    If IntL7 > 218 Then
        IntL6 = IntL6 + 1
        IntL7 = 32
    End If
    If IntL6 > 218 Then
        IntL5 = IntL5 + 1
        IntL6 = 32
    End If
    If IntL5 > 218 Then
        IntL5 = 32
        IntL4 = IntL4 + 1
    End If
    If IntL4 > 218 Then
        IntL4 = 32
        IntL3 = IntL3 + 1
    End If
    If IntL3 > 218 Then
        IntL3 = 32
        IntL2 = IntL2 + 1
    End If
    If IntL2 > 218 Then
    IntL2 = 32
    IntL1 = IntL1 + 1
    End If

Do Until IntL9 = 218
        IntL9 = IntL9 + 1
'    For IntL9 = 32 To 255
        'debut de la composition des mots

        'choix des letres
        L8 = Chr(IntL8)
        L7 = Chr(IntL7)
        L6 = Chr(IntL6)
        L5 = Chr(IntL5)
        L4 = Chr(IntL4)
        L3 = Chr(IntL3)
        L2 = Chr(IntL2)
        L1 = Chr(IntL1)
        L9 = Chr(IntL9)
        '
        'structuration du mot
        Word = L1 & L2 & L3 & L4 & L5 & L6 & L7 & L8 & L9
        '
        'Ecrit du mot sur Document
        Selection.TypeText Text:=Word & "    "

Loop        '
'    Next
    'renvoie de la boucle si la longeur nest pas atteinte
    If IntL1 < 218 Then GoTo Gen


End Sub
Reply With Quote
  #9 (permalink)  
Old 10-25-2009, 04:16 PM
B@Rz-'s Avatar
Member
 
Join Date: Jun 2009
Posts: 56
Wink

Omg

I just coded it this week on c++!

Here it is the download link

SourceForge - WLGen

If you have any question/suggestion, please send me a pm

0.2.2 out! (2009/11/02)

[I discovered a small but absolutely relevant bug in 0.2.2:
in file wlgen.cpp, line 100 you have to substitute

charlist=new char[charlist_dim];

with

charlist=new char[charlist_dim+1];

I hope my code have been useful to someone]

when I'll have some free time, I'll add something new:
1) it will be possible to split the "big wordlist" in smaller ones, with a defined by user number of lines;
2) it will be possible to define the starting and the ending words of the dictionary (the WLGen will generate only the words inside the range).

Last edited by B@Rz-; 12-07-2009 at 06:17 PM.
Reply With Quote
  #10 (permalink)  
Old 12-03-2009, 06:26 PM
Junior Member
 
Join Date: Oct 2009
Posts: 6
Default bruteforge 0.10_rc1, a wordlist generator

friends, bruteforge 0.10_rc1 is a wordlist generator that implements algorithms to skip forward, there is a video showing features on my youtube channel.
features char's repetitions match, starting and ending word, number of chars to reach, match testing, length of consecutive chars to match, custom or predefinied charset, consecutive numbers in six group of four rule.
give it an eye and report any suggestions if you think that sounds interesting;
linux elf hosted on mz03.netfirms.com.

update: rewritten version in python at the blog,
76000 words/s, unique char composing, custom patterns importing, promising

Last edited by masterzorag; 01-22-2010 at 01:57 AM. Reason: new version
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 03:53 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2