This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
import crypt | |
def testPass(cryptPass): | |
salt = cryptPass[0:2] | |
dictFile = open('dictionary.txt', 'r') | |
for word in dictFile.readlines(): | |
word = word.strip('\n') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# -*- coding: utf-8 -*- | |
def test_pass(crypt_pass) | |
salt = crypt_pass[0, 2] | |
File.foreach('dictionary.txt').map(&:strip).each do |word| | |
return puts '[+] Found Password: ' + word if word.crypt(salt) == crypt_pass | |
end | |
puts '[-] Password Not Found' | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'violent_ruby' | |
# configs are cool | |
config = { file: "/etc/passwd", dictionary: "dictionary.txt" } | |
# create a Unix Password Cracker object, with hte config | |
upc = ViolentRuby::UnixPasswordCracker.new(config) | |
# attempt to crack passwords, doing some stuff with the result | |
upc.crack do |result| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Unix Password Cracker | |
# @author Kent 'picat' Gruber | |
class UnixPasswordCracker | |
# @!attribute file | |
# @return [String] Path to the /etc/passwd file. | |
attr_accessor :file | |
# @!attribute dictionary | |
# @return dictionary [String] Path to dictionary file. | |
attr_accessor :dictionary | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Parse a unix /etc/passwd file into a more mangeable form. | |
# | |
# @example Basic Usage | |
# upc = ViolentRuby::UnixPasswordCracker.new | |
# upc.parse_etc_file(file: 'passwords.txt') | |
# # {"victim" => "HX9LLTdc/jiDE", "root" => "DFNFxgW7C05fo"} | |
# | |
# @example Super Advanced Usage | |
# ViolentRuby::UnixPasswordCracker.new.parse_etc_file(file: 'passwords.txt') do |user, pass| | |
# puts user + ' ' + pass |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
upc = ViolentRuby::UnixPasswordCracker.new | |
upc.parse_etc_file(file: 'passwords.txt') | |
# {"victim" => "HX9LLTdc/jiDE", "root" => "DFNFxgW7C05fo"} | |
upc.parse_etc_file(file: 'passwords.txt') do |user, pass| | |
puts user + ' ' + pass | |
end | |
# victim HX9LLTdc/jiDE | |
# root DFNFxgW7C05fo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Check if a given encrypted password matches a given plaintext | |
# word when the same crytographic operation is performed on it. | |
# | |
# @example Basic Usage | |
# ViolentRuby::UnixPasswordCracker.new.check_password('HX9LLTdc/jiDE', 'egg') | |
# # true | |
# | |
# @example Advanced Usage | |
# ViolentRuby::UnixPasswordCracker.new.check_password('HXA82SzTqypHA', 'egg ') | |
# # false |