Skip to content
  • Philipp Winter's avatar
    Support handing out decoy bridges to bots. · 7ceb25e3
    Philipp Winter authored
    This patch makes it possible to identify bots by inspecting HTTP request
    headers.  A CSV file, specified by BLACKLISTED_REQUEST_HEADERS_FILE,
    contains mappings from request header to a regular expression of the
    header's value, e.g.:
    
      Accept-Language,[Kk]lingon
      User-Agent,Spa+ce
      ...
    
    Once a regular expression matches a client's request, we probably caught
    a bot.  This patch also makes it possible to respond to bot requests
    with a decoy bridge, e.g., to study what the owners of the bot intend to
    do with the bridge.  Decoy bridges are configured in the CSV file
    DECOY_BRIDGES_FILE.  The file maps a transport type and its IP address
    version to bridge lines, e.g.:
    
      vanillav4,1.2.3.4:1234 FINGERPRINT
      obfs4v4,obfs4 1.2.3.4:1234 FINGERPRINT ARGS
      ...
    
    This fixes <https://bugs.torproject.org/31252>
    7ceb25e3