StackOverFlow1132
StackOverFlow1132

Reputation: 35

Modify output from Stdout and redirect

I am using John the Ripper, an application that outputs a generated password line by line. I want to make a bash script that takes the output of each line and apply "md5sum" to it and print it out.

For example:

$ ./john --wordlist=password.lst -rules:Single
12346
fdgh
sdfdfj
test
password1234
...

and so on... (really fast)

I want to take each line and apply md5sum to each line.

$ md5sum <<< "12346"
f447b20a7fcbf53a5d5be013ea0b15af   -

Upvotes: 0

Views: 320

Answers (1)

KamilCuk
KamilCuk

Reputation: 142080

Use

command | while IFS= read -r l; do md5sum <<<"$l"; done

or simpler with xargs (or not simpler):

command | xargs -n1 sh -c 'md5sum <<<"$1"' --

where command is your ./john --wordlist=password.lst -rules:Single command.

Upvotes: 2

Related Questions