Results 1 to 10 of 11

Thread: Crunch dictgen + Special characters (namely ! ")

Hybrid View

  1. #1
    Very good friend of the forum TAPE's Avatar
    Join Date
    Jan 2010
    Location
    Europe
    Posts
    599

    Default Crunch dictgen + Special characters (namely ! ")

    Hey guys,


    I have been going nuts trying to get something to work, for the life of me I can't figure out what I am doing wrong.

    I am working with the BT3F version of crunch, and am trying to get a simple wordlist with special characters.
    I have not had any difficulties using crunch before, but was then basically only using alpha-numeric.

    Code I was trying was similar to the below but including more special characters;

    Code:
    pentest/password/crunch 4 4 0123456789!@#$%^&*() &> test.txt
    result;
    -bash:!@#$%^: event not found
    
    so tried with "
    Code:
    pentest/password/crunch 4 4 "0123456789!@#$%^&*()" &> test.txt
    result;
    -bash:!@#$%^: event not found
    
    alas

    Removed the !
    Code:
    pentest/password/crunch 4 4 "0123456789@#$%^&*()" &> test.txt
    Success.

    Removing the inverted commas resulted in
    -bash: syntax error near unexpected token '&>'

    So basically would appreciate some pointers on what I am missing to be able to include the characters ! + "


    I am sure its something silly however after looking through the posts on crunch on the forums and finding bitterly little info on the net..
    turning to the pro's once more !

  2. #2
    Senior Member streaker69's Avatar
    Join Date
    Jan 2010
    Location
    Virginville, BlueBall, Bird In Hand, Intercourse, Paradise, PA
    Posts
    3,535

    Default

    Don't you need to escape those characters?

    http://steve-parker.org/sh/escape.shtml
    A third party security audit is the IT equivalent of a colonoscopy. It's long, intrusive, very uncomfortable, and when it's done, you'll have seen things you really didn't want to see, and you'll never forget that you've had one.

  3. #3
    Very good friend of the forum TAPE's Avatar
    Join Date
    Jan 2010
    Location
    Europe
    Posts
    599

    Default

    Ahh...

    I shall have another go

    Thanks for the info Streaker !

  4. #4
    Member
    Join Date
    Jan 2010
    Posts
    140

    Default

    This worked for me.
    Code:
    # crunch 4 4 '0123456789!@#$%^&*()' &> test.txt

  5. #5
    Very good friend of the forum TAPE's Avatar
    Join Date
    Jan 2010
    Location
    Europe
    Posts
    599

    Default

    Thanks your reply larry,

    I had managed to sort out all other characters with the ' as well, but then unable to use the ' in the charset..

    After trying various combos I decided to leave it for a day and try a bit harder today !

    Thanks for the info though and if you manage to get all chars. in there, pls lemme know !

  6. #6
    Member
    Join Date
    Jan 2010
    Posts
    140

    Default

    Quote Originally Posted by =TAPE= View Post
    I had managed to sort out all other characters with the ' as well, but then unable to use the ' in the charset..
    Well I was playing around with crunch for a few minutes. I was able to get crunch to output the text file with all of the characters using the double quotes. You are right that the exclamation point "!" was the problem character. Using streaker69's advice I was able to escape the exclamation point "!" character with the backslash key "\". I also added the single quote (ie "'") character.
    Code:
    # crunch 4 4 "0123456789\!'@#$%^&*()" &> test.txt
    However, this produced a text file with the unwanted backslash "\" character. Using a simple sed statement I was able to get rid of all lines that contained the backslash character "\" in them. Try this to get the desired result.
    Code:
    # crunch 4 4 "0123456789\!'@#$%^&*()" &> test.txt && sed -i '/\\/d' test.txt
    It looks like the shell bash and the program crunch interpret the backslash differently. Bash ignores the backslash and interprets the exclamation point as a literal character. But crunch interprets the backslash as a literal characther and includes it in its output.

Posting Permissions

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