Created
July 4, 2014 05:38
-
-
Save aurynn/af6d1c197e65242124c4 to your computer and use it in GitHub Desktop.
Simple greenletters ruby script to capture password hash generation
This file contains 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 'greenletters' | |
znc = Greenletters::Process.new("znc -s") | |
pass = "foo" | |
salt = method = hash = nil | |
znc.start! | |
znc.wait_for(:output, /Enter Password/i) | |
znc << pass + "\n" | |
znc.wait_for(:output, /Confirm Password/i) | |
znc << pass + "\n" | |
znc.wait_for(:output, /Pass/) do |m_d| | |
puts "woo" | |
m_d.on(:output, /Method = (?<method>[\w\d]+)/) do |p, md| | |
puts "string:" | |
puts md.matched[/Method = (?<method>[\w\d]+)$/, "method"] | |
end | |
m_d.on(:output, /Hash = (?<method>[\w\d]+)/) do |p, md| | |
puts "string:" | |
puts md.matched[/Hash = (?<method>[\w\d]+)$/, "method"] | |
end | |
m_d.on(:output,/Salt = (?<method>.*)\n/) do |p, md| | |
puts "string:" | |
puts md.matched[/Salt = (?<method>.*)\n/, "method"] | |
end | |
end | |
puts salt | |
puts hash | |
puts method | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment