Skip to content

Instantly share code, notes, and snippets.

@aurynn
Created July 4, 2014 05:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aurynn/af6d1c197e65242124c4 to your computer and use it in GitHub Desktop.
Save aurynn/af6d1c197e65242124c4 to your computer and use it in GitHub Desktop.
Simple greenletters ruby script to capture password hash generation
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