Piping python output into hashcat continuously
#1
Hi everybody!

I have a python script that outputs password candidates in batches, similar to this:
Code:
import time
for i in range(10):
    for j in range(10):
        print(str(i)+str(j))
    time.sleep(1)

When writing the output to a file
Code:
python generate.py > out.txt
the out.txt file is created immediately and continuously written into until the script finishes.

I want to pipe the output directly into hashcat:
Code:
python generate.py | hashcat -a 0 --stdout --outfile out.txt

However hashcat starts and then idles until generate.py has completed. Outfile out.txt only gets created after the python script has run completely.

Compare to princeprocessor:
Code:
./pp64.bin input.txt | hashcat -a 0 --stdout --outfile out.txt
creates out.txt before princeprocessor has finished and continuously writes into out.txt.


How do I make my python script feed into hashcat continuously?

I already tried
Code:
import time
import sys
for i in range(10):
    for j in range(10):
        print(str(i)+str(j))
    sys.stdout.flush()
    time.sleep(1)

which did not help.
Reply


Messages In This Thread
Piping python output into hashcat continuously - by defaultusername - 12-16-2020, 01:20 PM