2005-12-17 06:46:23 +00:00
|
|
|
#!/usr/bin/env ruby
|
2010-05-03 17:13:09 +00:00
|
|
|
#
|
|
|
|
# $Id$
|
|
|
|
# $Revision$
|
|
|
|
#
|
2005-12-09 00:03:52 +00:00
|
|
|
|
2012-02-04 06:38:21 +00:00
|
|
|
msfbase = __FILE__
|
|
|
|
while File.symlink?(msfbase)
|
|
|
|
msfbase = File.expand_path(File.readlink(msfbase), File.dirname(msfbase))
|
|
|
|
end
|
|
|
|
|
|
|
|
$:.unshift(File.expand_path(File.join(File.dirname(msfbase), '..', 'lib')))
|
|
|
|
require 'fastlib'
|
|
|
|
|
|
|
|
$:.unshift(ENV['MSF_LOCAL_LIB']) if ENV['MSF_LOCAL_LIB']
|
2005-12-09 00:03:52 +00:00
|
|
|
|
|
|
|
require 'rex'
|
|
|
|
|
|
|
|
if (!(length = ARGV.shift))
|
|
|
|
$stderr.puts("Usage: #{File.basename($0)} length [set a] [set b] [set c]\n")
|
|
|
|
exit
|
|
|
|
end
|
|
|
|
|
|
|
|
# If the user supplied custom sets, use those. Otherwise, use the default
|
|
|
|
# sets.
|
|
|
|
sets = ARGV.length > 0 ? ARGV : Rex::Text::DefaultPatternSets
|
|
|
|
|
2010-05-03 17:13:09 +00:00
|
|
|
puts Rex::Text.pattern_create(length.to_i, sets)
|