Method: Rex::Poly::LogicalBlock#rand_perm

Defined in:
lib/rex/poly/block.rb

#rand_permObject

Returns a random permutation that is encapsulated in a Permutation class instance.



161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
# File 'lib/rex/poly/block.rb', line 161

def rand_perm
  perm = nil

  if (@state.badchars)
    perm = rand_perm_badchars
  else
    perm = Permutation.new(@perms[rand(@perms.length)], self)
  end

  if (perm.nil?)
    raise RuntimeError, "Failed to locate a valid permutation."
  end

  perm
end