简介
Hydra 一般用来暴力破解密码,它支持多种协议的密码破解
参数详解
Syntax(语法): hydra [[[-l LOGIN|-L FILE] [-p PASS|-P FILE]] | [-C FILE]] [-e nsr] [-o FILE] [-t TASKS] [-M FILE [-T TASKS]] [-w TIME] [-W TIME] [-f] [-s PORT] [-x MIN:MAX:CHARSET] [-c TIME] [-ISOuvVd46] [-m MODULE_OPT] [service://server[:PORT][/OPT]]
-R restore a previous aborted/crashed session
恢复之前中止的会话
-I ignore an existing restore file (don't wait 10 seconds)
忽略现有的还原文件(不等待开始的10秒)
-S perform an SSL connect
执行SSL连接
-s PORT if the service is on a different default port, define it here
如果服务不是默认端口,在这里指定它
-l LOGIN or -L FILE login with LOGIN name, or load several logins from FILE
指定登录账号或账号所在的文件,-l 后边跟单一的账号,-L 后边跟文件名(绝对路径)
-p PASS or -P FILE try password PASS, or load several passwords from FILE
尝试的密码或密码本,-p 后边单一密码,用于信息收集后的账号爆破,-P 后边跟密码本路径
-x MIN:MAX:CHARSET password bruteforce generation, type "-x -h" to get help
生成暴力破解的密码本,如 -x 3:5:a 生成3到5位的由小写字母组成的密码本
-y disable use of symbols in bruteforce, see above
禁用暴力破解中的符号
-r use a non-random shuffling method for option -x
对-x选项使用非随机模式
-e nsr try "n" null password, "s" login as pass and/or "r" reversed login
n 尝试空密码,s 作为密码登录,r 反向登录 没用过,不熟
-C FILE colon separated "login:pass" format, instead of -L/-P options
文件中使用冒号分隔 账号:密码 的模板,不用 -L/-P 选项
-M FILE list of servers to attack, one entry per line, ':' to specify port
在文件里列出要攻击的服务,一行一个,用冒号指定对应的端口
-o FILE write found login/password pairs to FILE instead of stdout
把爆破成功的 账号密码 写入指定的文件,而不是输出到命令行
-b FORMAT specify the format for the -o FILE: text(default), json, jsonv1
指定输出文件的格式,默认是文本,可以指定 json jsonv1
-f / -F exit when a login/pass pair is found (-M: -f per host, -F global)
找到 账号密码 之后退出,-f 每个主机 -F 全局
-t TASKS run TASKS number of connects in parallel per target (default: 16)
每个目标同时运行的连接数(默认16)
-T TASKS run TASKS connects in parallel overall (for -M, default: 64)
全局同时运行的连接数(默认64)
-w / -W TIME wait time for a response (32) / between connects per thread (0)
每个线程的连接之间的响应等待时间(32)/(0)
-c TIME wait time per login attempt over all threads (enforces -t 1)
所有线程每次登录的等待时间
-4 / -6 use IPv4 (default) / IPv6 addresses (put always in [] also in -M)
选择IP地址模式,IPv4或IPv6
-v / -V / -d verbose mode / show login+pass for each attempt / debug mode
详情模式、显示每次尝试的账号密码、调试模式
-O use old SSL v2 and v3
使用旧的 SSL v2 和 v3 版本
-K do not redo failed attempts (good for -M mass scanning)
不重做失败的尝试(试用与 -M 扫描)
-q do not print messages about connection errors
不打印连接失败的信息
-U service module usage details
服务模块使用详情
-m OPT options specific for a module, see -U output for information
特定于模块的选项,有关信息,请参阅-U输出
server the target: DNS, IP or 192.168.0.0/24 (this OR the -M option)
目标:DNS IP 或 网段
service the service to crack (see below for supported protocols)
要破解的服务(请参阅下面的支持协议)
OPT some service modules support additional input (-U for module help)
一些服务模块支持额外的输入(-U表示模块帮助)
常用命令
-
使用字典破解目标服务
hydra -L username.txt -P passwd.txt 127.0.0.1 ssh # 对方默认22端口 hydra -L username.txt -P passwd.txt ssh://127.0.0.1 # 效果同上 hydra -L username.txt -P passwd.txt 127.0.0.1 -s targetIP ssh # 对方修改了ssh默认端口 使用-s 指定目标端口 hydra -L username.txt -P passwd.txt ssh://127.0.0.1 -s targetIP # 效果同上
-
指定用户名/密码破解
hydra -l username -P passwd.txt 127.0.0.1 ssh # 适用于已知账号,爆破密码 hydra -L username.txt -P passwd 127.0.0.1 ssh # 使用与已知密码,爆破账号
-
输出爆破成功的密码至指定位置
hydra -L username.txt -P passwd.txt 127.0.0.1 ssh -o xxx.txt