Known Bots

Known Bots 6.3.3

Free Download via Daily Lucky Task
  • a failure to reach the KnownBots API that can pass by itself - the API down, or the forum's server unable to connect to it, time out or look it up - is now logged as a warning and retried on the next run, and is written to the server error log only once fetching or sending has failed for three days in a row. A failure that cannot pass by itself, such as the API refusing the request or a certificate problem, is still written there at once. known-bots:validate shows how long each has been failing
  • bugfix: the "Fetch new bots", "Send user agents", "Purge old user agents" and "Clear all user agents" buttons in the admin control panel acted as soon as they were clicked, with no confirmation and without XenForo's protection against a request made from another site. Each now shows a confirmation page first, and only confirming it does the work
  • bugfix: "Clear all user agents" always reported that it had cleared 0 user agents, whatever the number removed. It now reports how many there were
  • bugfix: when something other than the KnownBots API answered in its place - a proxy, a captive portal or a firewall page - fetching new bots reported that no updates were available, every time, and nothing was logged. It is now written to the server error log, as it is when sending user agents or checking the API token, which until now failed with an unexplained error
  • known-bots:validate's checks are now declared to any addon that runs a forum's self-checks over an API, so they can be read without a shell on the server. Only each check's outcome is returned, and the API token check, which reaches the KnownBots API, is listed as skipped
  • an API that is temporarily unavailable is no longer written to the server error log when sending user agents, checking the API token or running known-bots:fetch - it is logged as a warning and retried on the next run, as fetching bots already was. known-bots:validate now warns rather than fails when the API is unavailable, since nothing on the forum is wrong
  • bugfix: known-bots:import stopped reading at the first blank line in its input, so every user agent after it was silently skipped and the count it reported covered only the lines before the gap. Blank lines are now skipped and the whole file is read
  • bugfix: known-bots:parse had the same fault - a blank line in a log file or on stdin ended the run early, and nothing in the output said so. It now reads to the end of the input, or until --limit is reached
  • bugfix: the fetch cron could exhaust PHP's memory limit on a forum with a large number of stored user agents, because reprocessing them after new bot definitions arrived loaded every one at once. They are now reprocessed in batches, and memory use no longer grows with the number stored. The send cron reads them more cheaply too
  • bugfix: when the API sent bot data that failed validation, the "update bots" admin tool and known-bots:fetch crashed with an error instead of reporting it. Both now say the data was refused and that the server error log has the details, and the command exits with a failure
  • bugfix: a user agent long enough to make a browser pattern fail to run was taken for a real browser, so it was never stored and reprocessing deleted it. It is now treated as unrecognised
  • bugfix: a user agent stored while the send cron was sending to the API was marked as sent without being included, so it was never sent. Only the user agents actually sent are marked now
  • new: known-bots:config prints every setting this addon uses and where each one comes from, including the state that is not on any one screen in the admin control panel - the bot definitions on disk, the code cache detection reads, the stored user agent counts and the three cron entries. Settings which hold a credential are reported as set or not set, never printed
  • new: known-bots:validate checks that bot detection actually works on this forum - the definitions are present and current, the code cache was built from them, a known bot is recognised and a real browser is not, the cron entries exist and are active, the email addresses are valid, and the API token is accepted. It changes nothing, and --unattended skips the one check which reaches the API. See the README for the four outcomes and the exit codes
  • support change: now requires PHP 7.4 or higher. XenForo 2.2 itself runs on PHP 7.0 or higher, so a 2.2 forum on an older PHP can no longer install this addon - 6.2.0 remains the last version which runs there
  • entries this addon writes to the XenForo server error log now begin with the addon's name, so they can be told apart from every other addon's
  • log entries now carry a constant message with the counts, the user agent and the exception details in the entry's context rather than written into the message text, so a log store can group and count them - if you match on log message text, those patterns will need updating. Reprocessing user agents now logs one summary entry with its counts at info and the per-agent detail at debug, and a refused API response no longer logs the whole response body (only applies if you have the Monolog addon installed - otherwise nothing is logged)
  • this addon now declares which of its settings hold a credential, so that an addon which reports the forum's configuration can show the rest of them rather than withholding every one; the License validation token and the API token are still withheld
bugfix: don't try and decode json if we aren't sure we have a 200 status code - it might not be valid json and so might fail
now requires Manage known bots admin permission to see admin tools
bugfix: XF2.3 compatibility for sending new bots via an email attachment
This update contains an important bugfix to handle malformed UTF-8 in user agent strings.
This update will simply ignore any user agents with malformed UTF-8, avoiding errors when trying to send updates via the API. These user agents are invalid and so there is no point undertaking any further analysis - thus they are silently discarded.
This new version also contains an additional CLI tool for importing user agents from a text file, for testing purposes.
Minor bug fix - no need to update unless you are experiencing problems sending bot updates.

  • when sending bots via email, include the bot list as an attachment rather than in the body
  • new CLI tool to send bots via email directly, used for debugging bot sending issues
  • new CLI tool known-bots😛arse to parse web server log files and display detected bots
  • new CLI tool known-bots:send to send newly detected user agents to the KnownBots API for analysis
  • new CLI tool known-bots:check-token to validate that the API token successfully authenticates - and optionally have the system regenerate a new API token if it has expired
  • knownbots@hampel.io email address is deprecated and will be removed soon - emails should no longer be sent to this address
  • new configuration option to "Send user agents via API", which requires configuration by entering a XenForo license validation token. New agents are sent directly via api and no longer by email
  • the "Email user agents" option remains - but is used only for forum administrators to send themselves emails if they choose. Upgrading to v6 of the addon removes any reference to knownbots@hampel.io from this configuration option.
  • addon now uses v3 of the bot fetch API, which includes new functionality
  • v2 of the bot fetch API remains operational for sites still using addon v5.x
  • v1 of the bot fetch API is now deprecated and will soon stop functioning - sites still using addon v4.x should upgrade as soon as possible
  • new functionality for the addon - a list of regex based ignore strings to remove malformed or obfuscated user agents from analysis. This also allows us to ignore user agents containing sql-injection and other forms of attack which typically flood a system with a large number of unique user agents in a short period of time.
  • performance enhancement - we no longer do browser or ignored checks for user agents of users who are logged in. We assume that anyone logged in with a valid XenForo user id is using a valid browser. Note that bot detection is still run, just in case. This significantly reduces the amount of processing performed by the addon for valid users.
v5.0.0 is a major rewrite of the core functionality of this addon aimed at improving processing speed, bot detection sophistication and greatly enhancing our ability to identify new bots.

Note that the options have changed - so please check the options after upgrading. More information about each option is provided on the main addon page.
  • major rewrite - no longer use "bot|spider|crawl" search strings and false-positive lists to identify possible bots, rely instead on search strings supplied by API to identify valid browsers and store them directly in the database rather than the SimpleCache, ready for emailing
  • more complete agent reprocessing - check for valid browsers and ignored agents
  • change the core userAgentMatchesRobot function to use strpos instead of preg_match, it's much faster and won't fall over with extremely high numbers of bot match strings
  • allow BotFetcher to be manually configured to bypass untrusted http agent - used for testing when API source is on a .local domain. Default action remains to use the untrusted http agent to allow for proxying outbound API calls.
  • change email cron to daily send
  • using new v2 API from KnownBots
  • replace generic bots with complex (regex) based searches
  • add "Fetch new bots" button to Known Bots List in admin UI
  • automatically reprocess user agents after loading new bot data
  • new Cli command for reprocessing user agents, including the option to force all user agents to be reprocessed
  • improvements to user agent test in admin ui to be more descriptive
  • bcc additional email address to keep them private
  • bugfix: don't linkify known bot list when no links supplied
Back
Top