Metasploit mailing list archives
Re: leet generator
From: Carlos Pantelides <carlos_pantelides () yahoo com>
Date: Sat, 11 Feb 2012 17:46:13 -0800 (PST)
Well, the script is almost done. The only problem left is how to deal with the options.
I see a few other modules but I couldn't find a better way to handle empty values. The way it is done, if you unset an
option, the module fails. So I have to set XXX "" instead of unset. Now I am sleepy, I will try tomorrow again, but any
help will be great.
-----------------------
require 'msf/core'
class Metasploit3 < Msf::Auxiliary
def initialize
super(
'Name' => 'Leet generator',
'Description' => %q{Generates all the leet combinations of a given word worD woRd woRD wOrd wOrD wORd wORD
w0rd w0rD w0Rd w0RD Word WorD WoRd WoRD WOrd WOrD WORd WORD W0rd W0rD W0Rd W0RD
Adjust the basemap hash to reduce or extend the combinations.
Keep in mind that "myleetpassword" generates 1327104 combinations
and "myprettyleetpassword" 509,607,936 combinations and takes about half an hour on a 2.40GHz
core
},
'Author' => [ 'Carlos Pantelides <carlos_pantelides[at]yahoo.com>' ],
'License' => MSF_LICENSE,
'Version' => '$Revision: 1 $'
)
register_options([
OptString.new('WORDLIST', [ false, "Source list",""]),
OptString.new('WORDS', [ false, "Word(s) to leet",""]),
OptString.new('OUTPUTFILE', [ false, "Output file",""])
], self.class)
end
def emit(level, buffer)
if level >= @permArray.length
@output.print buffer + "\n"
return
end
@permArray[level].each do |char|
emit(level + 1, buffer + char)
end
end
def run()
basemap = {
"0"=> ["0","o","O"],
"1"=> ["1","i","I","l","L"],
"2"=> ["2","z","Z"],
"3"=> ["3","e","E"],
"4"=> ["4","a","A"],
"5"=> ["5","s","S","5","$"],
"6"=> ["6","g","G"],
"7"=> ["7","t","T"],
"8"=> ["8","b","B"],
"9"=> ["9","g","G"],
"a"=> ["a","A","4","@"],
"b"=> ["b","B","8"],
"c"=> ["c","C","("],
"d"=> ["d","D"],
"e"=> ["e","E","3"],
"f"=> ["f","F"],
"g"=> ["g","G","6","9"],
"h"=> ["h","H"],
"i"=> ["i","I","1","!"],
"j"=> ["j","J"],
"k"=> ["k","K"],
"l"=> ["l","L","1"],
"m"=> ["m","M"],
"n"=> ["n","N"],
"o"=> ["o","O","0"],
"p"=> ["p","P"],
"q"=> ["q","Q"],
"r"=> ["r","R"],
"s"=> ["s","S","5","$"],
"t"=> ["t","T","7","+"],
"u"=> ["u","U"],
"v"=> ["v","V"],
"w"=> ["w","W"],
"x"=> ["x","X"],
"y"=> ["y","Y"],
"z"=> ["z","Z","2"],
}
words = datastore['WORDS']
wordlist = datastore['WORDLIST']
outputfile = datastore['OUTPUTFILE']
if words.length == 0 && wordlist.length == 0 then
print_error("Define WORDS or WORDLIST")
return
end
if words.length != 0 && wordlist.length != 0 then
print_error("Define only WORDS or WORDLIST")
return
end
if wordlist.length == 0 then
input = Array.new()
words.split(" ").each do |word|
input.push(word)
end
else
if ! File.readable?(wordlist) then
print_error("#{wordlist} not readable")
return
end
puts "FILE"
input = open(wordlist,"r")
end
if outputfile.length == 0 then
@output = $stdout
else
if ! File.writable?(outputfile) then
print_error("#{outputfile} not writable")
return
end
@output = open(outputfile, "w")
end
input.each do |word|
word = word.chomp
map = basemap
word.split("").each do |char|
if ! map.has_key?(char) then
map[char]=char
end
if nil == map[char].index(char.upcase ) then
map[char].insert(char.upcase)
end
if nil == map[char].index(char) then
map[char].insert(char)
end
end
idx = 0
@permArray = Array.new()
word.split("").each do |char|
@permArray[idx] = map[char]
idx += 1
end
emit(0,'');
end
if wordlist.length != 0 then
input.close
end
if outputfile.length != 0 then
@output.close
end
end
end
Carlos Pantelides
-----------------http://seguridad-agile.blogspot.com/_______________________________________________ https://mail.metasploit.com/mailman/listinfo/framework
Current thread:
- leet generator Carlos Pantelides (Feb 10)
- Re: leet generator Jonathan Cran (Feb 11)
- Re: leet generator Carlos Pantelides (Feb 11)
- Message not available
- Re: leet generator Carlos Pantelides (Feb 12)
- Re: leet generator Jonathan Cran (Feb 12)
- Re: leet generator Carlos Pantelides (Feb 12)
- Re: leet generator Jonathan Cran (Feb 13)
- Re: leet generator Carlos Pantelides (Feb 11)
- Re: leet generator Jonathan Cran (Feb 11)
