Results 1 to 9 of 9

Thread: Can I mix the contains of two wordlist files together?

Hybrid View

  1. #1
    Just burned his ISO
    Join Date
    Jun 2009
    Posts
    14

    Default Can I mix the contains of two wordlist files together?

    I am using crunch to generate wordlists, but I want to mix the contains of two of my wordlist files, can I do that using some kind of program? You know that no one want to do that manually......

  2. #2
    Very good friend of the forum Gitsnik's Avatar
    Join Date
    Jan 2010
    Location
    The Crystal Wind
    Posts
    851

    Default

    Try a combination of "cat" and "sort -u" (others will tell you "sort | uniq").

    If you seriously can't work it out from there come back to us.
    Still not underestimating the power...

    There is no such thing as bad information - There is truth in the data, so you sift it all, even the crap stuff.

  3. #3
    Just burned his ISO
    Join Date
    Jun 2009
    Posts
    14

    Default

    Quote Originally Posted by Gitsnik View Post
    Try a combination of "cat" and "sort -u" (others will tell you "sort | uniq").

    If you seriously can't work it out from there come back to us.
    Thank you Gitsnik, But the combination I mean is for example, there are dict A and dict B. Dict A got "a b c" in it, and dict B got "1 2 3" in it. after mix I got a dict C, which is contain "a1 a2 a3 b1 b2 b3 c1 c2 c3 1a 2a 3a...................." can "cat" and "sort -u" achieve this?

  4. #4
    Very good friend of the forum Gitsnik's Avatar
    Join Date
    Jan 2010
    Location
    The Crystal Wind
    Posts
    851

    Default

    Quote Originally Posted by voochee View Post
    can "cat" and "sort -u" achieve this?
    Strictly no, but then you're not necessarily doing something many people would elect to do.

    The following code I literally just hacked up in this reply panel, I haven't tested it nor will I provide support on it. It contains only very basic perl code, so if you can not read it I suggest you do one of those "learn perl in 24 hours" courses and then figure it out from there.

    The essence of the code is: read a line from file 1, read a line from file 2, as you read each character from file 1, insert the same character (position) from file 2 and print it out.

    Assuming no typo's and that I understood you properly this time around, it should do what you wish, again - no willingness to provide support.

    Code:
    #!/usr/bin/perl
    
    open(FILE_ONE, "fileone.txt");
    open(FILE_TWO, "filetwo.txt");
    while($f1l = <FILE_ONE>) {
      $f2l = <FILE_TWO>;
      chomp($f1l);
      chomp($f2l);
      my @f1a = split //, $f1l;
      my @f2a = split //, $f2l;
      my $i = 0;
      foreach my $char (@f1a) {
        print $char, $f2a[$i];
        $i += 1;
      }
      print "\n";
    }
    close(FILE_ONE);
    close(FILE_TWO);
    Still not underestimating the power...

    There is no such thing as bad information - There is truth in the data, so you sift it all, even the crap stuff.

  5. #5
    Just burned his ISO
    Join Date
    Jun 2009
    Posts
    14

    Default

    Quote Originally Posted by Gitsnik View Post
    Strictly no, but then you're not necessarily doing something many people would elect to do.

    The following code I literally just hacked up in this reply panel, I haven't tested it nor will I provide support on it. It contains only very basic perl code, so if you can not read it I suggest you do one of those "learn perl in 24 hours" courses and then figure it out from there.

    The essence of the code is: read a line from file 1, read a line from file 2, as you read each character from file 1, insert the same character (position) from file 2 and print it out.

    Assuming no typo's and that I understood you properly this time around, it should do what you wish, again - no willingness to provide support.

    Code:
    #!/usr/bin/perl
    
    open(FILE_ONE, "fileone.txt");
    open(FILE_TWO, "filetwo.txt");
    while($f1l = <FILE_ONE>) {
      $f2l = <FILE_TWO>;
      chomp($f1l);
      chomp($f2l);
      my @f1a = split //, $f1l;
      my @f2a = split //, $f2l;
      my $i = 0;
      foreach my $char (@f1a) {
        print $char, $f2a[$i];
        $i += 1;
      }
      print "\n";
    }
    close(FILE_ONE);
    close(FILE_TWO);
    Thank you very much, I will learn perl in the next 24 hours

  6. #6
    Very good friend of the forum Virchanza's Avatar
    Join Date
    Jan 2010
    Posts
    863

    Default

    This looks like fun, I'm gonna give it a go in C++:

    Code:
    #include <iostream>    /* cout, endl */
    #include <fstream>     /* ifstream */
    #include <string>      /* string */
    using std::cout;
    using std::endl;
    using std::ifstream;
    using std::string;
    
    int main(int argc, char **argv)
    {
        if ( 3 != argc )
        {
            cout << "Usage: " << argv[0] << " in1.txt in2.txt > out.txt" << endl;
            return 0;
        }
    
        ifstream a( argv[1] ); /* Open the first file */
    
        if ( !a.is_open() )
        {
            cout << "Could not open " << argv[1] << endl;
            return 0;
        }
    
        string str_a;
    
        while ( a >> str_a )
        {
            string str_b;
    
            ifstream b( argv[2] );
    
            if ( !b.is_open() )
            {
                cout << "Could not open " << argv[2] << endl;
                return 0;
            }
    
            while ( b >> str_b )
            {
                cout << str_a << str_b << endl;
            }
        }
    }
    Compile as follows:

    Code:
    g++ concat.cpp -D NDEBUG -s -O3 -o concat
    And run as follows:

    Code:
    ./concat in1.txt in2.txt > out.txt
    Ask questions on the open forums, that way everybody benefits from the solution, and everybody can be corrected when they make mistakes. Don't send me private messages asking questions that should be asked on the open forums, I won't respond. I decline all "Friend Requests".

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •