(August 11, 2022, 05:12 PM)darkhero77 Wrote: i have these files that i encrypted using luks a couple of years ago. and now i cannot seem to remember the passphrase/password. is there a way to bruteforce it?
with Pexpect module
passparts = [["t", "T"], ["h"], ["e", "3"], ["_", ""], ["p"], ["a", "4"], ["s"], ["s"]]
possibilities = itertools.product(*passparts)
for x in possibilities:
possible = "".join(x)
print possible
child = pexpect.spawn('udisksctl unlock -b /dev/sdc2')
child.logfile = open("/tmp/mylog", "w")
child.expect(".*")
child.sendline(possible)
child.expect(".*")
print(child.before)
child.expect(pexpect.EOF, timeout=None)
print child.before
print child.after