Using Z3
Microsoft's Theorem Prover
What is Z3?
Installing Z3
$ git clone https://github.com/Z3Prover/z3
$ cd z3
$ python3 scripts/mk_make.py
$ cd build
$ make
$ sudo make install$ pip install z3-solverUsing Z3
if ord(password[0]) != 48
or password[11] != '!'
or ord(password[7]) != ord(password[5])
or 143 - ord(password[0]) != ord(password[4])
or ord(password[1]) ^ ord(password[3]) != 30
or ord(password[2]) * ord(password[3]) != 5610
or password[1] != 'p'
or ord(password[6]) - ord(password[8]) != -46
or ord(password[6]) ^ ord(password[7]) != 64
or ord(password[10]) + ord(password[5]) != 166
or ord('n') - ord(password[9]) != 1
or password[10] != str(3):
print('Sorry, the password is incorrect.')
else:
print(f"Well Done! HTB{{{password}}}")Last updated
Was this helpful?