module Rex::UserAgent

A helper module for using and referencing comming user agent strings.

Constants

COMMON_AGENTS

List from techblog.willshouse.com/2012/01/03/most-common-user-agents/ This article was updated on July 11th 2015. It's probably worth updating this list over time.

This list is in the order of most common to least common.

Public Class Methods

most_common() click to toggle source

Choose the most frequent user agent

# File lib/rex/user_agent.rb, line 112
def self.most_common
  COMMON_AGENTS[0]
end
random() click to toggle source

Pick a random agent from the common agent list.

# File lib/rex/user_agent.rb, line 98
def self.random
  COMMON_AGENTS.sample
end
shortest() click to toggle source

Choose the agent with the shortest string (for use in payloads)

# File lib/rex/user_agent.rb, line 105
def self.shortest
  @@shortest_agent ||= COMMON_AGENTS.min { |a, b| a.size <=> b.size }
end