Results 1 to 5 of 5

Thread: Quick Bash question(s)

  1. #1
    Just burned his ISO
    Join Date
    Mar 2009
    Posts
    3

    Default Quick Bash question(s)

    Long time lurker, this may/may not be my first post here.

    If I generated a text file in crunch and ran

    sed '$!d' testdoc

    (testdoc being my wordfile), it will display the last line in the wordfile. How can I load this into a bash variable like, say, $lastword.

    Also, I'm having trouble with john reading from stdin from crunch's stdout. Can anyone show me the proper syntax? My last attempt looked like this:

    Code:
    #/pentest/passwords/crunch/crunch 1 4 | ./john --stdin --format=NT /home/jon/testhash.txt
    I got many lines with "Error: no such instruction 'eaq'" going up incrementally

    Thankyou, guys

    [edit] I should say I was already in /usr/bin/ when I ran the above code

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

    Default

    Quote Originally Posted by McVonstein View Post
    Long time lurker, this may/may not be my first post here.

    If I generated a text file in crunch and ran

    sed '$!d' testdoc

    (testdoc being my wordfile), it will display the last line in the wordfile. How can I load this into a bash variable like, say, $lastword.

    Also, I'm having trouble with john reading from stdin from crunch's stdout. Can anyone show me the proper syntax? My last attempt looked like this:

    Code:
    #/pentest/passwords/crunch/crunch 1 4 | ./john --stdin --format=NT /home/jon/testhash.txt
    I got many lines with "Error: no such instruction 'eaq'" going up incrementally

    Thankyou, guys

    [edit] I should say I was already in /usr/bin/ when I ran the above code
    LASTWORD=`tail -n 1 testfile.txt`

    What does crunch show you if you run it on its own (i.e. is it john printing the error, or is it crunch - probably john but just to be sure).
    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
    Mar 2009
    Posts
    3

    Default

    Thanks for the quick reply!

    Crunch on its own just displays the selected output, i.e.

    Code:
    ./crunch 1 3 a
    would just display

    a
    aa
    aaa

    I'm fairly sure the problem is on john's side, or my inability to ever use pipes properly.

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

    Default

    Ok, probably is with john, try it with an echo statement (or maybe a "cat file.txt" where the file has your password in it) just to be sure the pipe works normally, as well as trying it with the wordlist rather than stdin.

    Basically, we're just going through the motions to figure out if the error is across the board.
    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
    Mar 2009
    Posts
    3

    Default

    Odd...

    I went and compiled both john and crunch on my laptop and put them into $PATH

    The hashed password is 'test', and test.txt just contained the word 'test'

    Code:
    echo test | john --stdin --format=NT hash.txt
    
    cat test.txt | john --stdin --format=NT hash.txt
    The above worked fine. I ran

    Code:
    crunch 1 4 | john --stdin --format=NT hash.txt
    again, and it worked fine!

    When I got the error before, it was on an installed Backtrack 4 on my netbook. I'll see if I can reproduce the error on it in a few hours

Posting Permissions

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