I'm working on a program that I need to brute force with a 4 pin number in order to get a flag. This is for some Cybersecurity challenges. I was able to create a python script that will print every combination of 4 digits number. However, I don't know how can I pass that as an argument to the program that I need to brute-force.
I am using Kali linux to run the program and create the script.
#!/usr/bin/python
from itertools import product
numbers = '0123456789' # chars to look for
for length in range(1, 3): # only do lengths of 1 + 2
to_attempt = product(chars, repeat=4)
for attempt in to_attempt:
print(''.join(attempt))
Any thoughts on how can I pass those results as an argument to the program?