pwnlib.useragents — A database of useragent strings

Database of >22,000 user agent strings

pwnlib.useragents.getall() → str set[source]

Get all the user agents that we know about.

Parameters:None
Returns:A set of user agent strings.

Examples

>>> 'libcurl-agent/1.0' in getall()
True
>>> 'wget' in getall()
True
pwnlib.useragents.random() → str[source]

Get a random user agent string.

Parameters:None
Returns:A random user agent string selected from getall().
>>> import random as randommod
>>> randommod.seed(1)
>>> random()
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; FunWebProducts; FunWebProducts-MyTotalSearch; iebar)'