banner
lca

lca

真正的不自由,是在自己的心中设下牢笼。

hashcat密码破解工具基础使用

前言#

hashcat是一款暴力破解、密码恢复工具,被称为 “世界上最快、最先进的密码恢复实用程序”,Hashcat 可与John the Ripper一较高下。它是破解哈希的首选渗透测试工具,并且 hashcat 支持多种猜测密码的蛮力攻击,包括字典和掩码攻击。

以前在测试的中,遇到的大部分是 MD5 的 hash 值,一般通过在线的 MD5 破解网站进行破解,比较常用的是somd5chamd5,很少用密码工具去破解 MD5 值,因为自己本身硬件速度跟不上,Hashcat 在现代 GPU 上运行最好,如果利用想 AWS 服务去破解密码,速度其实是非常快的,相对于破解一个密码的成本来说,硬件的支付成本并不会太高。

语法介绍#

常用参数#

  • -a:指定攻击模式。“-a 0” 字典攻击,“-a 1” 组合攻击;“-a 3” 掩码攻击。
  • -m:指定 hash 类型,如果不指定类型,则默认是 MD5,例如:-m 1000
  • -o:指定破解成功后的 hash 及对应的明文密码的存在位置
  • --force:忽略破解过程中的警告信息
  • --show:显示已经破解的 hash 及该 hash 所对应的明文
  • -r:使用自定义破解规则
  • --increment :启用增量破解模式,你可以利用此模式让 hashcat 在指定的密码长度范围内执行破解过程
  • --increment-min 密码最小长度,后面直接等于一个整数即可,配置 increment 模式一起使用
  • --increment-max 密码最大长度,同上

OpenCL 设备类型#

| Device Type#

===+=============
1 | CPU
2 | GPU
3 | FPGA, DSP, Co-Processor

攻击模式#

Attack Modes

输出格式#

Outfile Formats

Hash ID 对照表

#名称类别
900MD4Raw Hash
0MD5Raw Hash
100SHA1Raw Hash
1300SHA2-224Raw Hash
1400SHA2-256Raw Hash
10800SHA2-384Raw Hash
1700SHA2-512Raw Hash
17300SHA3-224Raw Hash
17400SHA3-256Raw Hash
17500SHA3-384Raw Hash
17600SHA3-512Raw Hash
6000RIPEMD-160Raw Hash
600BLAKE2b-512Raw Hash
11700GOST R 34.11-2012 (Streebog) 256-bit, big-endianRaw Hash
11800GOST R 34.11-2012 (Streebog) 512-bit, big-endianRaw Hash
6900GOST R 34.11-94Raw Hash
5100Half MD5Raw Hash
18700Java Object hashCode()Raw Hash
17700Keccak-224Raw Hash
17800Keccak-256Raw Hash
17900Keccak-384Raw Hash
18000Keccak-512Raw Hash
21400sha256(sha256_bin($pass))Raw Hash
6100WhirlpoolRaw Hash
10100SipHashRaw Hash
21000BitShares v0.x - sha512(sha512_bin(pass))Raw Hash
10md5($pass.$salt)Raw Hash, Salted and/or Iterated
20md5($salt.$pass)Raw Hash, Salted and/or Iterated
3800md5($salt.$pass.$salt)Raw Hash, Salted and/or Iterated
3710md5($salt.md5($pass))Raw Hash, Salted and/or Iterated
4110md5($salt.md5($pass.$salt))Raw Hash, Salted and/or Iterated
4010md5($salt.md5($salt.$pass))Raw Hash, Salted and/or Iterated
21300md5($salt.sha1($salt.$pass))Raw Hash, Salted and/or Iterated
40md5($salt.utf16le($pass))Raw Hash, Salted and/or Iterated
2600md5(md5($pass))Raw Hash, Salted and/or Iterated
3910md5(md5($pass).md5($salt))Raw Hash, Salted and/or Iterated
4400md5(sha1($pass))Raw Hash, Salted and/or Iterated
20900md5(sha1($pass).md5($pass).sha1($pass))Raw Hash, Salted and/or Iterated
21200md5(sha1($salt).md5($pass))Raw Hash, Salted and/or Iterated
4300md5(strtoupper(md5($pass)))Raw Hash, Salted and/or Iterated
30md5(utf16le($pass).$salt)Raw Hash, Salted and/or Iterated
110sha1($pass.$salt)Raw Hash, Salted and/or Iterated
120sha1($salt.$pass)Raw Hash, Salted and/or Iterated
4900sha1($salt.$pass.$salt)Raw Hash, Salted and/or Iterated
4520sha1($salt.sha1($pass))Raw Hash, Salted and/or Iterated
140sha1($salt.utf16le($pass))Raw Hash, Salted and/or Iterated
19300sha1($salt1.$pass.$salt2)Raw Hash, Salted and/or Iterated
14400sha1(CX)Raw Hash, Salted and/or Iterated
4700sha1(md5($pass))Raw Hash, Salted and/or Iterated
4710sha1(md5($pass).$salt)Raw Hash, Salted and/or Iterated
21100sha1(md5($pass.$salt))Raw Hash, Salted and/or Iterated
18500sha1(md5(md5($pass)))Raw Hash, Salted and/or Iterated
4500sha1(sha1($pass))Raw Hash, Salted and/or Iterated
130sha1(utf16le($pass).$salt)Raw Hash, Salted and/or Iterated
1410sha256($pass.$salt)Raw Hash, Salted and/or Iterated
1420sha256($salt.$pass)Raw Hash, Salted and/or Iterated
22300sha256($salt.$pass.$salt)Raw Hash, Salted and/or Iterated
1440sha256($salt.utf16le($pass))Raw Hash, Salted and/or Iterated
20800sha256(md5($pass))Raw Hash, Salted and/or Iterated
20710sha256(sha256($pass).$salt)Raw Hash, Salted and/or Iterated
1430sha256(utf16le($pass).$salt)Raw Hash, Salted and/or Iterated
1710sha512($pass.$salt)Raw Hash, Salted and/or Iterated
1720sha512($salt.$pass)Raw Hash, Salted and/or Iterated
1740sha512($salt.utf16le($pass))Raw Hash, Salted and/or Iterated
1730sha512(utf16le($pass).$salt)Raw Hash, Salted and/or Iterated
19500Ruby on Rails Restful-AuthenticationRaw Hash, Salted and/or Iterated
50HMAC-MD5 (key = $pass)Raw Hash, Authenticated
60HMAC-MD5 (key = $salt)Raw Hash, Authenticated
150HMAC-SHA1 (key = $pass)Raw Hash, Authenticated
160HMAC-SHA1 (key = $salt)Raw Hash, Authenticated
1450HMAC-SHA256 (key = $pass)Raw Hash, Authenticated
1460HMAC-SHA256 (key = $salt)Raw Hash, Authenticated
1750HMAC-SHA512 (key = $pass)Raw Hash, Authenticated
1760HMAC-SHA512 (key = $salt)Raw Hash, Authenticated
11750HMAC-Streebog-256 (key = $pass), big-endianRaw Hash, Authenticated
11760HMAC-Streebog-256 (key = $salt), big-endianRaw Hash, Authenticated
11850HMAC-Streebog-512 (key = $pass), big-endianRaw Hash, Authenticated
11860HMAC-Streebog-512 (key = $salt), big-endianRaw Hash, Authenticated
11500CRC32Raw Checksum
141003DES (PT = $salt, key = $pass)Raw Cipher, Known-Plaintext attack
14000DES (PT = $salt, key = $pass)Raw Cipher, Known-Plaintext attack
15400ChaCha20Raw Cipher, Known-Plaintext attack
14900Skip32 (PT = $salt, key = $pass)Raw Cipher, Known-Plaintext attack
11900PBKDF2-HMAC-MD5Generic KDF
12000PBKDF2-HMAC-SHA1Generic KDF
10900PBKDF2-HMAC-SHA256Generic KDF
12100PBKDF2-HMAC-SHA512Generic KDF
8900scryptGeneric KDF
400phpassGeneric KDF
16900Ansible VaultGeneric KDF
12001Atlassian (PBKDF2-HMAC-SHA1)Generic KDF
20200Python passlib pbkdf2-sha512Generic KDF
20300Python passlib pbkdf2-sha256Generic KDF
20400Python passlib pbkdf2-sha1Generic KDF
16100TACACS+Network Protocols
11400SIP digest authentication (MD5)Network Protocols
5300IKE-PSK MD5Network Protocols
5400IKE-PSK SHA1Network Protocols
2500WPA-EAPOL-PBKDF2Network Protocols
2501WPA-EAPOL-PMKNetwork Protocols
22000WPA-PBKDF2-PMKID+EAPOLNetwork Protocols
22001WPA-PMK-PMKID+EAPOLNetwork Protocols
16800WPA-PMKID-PBKDF2Network Protocols
16801WPA-PMKID-PMKNetwork Protocols
7300IPMI2 RAKP HMAC-SHA1Network Protocols
10200CRAM-MD5Network Protocols
4800iSCSI CHAP authentication, MD5(CHAP)Network Protocols
16500JWT (JSON Web Token)Network Protocols
22600Telegram Desktop App Passcode (PBKDF2-HMAC-SHA1)Network Protocols
22301Telegram Mobile App Passcode (SHA256)Network Protocols
7500Kerberos 5, etype 23, AS-REQ Pre-AuthNetwork Protocols
13100Kerberos 5, etype 23, TGS-REPNetwork Protocols
18200Kerberos 5, etype 23, AS-REPNetwork Protocols
19600Kerberos 5, etype 17, TGS-REPNetwork Protocols
19700Kerberos 5, etype 18, TGS-REPNetwork Protocols
19800Kerberos 5, etype 17, Pre-AuthNetwork Protocols
19900Kerberos 5, etype 18, Pre-AuthNetwork Protocols
5500NetNTLMv1 / NetNTLMv1+ESSNetwork Protocols
5600NetNTLMv2Network Protocols
23SkypeNetwork Protocols
11100PostgreSQL CRAM (MD5)Network Protocols
11200MySQL CRAM (SHA1)Network Protocols
8500RACFOperating System
6300AIX {smd5}Operating System
6700AIX {ssha1}Operating System
6400AIX {ssha256}Operating System
6500AIX {ssha512}Operating System
3000LMOperating System
19000QNX /etc/shadow (MD5)Operating System
19100QNX /etc/shadow (SHA256)Operating System
19200QNX /etc/shadow (SHA512)Operating System
15300DPAPI masterkey file v1Operating System
15900DPAPI masterkey file v2Operating System
7200GRUB 2Operating System
12800MS-AzureSync PBKDF2-HMAC-SHA256Operating System
12400BSDi Crypt, Extended DESOperating System
1000NTLMOperating System
122macOS v10.4, macOS v10.5, MacOS v10.6Operating System
1722macOS v10.7Operating System
7100macOS v10.8+ (PBKDF2-SHA512)Operating System
9900Radmin2Operating System
5800Samsung Android Password/PINOperating System
3200bcrypt $2*$, Blowfish (Unix)Operating System
500md5crypt, MD5 (Unix), Cisco-IOS $1$ (MD5)Operating System
1500descrypt, DES (Unix), Traditional DESOperating System
7400sha256crypt $5$, SHA256 (Unix)Operating System
1800sha512crypt $6$, SHA512 (Unix)Operating System
13800Windows Phone 8+ PIN/passwordOperating System
2410Cisco-ASA MD5Operating System
9200Cisco-IOS $8$ (PBKDF2-SHA256)Operating System
9300Cisco-IOS $9$ (scrypt)Operating System
5700Cisco-IOS type 4 (SHA256)Operating System
2400Cisco-PIX MD5Operating System
8100Citrix NetScaler (SHA1)Operating System
22200Citrix NetScaler (SHA512)Operating System
1100Domain Cached Credentials (DCC), MS CacheOperating System
2100Domain Cached Credentials 2 (DCC2), MS Cache 2Operating System
7000FortiGate (FortiOS)Operating System
125ArubaOSOperating System
501Juniper IVEOperating System
22Juniper NetScreen/SSG (ScreenOS)Operating System
15100Juniper/NetBSD sha1cryptOperating System
131MSSQL (2000)Database Server
132MSSQL (2005)Database Server
1731MSSQL (2012, 2014)Database Server
12PostgreSQLDatabase Server
3100Oracle H: Type (Oracle 7+)Database Server
112Oracle S: Type (Oracle 11+)Database Server
12300Oracle T: Type (Oracle 12+)Database Server
7401MySQL $A$ (sha256crypt)Database Server
200MySQL323Database Server
300MySQL4.1/MySQL5Database Server
8000Sybase ASEDatabase Server**
1421hMailServerFTP, HTTP, SMTP, LDAP Server
8300DNSSEC (NSEC3)FTP, HTTP, SMTP, LDAP Server
16400CRAM-MD5 DovecotFTP, HTTP, SMTP, LDAP Server
1411SSHA-256(Base64), LDAP {SSHA256}FTP, HTTP, SMTP, LDAP Server
1711SSHA-512(Base64), LDAP {SSHA512}FTP, HTTP, SMTP, LDAP Server
10901RedHat 389-DS LDAP (PBKDF2-HMAC-SHA256)FTP, HTTP, SMTP, LDAP Server
15000FileZilla Server >= 0.9.55FTP, HTTP, SMTP, LDAP Server
12600ColdFusion 10+FTP, HTTP, SMTP, LDAP Server
1600Apache $apr1$ MD5, md5apr1, MD5 (APR)FTP, HTTP, SMTP, LDAP Server
141Episerver 6.x < .NET 4FTP, HTTP, SMTP, LDAP Server
1441Episerver 6.x >= .NET 4FTP, HTTP, SMTP, LDAP Server
101nsldap, SHA-1(Base64), Netscape LDAP SHAFTP, HTTP, SMTP, LDAP Server
111nsldaps, SSHA-1(Base64), Netscape LDAP SSHAFTP, HTTP, SMTP, LDAP Server
7700SAP CODVN B (BCODE)Enterprise Application Software (EAS)
7701SAP CODVN B (BCODE) from RFC_READ_TABLEEnterprise Application Software (EAS)
7800SAP CODVN F/G (PASSCODE)Enterprise Application Software (EAS)
7801SAP CODVN F/G (PASSCODE) from RFC_READ_TABLEEnterprise Application Software (EAS)
10300SAP CODVN H (PWDSALTEDHASH) iSSHA-1Enterprise Application Software (EAS)
133PeopleSoftEnterprise Application Software (EAS)
13500PeopleSoft PS_TOKENEnterprise Application Software (EAS)
21500SolarWinds OrionEnterprise Application Software (EAS)
8600Lotus Notes/Domino 5Enterprise Application Software (EAS)
8700Lotus Notes/Domino 6Enterprise Application Software (EAS)
9100Lotus Notes/Domino 8Enterprise Application Software (EAS)
20600Oracle Transportation Management (SHA256)Enterprise Application Software (EAS)
4711Huawei sha1(md5($pass).$salt)Enterprise Application Software (EAS)
20711AuthMe sha256Enterprise Application Software (EAS)
12200eCryptfsFull-Disk Encryption (FDE)
22400AES Crypt (SHA256)Full-Disk Encryption (FDE)
14600LUKSFull-Disk Encryption (FDE)
13711VeraCrypt RIPEMD160 + XTS 512 bitFull-Disk Encryption (FDE)
13712VeraCrypt RIPEMD160 + XTS 1024 bitFull-Disk Encryption (FDE)
13713VeraCrypt RIPEMD160 + XTS 1536 bitFull-Disk Encryption (FDE)
13741VeraCrypt RIPEMD160 + XTS 512 bit + boot-modeFull-Disk Encryption (FDE)
13742VeraCrypt RIPEMD160 + XTS 1024 bit + boot-modeFull-Disk Encryption (FDE)
13743VeraCrypt RIPEMD160 + XTS 1536 bit + boot-modeFull-Disk Encryption (FDE)
13751VeraCrypt SHA256 + XTS 512 bitFull-Disk Encryption (FDE)
13752VeraCrypt SHA256 + XTS 1024 bitFull-Disk Encryption (FDE)
13753VeraCrypt SHA256 + XTS 1536 bitFull-Disk Encryption (FDE)
13761VeraCrypt SHA256 + XTS 512 bit + boot-modeFull-Disk Encryption (FDE)
13762VeraCrypt SHA256 + XTS 1024 bit + boot-modeFull-Disk Encryption (FDE)
13763VeraCrypt SHA256 + XTS 1536 bit + boot-modeFull-Disk Encryption (FDE)
13721VeraCrypt SHA512 + XTS 512 bitFull-Disk Encryption (FDE)
13722VeraCrypt SHA512 + XTS 1024 bitFull-Disk Encryption (FDE)
13723VeraCrypt SHA512 + XTS 1536 bitFull-Disk Encryption (FDE)
13771VeraCrypt Streebog-512 + XTS 512 bitFull-Disk Encryption (FDE)
13772VeraCrypt Streebog-512 + XTS 1024 bitFull-Disk Encryption (FDE)
13773VeraCrypt Streebog-512 + XTS 1536 bitFull-Disk Encryption (FDE)
13731VeraCrypt Whirlpool + XTS 512 bitFull-Disk Encryption (FDE)
13732VeraCrypt Whirlpool + XTS 1024 bitFull-Disk Encryption (FDE)
13733VeraCrypt Whirlpool + XTS 1536 bitFull-Disk Encryption (FDE)
16700FileVault 2Full-Disk Encryption (FDE)
20011DiskCryptor SHA512 + XTS 512 bitFull-Disk Encryption (FDE)
20012DiskCryptor SHA512 + XTS 1024 bitFull-Disk Encryption (FDE)
20013DiskCryptor SHA512 + XTS 1536 bitFull-Disk Encryption (FDE)
22100BitLockerFull-Disk Encryption (FDE)
12900Android FDE (Samsung DEK)Full-Disk Encryption (FDE)
8800Android FDE <= 4.3Full-Disk Encryption (FDE)
18300Apple File System (APFS)Full-Disk Encryption (FDE)
6211TrueCrypt RIPEMD160 + XTS 512 bitFull-Disk Encryption (FDE)
6212TrueCrypt RIPEMD160 + XTS 1024 bitFull-Disk Encryption (FDE)
6213TrueCrypt RIPEMD160 + XTS 1536 bitFull-Disk Encryption (FDE)
6241TrueCrypt RIPEMD160 + XTS 512 bit + boot-modeFull-Disk Encryption (FDE)
6242TrueCrypt RIPEMD160 + XTS 1024 bit + boot-modeFull-Disk Encryption (FDE)
6243TrueCrypt RIPEMD160 + XTS 1536 bit + boot-modeFull-Disk Encryption (FDE)
6221TrueCrypt SHA512 + XTS 512 bitFull-Disk Encryption (FDE)
6222TrueCrypt SHA512 + XTS 1024 bitFull-Disk Encryption (FDE)
6223TrueCrypt SHA512 + XTS 1536 bitFull-Disk Encryption (FDE)
6231TrueCrypt Whirlpool + XTS 512 bitFull-Disk Encryption (FDE)
6232TrueCrypt Whirlpool + XTS 1024 bitFull-Disk Encryption (FDE)
6233TrueCrypt Whirlpool + XTS 1536 bitFull-Disk Encryption (FDE)
10400PDF 1.1 - 1.3 (Acrobat 2 - 4)Documents
10410PDF 1.1 - 1.3 (Acrobat 2 - 4), collider #1Documents
10420PDF 1.1 - 1.3 (Acrobat 2 - 4), collider #2Documents
10500PDF 1.4 - 1.6 (Acrobat 5 - 8)Documents
10600PDF 1.7 Level 3 (Acrobat 9)Documents
10700PDF 1.7 Level 8 (Acrobat 10 - 11)Documents
9400MS Office 2007Documents
9500MS Office 2010Documents
9600MS Office 2013Documents
9700MS Office <= 2003 $0/$1, MD5 + RC4Documents
9710MS Office <= 2003 $0/$1, MD5 + RC4, collider #1Documents
9720MS Office <= 2003 $0/$1, MD5 + RC4, collider #2Documents
9800MS Office <= 2003 $3/$4, SHA1 + RC4Documents
9810MS Office <= 2003 $3, SHA1 + RC4, collider #1Documents
9820MS Office <= 2003 $3, SHA1 + RC4, collider #2Documents
18400Open Document Format (ODF) 1.2 (SHA-256, AES)Documents
18600Open Document Format (ODF) 1.1 (SHA-1, Blowfish)Documents
16200Apple Secure NotesDocuments
15500JKS Java Key Store Private Keys (SHA1)Password Managers
66001Password, agilekeychainPassword Managers
82001Password, cloudkeychainPassword Managers
9000Password Safe v2Password Managers
5200Password Safe v3Password Managers
6800LastPass + LastPass sniffedPassword Managers
13400KeePass 1 (AES/Twofish) and KeePass 2 (AES)Password Managers
11300Bitcoin/Litecoin wallet.datPassword Managers
16600Electrum Wallet (Salt-Type 1-3)Password Managers
21700Electrum Wallet (Salt-Type 4)Password Managers
21800Electrum Wallet (Salt-Type 5)Password Managers
12700Blockchain, My WalletPassword Managers
15200Blockchain, My Wallet, V2Password Managers
18800Blockchain, My Wallet, Second Password (SHA256)Password Managers
16300Ethereum Pre-Sale Wallet, PBKDF2-HMAC-SHA256Password Managers
15600Ethereum Wallet, PBKDF2-HMAC-SHA256Password Managers
15700Ethereum Wallet, SCRYPTPassword Managers
22500MultiBit Classic .key (MD5)Password Managers
22700MultiBit HD (scrypt)Password Managers
116007-ZipArchives
12500RAR3-hpArchives
13000RAR5Archives
17200PKZIP (Compressed)Archives
17220PKZIP (Compressed Multi-File)Archives
17225PKZIP (Mixed Multi-File)Archives
17230PKZIP (Mixed Multi-File Checksum-Only)Archives
17210PKZIP (Uncompressed)Archives
20500PKZIP Master KeyArchives
20510PKZIP Master Key (6 byte optimization)Archives
14700iTunes backup < 10.0Archives
14800iTunes backup >= 10.0Archives
23001SecureZIP AES-128Archives
23002SecureZIP AES-192Archives
23003SecureZIP AES-256Archives
13600WinZipArchives
18900Android BackupArchives
13200AxCryptArchives
13300AxCrypt in-memory SHA1Archives
8400WBB3 (Woltlab Burning Board)Forums, CMS, E-Commerce
2611vBulletin < v3.8.5Forums, CMS, E-Commerce
2711vBulletin >= v3.8.5Forums, CMS, E-Commerce
2612PHPSForums, CMS, E-Commerce
121SMF (Simple Machines Forum) > v1.1Forums, CMS, E-Commerce
3711MediaWiki B typeForums, CMS, E-Commerce
4521RedmineForums, CMS, E-Commerce
11Joomla < 2.5.18Forums, CMS, E-Commerce
13900OpenCartForums, CMS, E-Commerce
11000PrestaShopForums, CMS, E-Commerce
16000TripcodeForums, CMS, E-Commerce
7900Drupal7Forums, CMS, E-Commerce
21osCommerce, xtForums, CMS, E-Commerce
4522PunBBForums, CMS, E-Commerce
2811MyBB 1.2+, IPB2+ (Invision Power Board)Forums, CMS, E-Commerce
18100TOTP (HMAC-SHA1)One-Time Passwords
2000STDOUTPlaintext
99999PlaintextPlaintext
21600Web2py pbkdf2-sha512Framework
10000Django (PBKDF2-SHA256)Framework
124Django (SHA-1)Framework

hash 示例可查看

掩码设置#

labcdefghijklmnopqrstuvwxyz 小写字符
uABCDEFGHIJKLMNOPQRSTUVWXYZ 大写字符
d0123456789 数字
h0123456789abcdef 常用小写字符 + 数字
H0123456789ABCDEF 常用大写字符 + 数字
s!"#$%&'()*+,-./:;<=>?@[\]^_{`
a?l?u?d?s 键盘上所有可见的字符
b0x00 - 0xff 可能是用来匹配像空格这种密码的

常见掩码设置

八位数字密码:?d?d?d?d?d?d?d?d  
八位未知密码:?a?a?a?a?a?a?a?a  
前四位为大写字母,后面四位为数字:?u?u?u?u?d?d?d?d  
前四位为数字或者是小写字母,后四位为大写字母或者数字:?h?h?h?h?H?H?H?H  
前三个字符未知,中间为admin,后三位未知:?a?a?aadmin?a?a?a  
6-8位数字密码:--increment --increment-min 6 --increment-max 8 ?l?l?l?l?l?l?l?l  
6-8位数字+小写字母密码:--increment --increment-min 6 --increment-max 8 ?h?h?h?h?h?h?h?h

🍃 自定义字符集

如果想破解自定义字符集,假设你知道一个密码有 abcdefg1234!@+$,这是就需要自定义字符集,自己设置需要破解的字符。

--custom-charset1 [chars]等价于 -1  
--custom-charset2 [chars]等价于 -2  
--custom-charset3 [chars]等价于 -3  
--custom-charset4 [chars]等价于 -4  
在掩码中用?1、?2、?3、?4来表示。

示例如下:

--custom-charset1 abcd123456!@-+。然后我们就可以用"?1"去表示这个字符集了  
--custom-charset2 ?l?d,这里和?2就等价于?h  
-1 ?d?l?u,?1就表示数字+小写字母+大写字母  
-3 abcdef -4 123456 那么?3?3?3?3?4?4?4?4就表示为前四位可能是“abcdef”,后四位可能是“123456”

🍃 密码破解规则

(1)利用收集的公开字典进行破解
(2)使用 1-8 位数字进行破解。
(3)使用 1-8 位小写字母进行破解
(4)使用 1-8 位大写字母进行破解
(5)使用 1-8 位混合大小写 + 数字 + 特殊字符进行破解

基本案例#

攻击模式hash 类型示例
WordlistPhashcat -a 0 -m 400 example400.hash example.dict
Wordlist + RulesMD5hashcat -a 0 -m 0 example0.hash example.dict -r rules/best64.rule
Brute-ForceMD5hashcat -a 3 -m 0 example0.hash ?a?a?a?a?a?a
CombinatorMD5hashcat -a 1 -m 0 example0.hash example.dict example.dict

实际案例#

1、破解 7 位 MD5 值

$ hashcat -a 3 -m 0 --force 10e935b681dd5d9228d914ed31f86b79 ?d?d?d?d?d?d?d

hashcat%E6%96%87%E7%AB%A0%20870ae67c89824363af4d1d43bcfd3aef/Untitled.png

2、破解 7 为小写字母

$ hashcat -a 3 -m 0 --force 1b1aee1f5339f686b32d9a255696f080 ?l?l?l?l?l?l?l

hashcat%E6%96%87%E7%AB%A0%20870ae67c89824363af4d1d43bcfd3aef/Untitled%201.png

3、破解 1-9 为数字

$hashcat -a 3 -m 0 --force a1b36807dc763d423f055b617a835521 --increment --increment-min 1 --increment-max 8 ?d?d?d?d?d?d?d?d

hashcat%E6%96%87%E7%AB%A0%20870ae67c89824363af4d1d43bcfd3aef/Untitled%202.png

4、破解特定字符集

$hashcat -a 3 -1 123456abcdf!@+- ca6d3ead08fa8e7eca93966b75f1c1b0 ?1?1?1?1?1

5、破解 1-8 为特定字符

$hashcat -a 3 -1 123456abcdf!@+- 9054fa315ce16f7f0955b4af06d1aa1b --increment --increment-min 1 --increment-max 8 ?1?1?1?1?1?1?1?1

6、破解 1-8 位数字 + 大小写字母 + 课件的特殊符号

hashcat64.exe -a 3 -1 ?d?u?l?s d37fc9ee39dd45a7717e3e3e9415f65d --increment --increment-min 1 --increment-max 8 ?1?1?1?1?1?1?1?1  
或者:  
hashcat64.exe -a 3 d37fc9ee39dd45a7717e3e3e9415f65d --increment --increment-min 1 --increment-max 8 ?a?a?a?a?a?a?a?a

7、指定字典破解

-a 0是指定字典破解模式,-o是输出结果到文件中  
hashcat64.exe -a 0 ede900ac1424436b55dc3c9f20cb97a8 password.txt -o result.txt

8、批量破解

hashcat64.exe -a 0 hash.txt password.txt -o result.txt

9、破解 Windows NT-hash,LM-hash

NT-hash  
$ hashcat -a 3 -m 1000 --force 1b1aee1f5339f686b32d9a255696f080 ?l?l?l?l?l?l?l  
  
LM-hash  
$ hashcat -a 3 -m 1000 --force 1b1aee1f5339f686b32d9a255696f080 ?l?l?l?l?l?l?l

10、破解 RAR 压缩包密码

先利用 rar2john 获取 rar 文件的 hash 值:http://openwall.info/wiki/_media/john/johntheripper-v1.8.0.12-jumbo-1-bleeding-e6214ceab-2018-02-07-win-x64.7z

11、破解 ZIP 压缩包密码

通过 zip2john 获取 zip 文件的 hash 值,利用 bindzip 压缩的文件标识符为 pkzip2。

hashcat%E6%96%87%E7%AB%A0%20870ae67c89824363af4d1d43bcfd3aef/Untitled%203.png

破解 pkzip2 时,-m 指定为 17200。

.\hashcat.exe -a 3 -m 17200 '$pkzip2$1*2*2*0*161b*19ca*26bf01cc*0*6c*8*161b*26bf*9bc1*169c0f03f18f797477...此处省略...c3f52a18d0537dca26b0baeae8a*$/pkzip2$' --force ?d?d?d?d?d?d

hashcat%E6%96%87%E7%AB%A0%20870ae67c89824363af4d1d43bcfd3aef/Untitled%204.png

12、破解 word 加密文档

wget https://raw.githubusercontent.com/magnumripper/JohnTheRipper/bleeding-jumbo/run/office2john.py
hashcat -a 0 -m 9500 --username -o crack.txt hash.txt /usr/share/wordlists/nmap.lst --force

13、破解 linux 下 /etc/shadow 文件的密码

hashcat -a 3 -m 1800 --force '$6$H6LRx0yQ62gqLdg7$88r9sgiYtcMKELXTGvyFBPtZmTV.xw4CRamKwYjYIWxiXi3o9dKOlK.2yC3PM2JHRl/xfhXS2kleJmP63nSTJ/' ?l?l?l?l

hashcat%E6%96%87%E7%AB%A0%20870ae67c89824363af4d1d43bcfd3aef/Untitled%205.png

利用 openssl 生产 sha512 的密码。

$ openssl passwd -6 -salt xyz kalia  
$6$xyz$xWzXcL6LjBo1RJjRewXJs9MT7cTutuSUuNX.mVI8jOuBxdeBh4lw170Gx1HpKphRIrQJ82qX/CzJe0F7Soc/l.

利用 hashcat 尝试破解,采用增量破解,密码为 kalia,无畏小写字符,大概花了 40 分钟,速度还是慢。

hashcat -a 3 -m 1800 --force '$6$xyz$xWzXcL6LjBo1RJjRewXJs9MT7cTutuSUuNX.mVI8jOuBxdeBh4lw170Gx1HpKphRIrQJ82qX/CzJe0F7Soc/l.' --increment --increment-min 4 --increment-max 6 ?l?l?l?l?l

14、字典 + 掩码暴力破解

在字典前后再加上暴力的字符序列,比如在字典后面加上 3 为数字。

a -6 (Hybrid dict + mask)

15、掩码 + 字典暴力破解

a -7 (Hybridmask + dict)

查看破解结果#

直接利用 hashcat 命令查看

hashcat hash --show

查看 profile 文件。

/home/kali/.hashcat/hashcat.potfile

hashcat%E6%96%87%E7%AB%A0%20870ae67c89824363af4d1d43bcfd3aef/Untitled%206.png

hashcat 图形化#

项目地址:https://github.com/ctxis/crackerjack

🍃 启动 python 的虚拟环境,报错。

root@kali:~/crackerjack# python3 -m venv venv  
The virtual environment was not created successfully because ensurepip is not  
available.  On Debian/Ubuntu systems, you need to install the python3-venv  
package using the following command.  
  
    apt-get install python3-venv  
  
You may need to use sudo with that command.  After installing the python3-venv  
package, recreate your virtual environment.  
  
Failing command: ['/root/crackerjack/venv/bin/python3', '-Im', 'ensurepip', '--upgrade', '--default-pip']

🍃 安装环境即可。

apt-get install python3-venv

🍃 建立环境。

root@kali:~/crackerjack# python3 -m venv venv  
root@kali:~/crackerjack# . venv/bin/activate

🍃 安装依赖包。

pip --no-cache-dir install -r requirements.txt  
# 如果上述命令安装失败,可利用下面的命令一个个安装  
pip install -i https://pypi.doubanio.com/simple/ --trusted-host http://pypi.doubanio.com/ Flask-crontab

flask db init  
flask db migrate  
flask db upgrade  
#######################  
export FLASK_ENV=development  
export FLASK_APP=app  
flask run

🍃 第二次启动

root@kali:~/crackerjack# . venv/bin/activate  
flask run

访问安装界面

http://127.0.0.1:5000/install/

hashcat%E6%96%87%E7%AB%A0%20870ae67c89824363af4d1d43bcfd3aef/Untitled%207.png

hashcat%E6%96%87%E7%AB%A0%20870ae67c89824363af4d1d43bcfd3aef/Untitled%208.png

hashcat%E6%96%87%E7%AB%A0%20870ae67c89824363af4d1d43bcfd3aef/Untitled%209.png

hashcat%E6%96%87%E7%AB%A0%20870ae67c89824363af4d1d43bcfd3aef/Untitled%2010.png

hashcat%E6%96%87%E7%AB%A0%20870ae67c89824363af4d1d43bcfd3aef/Untitled%2011.png


hashcat%E6%96%87%E7%AB%A0%20870ae67c89824363af4d1d43bcfd3aef/Untitled%2012.png

hashcat%E6%96%87%E7%AB%A0%20870ae67c89824363af4d1d43bcfd3aef/Untitled%2013.png

hashcat%E6%96%87%E7%AB%A0%20870ae67c89824363af4d1d43bcfd3aef/Untitled%2014.png

hashcat%E6%96%87%E7%AB%A0%20870ae67c89824363af4d1d43bcfd3aef/Untitled%2015.png

hashcat%E6%96%87%E7%AB%A0%20870ae67c89824363af4d1d43bcfd3aef/Untitled%2016.png

hashcat%E6%96%87%E7%AB%A0%20870ae67c89824363af4d1d43bcfd3aef/Untitled%2017.png

hashcat%E6%96%87%E7%AB%A0%20870ae67c89824363af4d1d43bcfd3aef/Untitled%2019.png


参考:

https://tools.kali.org/password-attacks/hashcat

https://xz.aliyun.com/t/4008

https://www.freebuf.com/sectool/164507.html

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.