exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

SSH/SSL RSA Private Key Passphrase Dictionary Enumerator

SSH/SSL RSA Private Key Passphrase Dictionary Enumerator
Posted Apr 9, 2018
Authored by Todor Donev

This is a script to perform SSH/SSL RSA private key passphrase enumeration with a dictionary attack.

tags | tool, cracker
SHA-256 | 7ab5a3518579d6225c44138ba1ad72500274b0cd5b6549efb4e201c3f2eb8195

SSH/SSL RSA Private Key Passphrase Dictionary Enumerator

Change Mirror Download
#!/usr/bin/perl
#
# SSH/SSL RSA Private Key Passphrase dictionary enumerator
#
# Copyright 2018 (c) Todor Donev <todor.donev at gmail.com>
# https://ethical-hacker.org/
# https://facebook.com/ethicalhackerorg
#
# [todor@paladium]$ ssh-keygen -t rsa -b 4096 -C "info@ethical-hacker.org"
# Generating public/private rsa key pair.
# Enter file in which to save the key (/home/todor/.ssh/id_rsa): test_rsa.prv
# Enter passphrase (empty for no passphrase):
# Enter same passphrase again:
# Your identification has been saved in test_rsa.prv.
# Your public key has been saved in test_rsa.prv.pub.
# The key fingerprint is:
# --- SNIP --- info@ethical-hacker.org
# The key's randomart image is:
# +--[ RSA 4096]----+
# --- SNIP ---
# --- SNIP ---
# --- SNIP ---
# --- SNIP ---
# --- SNIP ---
# --- SNIP ---
# --- SNIP ---
# +-----------------+
# [todor@paladium]$ perl ssh-ssl-enum-privkey.pl test_rsa.prv wordlist.txt
# [+] SSH/SSL RSA Private Key Passphrase dictionary enumerator
# [*] ======
# [?] root != Passphrase
# [?] toor != Passphrase
# [?] r00t != Passphrase
# [?] t00r != Passphrase
# [?] admin != Passphrase
# [?] nimda != Passphrase
# [?] support != Passphrase
# [?] devel != Passphrase
# [?] oper != Passphrase
# [?] operator != Passphrase
# [?] hacker != Passphrase
# [?] h4x0r != Passphrase
# [?] noob != Passphrase
# [?] n00b != Passphrase
# [?] boon != Passphrase
# [?] b00n != Passphrase
# [*] ======
# [!] Author: Todor Donev <todor.donev at gmail.com>
# [!] https://ethical-hacker.org/
# [!] https://fb.com/ethicalhackerorg
# [*] ======
# [*] Passphrase for test_rsa.prv is Ethical-Hacker-Bulgaria-2o18
#
#
# Disclaimer:
# This or previous programs is for Educational
# purpose ONLY. Do not use it without permission.
# The usual disclaimer applies, especially the
# fact that Todor Donev is not liable for any
# damages caused by direct or indirect use of the
# information or functionality provided by these
# programs. The author or any Internet provider
# bears NO responsibility for content or misuse
# of these programs or any derivatives thereof.
# By using these programs you accept the fact
# that any damage (dataloss, system crash,
# system compromise, etc.) caused by the use
# of these programs is not Todor Donev's
# responsibility.
#
# Use them at your own risk!
#
# Requirements:
# cpan install Crypt::PK::RSA


use strict;
use warnings;
use Crypt::PK::RSA;

my ($p, $w) = @ARGV;
my $k = Crypt::PK::RSA->new;
print "[+] SSH/SSL RSA Private Key Passphrase dictionary enumerator\n";
&banner and die "[!] Usage: perl $0 <PRIVATE RSA KEY> <WORDLIST>" if @ARGV != 2;
my $iskey = do {
open (PRIVKEY, " <$p") or die "[-] Error: $p $!";
<PRIVKEY>
};
&banner and print "[-] Error: The choosen file is empty" and exit if (-z $p);
&banner and print "[-] Error: The choosen file is not valid private RSA key\n" and exit if $iskey !~ /--BEGIN RSA PRIVATE KEY--/;
open (WORDLIST, " <$w") or die "[-] Error: $w $!";
die "[-] Error: The wordlist is empty" if (-z $w);
my @file = <WORDLIST>;
print "[*] ======\n";
foreach my $c(@file)
{
chomp $c;
if (! eval { $k->import_key($p, $c) }) {

print "[?] $c != Passphrase\n";
} else{
&banner and die "[*] Passphrase for $p is $c\n";
}
}
close (WORDLIST);
&banner and print "[-] Sorry, I could not find the passphrase or the private key is corrupted!\n" and exit;

sub banner{
print "[*] ======\n";
print "[!] Author: Todor Donev <todor.donev at gmail.com>\n";
print "[!] https://ethical-hacker.org/\n";
print "[!] https://fb.com/ethicalhackerorg\n";
print "[*] ======\n";
}


Login or Register to add favorites

File Archive:

March 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Mar 1st
    16 Files
  • 2
    Mar 2nd
    0 Files
  • 3
    Mar 3rd
    0 Files
  • 4
    Mar 4th
    32 Files
  • 5
    Mar 5th
    28 Files
  • 6
    Mar 6th
    42 Files
  • 7
    Mar 7th
    17 Files
  • 8
    Mar 8th
    13 Files
  • 9
    Mar 9th
    0 Files
  • 10
    Mar 10th
    0 Files
  • 11
    Mar 11th
    15 Files
  • 12
    Mar 12th
    19 Files
  • 13
    Mar 13th
    21 Files
  • 14
    Mar 14th
    38 Files
  • 15
    Mar 15th
    15 Files
  • 16
    Mar 16th
    0 Files
  • 17
    Mar 17th
    0 Files
  • 18
    Mar 18th
    10 Files
  • 19
    Mar 19th
    32 Files
  • 20
    Mar 20th
    46 Files
  • 21
    Mar 21st
    16 Files
  • 22
    Mar 22nd
    13 Files
  • 23
    Mar 23rd
    0 Files
  • 24
    Mar 24th
    0 Files
  • 25
    Mar 25th
    12 Files
  • 26
    Mar 26th
    31 Files
  • 27
    Mar 27th
    19 Files
  • 28
    Mar 28th
    42 Files
  • 29
    Mar 29th
    0 Files
  • 30
    Mar 30th
    0 Files
  • 31
    Mar 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close