-
-
Save prashanth-sams/a405c236f8151dd72146e013ac644555 to your computer and use it in GitHub Desktop.
Just charset brute force script
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 | |
# | |
## Brute code stolen form: https://gist.github.com/petehamilton/4755855 | |
# | |
def result?(sub) | |
puts sub | |
1 == 2 | |
end | |
def crack_yielding(chars) | |
crack_yield(chars){ |p| | |
return p if result?(p) | |
} | |
end | |
def crack_yield(chars) | |
chars.each { |c| yield c } | |
crack_yield(chars) { |c| | |
chars.each do |x| | |
yield c + x | |
end | |
} | |
end | |
chars = ('a'..'z').to_a | |
(0..9).each {|x| chars << x.to_s} | |
crack_yielding(chars) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment