hashcat -世界上最快、最先进的密码恢复工具

CS5285 Info Security for eCommerce 的作业,用到 hashcat,觉得挺好玩的,做个记录~

这个可以暴力破解hash,试了下 简单的五位数密码很快可以出来。我用的是CPU,它也有GPU的。看到有其他朋友说可以破解wifi密码。

hashcat - 世界上最快、最先进的密码恢复工具

一.官网在此

hashcat

You can download hashcat here: https://hashcat.net/hashcat/
直接下载解压,然后用cmd控制台运行hashcat.exe,它没有GUI
hashcat官网下载
也有github链接:https://github.com/hashcat/hashcat

二.hash格式参考

https://hashcat.net/wiki/doku.php?id=example_hashes
HashMode

一个MD5格式的例子,前面是pass,冒号后面是salt
MD5的格式例子

三.命令手册

General instructions for using hashcat
http://hashcat.net/wiki/doku.php?id=hashcat

主要的几个命令有:

  • -m, --hash-type
    参数就是上面Hash modes的数字,
    如果是用md5($salt. $pass)加密, (the stored value is h(s,pwd)), 那么就是 -m 20
    文档最下面附有默认值

  • -a, --attack-mode
    Supported attack modes
    Brute-Force attack (-a 3)
    Combinator attack (-a 1)
    Dictionary attack (-a 0)
    Hybrid attack (-a 6, -a 7)
    Mask attack (-a 3)
    Rule-based attack (-r option to -a 0)
    Toggle-Case attack (only supported by using rule files)
    Association attack (a -9)
    这里的话,我用的是暴力破解 -a 3

  • -D --opencl-device-types
    参数 default: GPUs if available
    1 | CPU
    2 | GPU
    3 | FPGA, DSP, Co-Processor
    用CPU的话就是 -D -1

  • -1, --custom-charset1 User-defined charset
    l | abcdefghijklmnopqrstuvwxyz [a-z]
    u | ABCDEFGHIJKLMNOPQRSTUVWXYZ [A-Z]
    d | 0123456789 [0-9]
    h | 0123456789abcdef [0-9a-f]
    H | 0123456789ABCDEF [0-9A-F]
    s | !"#$%&'()*+,-./:;<=>?@[]^_`{|}~
    a | ?l?u?d?s
    b | 0x00 - 0xff

    比如我的五位数密码 每个字符是A-Z,a-z,0-9,那么可以设置 -1 ?u?d?l ?1?1?1?1?1

    可以有四组:
    charset

四.小例子

那么已知这些
5-character passwords (from the set A-Z,a-z,0-9). MD5 is the hash function used.
hash value :afd1df2899c59428669daa8758b3e62f:255
uses a 8-bit salt (the stored value is h(s,pwd))

1. 单个hash串破解

命令可以是:

.\hashcat.exe -a 3 -D 1 -m 20 afd1df2899c59428669daa8758b3e62f:255 -1 ?u?d?l ?1?1?1?1?1 

然后就有结果了,后面的就是五位数密码
cracked

2. 整个文件破解

命令可以是:

.\hashcat.exe -m 20 -a 3 -D 1 file1.txt -1 ?u?d?l ?1?1?1?1?1 -o password.txt

file1.txt 是要破解的加密串文件
在这里插入图片描述
password.txt 是运行出来的密码文件
在这里插入图片描述
用时
在这里插入图片描述

评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值