Files
metasploit-gs/tools/exploit/pattern_create.rb
T

29 lines
661 B
Ruby
Raw Normal View History

2005-12-17 06:46:23 +00:00
#!/usr/bin/env ruby
2010-05-03 17:13:09 +00:00
#
# $Id$
# $Revision$
#
msfbase = __FILE__
while File.symlink?(msfbase)
2013-09-30 13:47:53 -05:00
msfbase = File.expand_path(File.readlink(msfbase), File.dirname(msfbase))
end
2015-10-06 10:30:52 -05:00
$:.unshift(File.expand_path(File.join(File.dirname(msfbase), '..', '..', 'lib')))
2012-04-15 23:35:38 -05:00
require 'msfenv'
$:.unshift(ENV['MSF_LOCAL_LIB']) if ENV['MSF_LOCAL_LIB']
require 'rex'
if (!(length = ARGV.shift))
2013-09-30 13:47:53 -05:00
$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)