Twenty Year Anniversary

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
MD5 | a7800e5b746d5a13f5f887936bcbc785

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";
}


Comments

RSS Feed Subscribe to this comment feed

No comments yet, be the first!

Login or Register to post a comment

Want To Donate?


Bitcoin: 18PFeCVLwpmaBuQqd5xAYZ8bZdvbyEWMmU

File Archive:

June 2018

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2018 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close