Skip to content

Commit b0095fa

Browse files
authored
Merge pull request #105 from HashPals/popular-API
Added popular function to API
2 parents 3ee08fc + e93dcfc commit b0095fa

8 files changed

+248
-133
lines changed

name_that_hash/check_hashes.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,6 @@ def single_hash(self, chash: str):
3333
chash = base64.b64decode(chash).decode("utf-8")
3434
except:
3535
logging.debug("Failed to base64 decode")
36-
self.output.append(HashTypeObj.HashType(chash, self.nth, self.hashinfo_obj, self.kwargs))
37-
38-
36+
self.output.append(
37+
HashTypeObj.HashType(chash, self.nth, self.hashinfo_obj, self.kwargs)
38+
)

name_that_hash/hash_info.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ def __init__(self):
1616
"CryptoCurrency(PrivateKey)",
1717
"SHA-338",
1818
"Domain Cached Credentials",
19-
"Domain Cached Credentials 2"
19+
"Domain Cached Credentials 2",
2020
]
2121
)

name_that_hash/hashes.py

+142-94
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,7 @@ class HashInfo:
599599
HashInfo(
600600
name="GOST CryptoPro S-Box", hashcat=None, john=None, extended=False
601601
),
602-
HashInfo(name="Blake2b-256", hashcat=None, john=None,extended=False),
602+
HashInfo(name="Blake2b-256", hashcat=None, john=None, extended=False),
603603
HashInfo(name="SHA3-256", hashcat=17400, john=None, extended=False),
604604
HashInfo(name="Skein-256", hashcat=None, john="skein-256", extended=False),
605605
HashInfo(name="Skein-512(256)", hashcat=None, john=None, extended=False),
@@ -1358,7 +1358,10 @@ class HashInfo:
13581358
),
13591359
modes=[
13601360
HashInfo(
1361-
name="Microsoft Office 2010", hashcat=9500, john="office", extended=False
1361+
name="Microsoft Office 2010",
1362+
hashcat=9500,
1363+
john="office",
1364+
extended=False,
13621365
)
13631366
],
13641367
),
@@ -1369,7 +1372,10 @@ class HashInfo:
13691372
),
13701373
modes=[
13711374
HashInfo(
1372-
name="Microsoft Office 2013", hashcat=9600, john="office", extended=False
1375+
name="Microsoft Office 2013",
1376+
hashcat=9600,
1377+
john="office",
1378+
extended=False,
13731379
)
13741380
],
13751381
),
@@ -1440,7 +1446,10 @@ class HashInfo:
14401446
],
14411447
),
14421448
Prototype(
1443-
regex=re.compile(r"^\$oldoffice\$[34]\*[a-f0-9]{32}\*[a-f0-9]{32}\*[a-f0-9]{40}:[a-f0-9]{10}", re.IGNORECASE),
1449+
regex=re.compile(
1450+
r"^\$oldoffice\$[34]\*[a-f0-9]{32}\*[a-f0-9]{32}\*[a-f0-9]{40}:[a-f0-9]{10}",
1451+
re.IGNORECASE,
1452+
),
14441453
modes=[
14451454
HashInfo(
14461455
name=u"MS Office ⇐ 2003 $3, SHA1 + RC4, collider #2",
@@ -1627,188 +1636,225 @@ class HashInfo:
16271636
hashcat=18200,
16281637
john="krb5pa-sha1",
16291638
extended=False,
1630-
description="Used for Windows Active Directory"
1631-
)
1639+
description="Used for Windows Active Directory",
1640+
)
16321641
],
16331642
),
16341643
Prototype(
1635-
regex=re.compile(r"^\$krb5tgs\$17\$[^$]{1,512}\$[^$]{1,512}\$[^$]{1,4}?\$?[a-f0-9]{1,32}\$[a-f0-9]{64,40960}$", re.IGNORECASE),
1644+
regex=re.compile(
1645+
r"^\$krb5tgs\$17\$[^$]{1,512}\$[^$]{1,512}\$[^$]{1,4}?\$?[a-f0-9]{1,32}\$[a-f0-9]{64,40960}$",
1646+
re.IGNORECASE,
1647+
),
16361648
modes=[
16371649
HashInfo(
16381650
name="Kerberos 5 TGS-REP etype 17 (AES128-CTS-HMAC-SHA1-96)",
16391651
hashcat=19600,
16401652
john=None,
16411653
extended=False,
1642-
description="Used for Windows Active Directory"
1643-
)
1654+
description="Used for Windows Active Directory",
1655+
)
16441656
],
16451657
),
16461658
Prototype(
1647-
regex=re.compile(r"^\$krb5tgs\$18\$[^$]{1,512}\$[^$]{1,512}\$[^$]{1,4}?\$?[a-f0-9]{1,32}\$[a-f0-9]{64,40960}", re.IGNORECASE),
1659+
regex=re.compile(
1660+
r"^\$krb5tgs\$18\$[^$]{1,512}\$[^$]{1,512}\$[^$]{1,4}?\$?[a-f0-9]{1,32}\$[a-f0-9]{64,40960}",
1661+
re.IGNORECASE,
1662+
),
16481663
modes=[
16491664
HashInfo(
16501665
name="Kerberos 5 TGS-REP etype 18 (AES256-CTS-HMAC-SHA1-96)",
16511666
hashcat=19700,
16521667
john=None,
16531668
extended=False,
1654-
description="Used for Windows Active Directory"
1655-
)
1669+
description="Used for Windows Active Directory",
1670+
)
16561671
],
16571672
),
16581673
Prototype(
1659-
regex=re.compile(r"^\$krb5pa\$17\$[^$]{1,512}\$[^$]{1,512}\$[a-f0-9]{104,112}$", re.IGNORECASE),
1674+
regex=re.compile(
1675+
r"^\$krb5pa\$17\$[^$]{1,512}\$[^$]{1,512}\$[a-f0-9]{104,112}$",
1676+
re.IGNORECASE,
1677+
),
16601678
modes=[
16611679
HashInfo(
16621680
name="Kerberos 5, etype 17, Pre-Auth",
16631681
hashcat=19800,
16641682
john=None,
16651683
extended=False,
1666-
description="Used for Windows Active Directory"
1667-
)
1684+
description="Used for Windows Active Directory",
1685+
)
16681686
],
16691687
),
16701688
Prototype(
1671-
regex=re.compile(r"^\$krb5pa\$17\$[^$]{1,512}\$[^$]{1,512}\$[^$]{0,512}\$[a-f0-9]{104,112}$", re.IGNORECASE),
1689+
regex=re.compile(
1690+
r"^\$krb5pa\$17\$[^$]{1,512}\$[^$]{1,512}\$[^$]{0,512}\$[a-f0-9]{104,112}$",
1691+
re.IGNORECASE,
1692+
),
16721693
modes=[
16731694
HashInfo(
16741695
name="Kerberos 5, etype 17, Pre-Auth (with salt)",
16751696
hashcat=None,
16761697
john="krb5pa-sha1",
16771698
extended=False,
1678-
description="Used for Windows Active Directory"
1679-
)
1699+
description="Used for Windows Active Directory",
1700+
)
16801701
],
16811702
),
16821703
Prototype(
1683-
regex=re.compile(r"^\$krb5pa\$18\$[^$]{1,512}\$[^$]{1,512}\$[^$]{0,512}\$[a-f0-9]{104,112}$", re.IGNORECASE),
1704+
regex=re.compile(
1705+
r"^\$krb5pa\$18\$[^$]{1,512}\$[^$]{1,512}\$[^$]{0,512}\$[a-f0-9]{104,112}$",
1706+
re.IGNORECASE,
1707+
),
16841708
modes=[
16851709
HashInfo(
16861710
name="Kerberos 5, etype 18, Pre-Auth (with salt)",
16871711
hashcat=None,
16881712
john="krb5pa-sha1",
16891713
extended=False,
1690-
description="Used for Windows Active Directory"
1691-
)
1714+
description="Used for Windows Active Directory",
1715+
)
16921716
],
16931717
),
16941718
Prototype(
1695-
regex=re.compile(r"^\$krb5pa\$18\$[^$]{1,512}\$[^$]{1,512}\$[a-f0-9]{104,112}$", re.IGNORECASE),
1719+
regex=re.compile(
1720+
r"^\$krb5pa\$18\$[^$]{1,512}\$[^$]{1,512}\$[a-f0-9]{104,112}$",
1721+
re.IGNORECASE,
1722+
),
16961723
modes=[
16971724
HashInfo(
16981725
name="Kerberos 5, etype 18, Pre-Auth",
16991726
hashcat=19900,
17001727
john=None,
17011728
extended=False,
1702-
description="Used for Windows Active Directory"
1703-
)
1729+
description="Used for Windows Active Directory",
1730+
)
17041731
],
17051732
),
17061733
Prototype(
1707-
regex=re.compile(r"\$bitcoin\$[0-9]{2,4}\$[a-fA-F0-9$]{250,350}", re.IGNORECASE),
1708-
modes=[
1709-
HashInfo(
1710-
name="Bitcoin / Litecoin",
1711-
hashcat=11300,
1712-
john="bitcoin",
1713-
extended=False,
1714-
description="Use Bitcoin2John.py to extract the hash for cracking."
1734+
regex=re.compile(
1735+
r"\$bitcoin\$[0-9]{2,4}\$[a-fA-F0-9$]{250,350}", re.IGNORECASE
1736+
),
1737+
modes=[
1738+
HashInfo(
1739+
name="Bitcoin / Litecoin",
1740+
hashcat=11300,
1741+
john="bitcoin",
1742+
extended=False,
1743+
description="Use Bitcoin2John.py to extract the hash for cracking.",
17151744
)
17161745
],
17171746
),
17181747
Prototype(
1719-
regex=re.compile(r"\$ethereum\$[a-z0-9*]{150,250}", re.IGNORECASE),
1720-
modes=[
1721-
HashInfo(
1722-
name="Ethereum Wallet, PBKDF2-HMAC-SHA256",
1723-
hashcat=15600,
1724-
john="ethereum-opencl",
1725-
extended=False,
1726-
description="Use ethereum2john.py to crack."
1748+
regex=re.compile(r"\$ethereum\$[a-z0-9*]{150,250}", re.IGNORECASE),
1749+
modes=[
1750+
HashInfo(
1751+
name="Ethereum Wallet, PBKDF2-HMAC-SHA256",
1752+
hashcat=15600,
1753+
john="ethereum-opencl",
1754+
extended=False,
1755+
description="Use ethereum2john.py to crack.",
1756+
),
1757+
HashInfo(
1758+
name="Ethereum Pre-Sale Wallet, PBKDF2-HMAC-SHA256",
1759+
hashcat=16300,
1760+
john="ethereum-presale-opencl",
1761+
extended=False,
1762+
description="Use ethereum2john.py to crack.",
17271763
),
1728-
HashInfo(
1729-
name="Ethereum Pre-Sale Wallet, PBKDF2-HMAC-SHA256",
1730-
hashcat=16300,
1731-
john="ethereum-presale-opencl",
1732-
extended=False,
1733-
description="Use ethereum2john.py to crack."
1734-
)
17351764
],
17361765
),
17371766
Prototype(
1738-
regex=re.compile(r"\$monero\$(0)\*[a-f0-9]{32,3196}", re.IGNORECASE),
1739-
modes=[
1740-
HashInfo(
1741-
name="Monero",
1742-
hashcat=None,
1743-
john="monero",
1744-
extended=False,
1745-
description="Use monero2john.py to crack."
1767+
regex=re.compile(r"\$monero\$(0)\*[a-f0-9]{32,3196}", re.IGNORECASE),
1768+
modes=[
1769+
HashInfo(
1770+
name="Monero",
1771+
hashcat=None,
1772+
john="monero",
1773+
extended=False,
1774+
description="Use monero2john.py to crack.",
17461775
)
17471776
],
17481777
),
17491778
Prototype(
1750-
regex=re.compile(r"^\$electrum\$[1-3]\*[a-f0-9]{32,32}\*[a-f0-9]{32,32}$", re.IGNORECASE),
1779+
regex=re.compile(
1780+
r"^\$electrum\$[1-3]\*[a-f0-9]{32,32}\*[a-f0-9]{32,32}$", re.IGNORECASE
1781+
),
17511782
modes=[
1752-
HashInfo(
1753-
name="Electrum Wallet (Salt-Type 1-3)",
1754-
hashcat=16600,
1755-
john="electrum",
1756-
extended=False,
1783+
HashInfo(
1784+
name="Electrum Wallet (Salt-Type 1-3)",
1785+
hashcat=16600,
1786+
john="electrum",
1787+
extended=False,
17571788
)
17581789
],
17591790
),
17601791
Prototype(
1761-
regex=re.compile(r"^\$electrum\$4\*[a-f0-9]{1,66}\*[a-f0-9]{128,32768}\*[a-f0-9]{64,64}$", re.IGNORECASE),
1792+
regex=re.compile(
1793+
r"^\$electrum\$4\*[a-f0-9]{1,66}\*[a-f0-9]{128,32768}\*[a-f0-9]{64,64}$",
1794+
re.IGNORECASE,
1795+
),
17621796
modes=[
1763-
HashInfo(
1764-
name="Electrum Wallet (Salt-Type 4)",
1765-
hashcat=21700,
1766-
john="electrum",
1767-
extended=False,
1797+
HashInfo(
1798+
name="Electrum Wallet (Salt-Type 4)",
1799+
hashcat=21700,
1800+
john="electrum",
1801+
extended=False,
17681802
)
17691803
],
17701804
),
17711805
Prototype(
1772-
regex=re.compile(r"^\$electrum\$5\*[a-f0-9]{66,66}\*[a-f0-9]{2048,2048}\*[a-f0-9]{64,64}$", re.IGNORECASE),
1806+
regex=re.compile(
1807+
r"^\$electrum\$5\*[a-f0-9]{66,66}\*[a-f0-9]{2048,2048}\*[a-f0-9]{64,64}$",
1808+
re.IGNORECASE,
1809+
),
17731810
modes=[
1774-
HashInfo(
1775-
name="Electrum Wallet (Salt-Type 5)",
1776-
hashcat=21800,
1777-
john="electrum",
1778-
extended=False,
1811+
HashInfo(
1812+
name="Electrum Wallet (Salt-Type 5)",
1813+
hashcat=21800,
1814+
john="electrum",
1815+
extended=False,
17791816
)
17801817
],
17811818
),
17821819
Prototype(
1783-
regex=re.compile(r"\$ab\$[0-9]{1}\*[0-9]{1}\*[0-9]{1,6}\*[a-f0-9]{128}\*[a-f0-9]{128}\*[a-f0-9]{32}\*[a-f0-9]{192}", re.IGNORECASE),
1820+
regex=re.compile(
1821+
r"\$ab\$[0-9]{1}\*[0-9]{1}\*[0-9]{1,6}\*[a-f0-9]{128}\*[a-f0-9]{128}\*[a-f0-9]{32}\*[a-f0-9]{192}",
1822+
re.IGNORECASE,
1823+
),
17841824
modes=[
1785-
HashInfo(
1786-
name="Android Backup",
1787-
hashcat=18900,
1788-
john="androidbackup",
1789-
extended=False,
1825+
HashInfo(
1826+
name="Android Backup",
1827+
hashcat=18900,
1828+
john="androidbackup",
1829+
extended=False,
17901830
)
17911831
],
17921832
),
17931833
Prototype(
1794-
regex=re.compile(r"\$zip2\$\*[0-9]{1}\*[0-9]{1}\*[0-9]{1}\*[a-f0-9]{16,32}\*[a-f0-9]{1,6}\*[a-f0-9]{1,6}\*[a-f0-9]{0,16384}\*[a-f0-9]{20}\*\$\/zip2\$", re.IGNORECASE),
1834+
regex=re.compile(
1835+
r"\$zip2\$\*[0-9]{1}\*[0-9]{1}\*[0-9]{1}\*[a-f0-9]{16,32}\*[a-f0-9]{1,6}\*[a-f0-9]{1,6}\*[a-f0-9]{0,16384}\*[a-f0-9]{20}\*\$\/zip2\$",
1836+
re.IGNORECASE,
1837+
),
17951838
modes=[
1796-
HashInfo(
1797-
name="WinZip",
1798-
hashcat=13600,
1799-
john="ZIP",
1800-
extended=False,
1839+
HashInfo(
1840+
name="WinZip",
1841+
hashcat=13600,
1842+
john="ZIP",
1843+
extended=False,
18011844
)
18021845
],
18031846
),
18041847
Prototype(
1805-
regex=re.compile(r"\$itunes_backup\$\*[0-9]{1,2}\*[a-f0-9]{80}\*[0-9]{1,6}\*[a-f0-9]{40}\*[0-9]{0,10}\*[a-f0-9]{0,40}", re.IGNORECASE),
1848+
regex=re.compile(
1849+
r"\$itunes_backup\$\*[0-9]{1,2}\*[a-f0-9]{80}\*[0-9]{1,6}\*[a-f0-9]{40}\*[0-9]{0,10}\*[a-f0-9]{0,40}",
1850+
re.IGNORECASE,
1851+
),
18061852
modes=[
1807-
HashInfo(
1808-
name="iTunes backup >= 10.0 11",
1809-
hashcat=14800,
1810-
john="itunes-backup",
1811-
extended=False,
1853+
HashInfo(
1854+
name="iTunes backup >= 10.0 11",
1855+
hashcat=14800,
1856+
john="itunes-backup",
1857+
extended=False,
18121858
)
18131859
],
18141860
),
@@ -1842,12 +1888,14 @@ class HashInfo:
18421888
hashcat=9720,
18431889
john="oldoffice",
18441890
extended=False,
1845-
description="Use office2john.py to grab the hash."
1891+
description="Use office2john.py to grab the hash.",
18461892
),
18471893
],
18481894
),
18491895
Prototype(
1850-
regex=re.compile(r"\$office\$2016\$[0-9]\$[0-9]{6}\$[^$]{24}\$[^$]{88}", re.IGNORECASE),
1896+
regex=re.compile(
1897+
r"\$office\$2016\$[0-9]\$[0-9]{6}\$[^$]{24}\$[^$]{88}", re.IGNORECASE
1898+
),
18511899
modes=[
18521900
HashInfo(
18531901
name="MS Office 2016 - SheetProtection",
@@ -1912,4 +1960,4 @@ class HashInfo:
19121960
),
19131961
],
19141962
),
1915-
]
1963+
]

0 commit comments

Comments
 (0)