Skip to content

Instantly share code, notes, and snippets.

@mrdmnd
Created August 12, 2012 08:57

Revisions

  1. @invalid-email-address Anonymous created this gist Aug 12, 2012.
    19 changes: 19 additions & 0 deletions kpbreaker.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    import sys
    sys.path.append("./python-keepass/python")
    from keepass import kpdb
    byte_strings = [hex(x)[2:].rjust(2, '0').lower() for x in range(255)]
    pass_template = "%s3b140a6ec5%sec"
    num_tried = 0
    for s1 in byte_strings:
    for s2 in byte_strings:
    tmp_pw = pass_template % (s1, s2)
    num_tried += 1
    if num_tried % 1000 == 0:
    print 'Trying %s, attempt # %s' % (tmp_pw, num_tried)
    try:
    db = kpdb.Database("/home/ec2-user/3hzd3ob2wBBeMsmkUW1AHZH78TlgL1UMBVBL07mY.kdbx", tmp_pw)
    print db
    break
    except IOError:
    continue
    ~