Skip to content

Instantly share code, notes, and snippets.

@picatz
Created April 16, 2017 01:49
Show Gist options
  • Save picatz/cdc5298b98fdb69fd55dc7b0a6030859 to your computer and use it in GitHub Desktop.
Save picatz/cdc5298b98fdb69fd55dc7b0a6030859 to your computer and use it in GitHub Desktop.
Violent Ruby: Unix Password Cracker Base
# 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
# Same same, but different, but still same.
alias etc file
# Create a new Unix Password Cracker.
#
# @param args [Hash] The options to create a new Unix Password Cracker.
# @option args [String] :file The path to an /etc/passwd file.
# @option args [String] :dictionary The path to a dictionry of passwords.
#
# @return [UnixPasswordCracker]
def initialize(args = {})
@file = args[:file] if args[:file]
@dictionary = args[:dictionary] if args[:dictionary]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment