131-verify-tor-usage.txt 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. Filename: 131-verify-tor-usage.txt
  2. Title: Help users to verify they are using Tor
  3. Version: $Revision$
  4. Last-Modified: $Date$
  5. Author: Steven J. Murdoch
  6. Created: 2008-01-25
  7. Status: Needs-Revision
  8. Overview:
  9. Websites for checking whether a user is accessing them via Tor are a
  10. very helpful aid to configuring web browsers correctly. Existing
  11. solutions have both false positives and false negatives when
  12. checking if Tor is being used. This proposal will discuss how to
  13. modify Tor so as to make testing more reliable.
  14. Motivation:
  15. Currently deployed websites for detecting Tor use work by comparing
  16. the client IP address for a request with a list of known Tor nodes.
  17. This approach is generally effective, but suffers from both false
  18. positives and false negatives.
  19. If a user has a Tor exit node installed, or just happens to have
  20. been allocated an IP address previously used by a Tor exit node, any
  21. web requests will be incorrectly flagged as coming from Tor. If any
  22. customer of an ISP which implements a transparent proxy runs an exit
  23. node, all other users of the ISP will be flagged as Tor users.
  24. Conversely, if the exit node chosen by a Tor user has not yet been
  25. recorded by the Tor checking website, requests will be incorrectly
  26. flagged as not coming via Tor.
  27. The only reliable way to tell whether Tor is being used or not is for
  28. the Tor client to flag this to the browser.
  29. Proposal:
  30. A DNS name should be registered and point to an IP address
  31. controlled by the Tor project and likely to remain so for the
  32. useful lifetime of a Tor client. A web server should be placed
  33. at this IP address.
  34. Tor should be modified to treat requests to port 80, at the
  35. specified DNS name or IP address specially. Instead of opening a
  36. circuit, it should respond to a HTTP request with a helpful web
  37. page:
  38. - If the request to open a connection was to the domain name, the web
  39. page should state that Tor is working properly.
  40. - If the request was to the IP address, the web page should state
  41. that there is a DNS-leakage vulnerability.
  42. If the request goes through to the real web server, the page
  43. should state that Tor has not been set up properly.
  44. Extensions:
  45. Identifying proxy server:
  46. If needed, other applications between the web browser and Tor (e.g.
  47. Polipo and Privoxy) could piggyback on the same mechanism to flag
  48. whether they are in use. All three possible web pages should include
  49. a machine-readable placeholder, into which another program could
  50. insert their own message.
  51. For example, the webpage returned by Tor to indicate a successful
  52. configuration could include the following HTML:
  53. <h2>Connection chain</h2>
  54. <ul>
  55. <li>Tor 0.1.2.14-alpha</li>
  56. <!-- Tor Connectivity Check: success -->
  57. </ul>
  58. When the proxy server observes this string, in response to a request
  59. for the Tor connectivity check web page, it would prepend it's own
  60. message, resulting in the following being returned to the web
  61. browser:
  62. <h2>Connection chain
  63. <ul>
  64. <li>Tor 0.1.2.14-alpha</li>
  65. <li>Polipo version 1.0.4</li>
  66. <!-- Tor Connectivity Check: success -->
  67. </ul>
  68. Checking external connectivity:
  69. If Tor intercepts a request, and returns a response itself, the user
  70. will not actually confirm whether Tor is able to build a successful
  71. circuit. It may then be advantageous to include an image in the web
  72. page which is loaded from a different domain. If this is able to be
  73. loaded then the user will know that external connectivity through
  74. Tor works.
  75. Automatic Firefox Notification:
  76. All forms of the website should return valid XHTML and have a
  77. hidden link with an id attribute "TorCheckResult" and a target
  78. property that can be queried to determine the result. For example,
  79. a hidden link would convey success like this:
  80. <a id="TorCheckResult" target="success" href="/"></a>
  81. failure like this:
  82. <a id="TorCheckResult" target="failure" href="/"></a>
  83. and DNS leaks like this:
  84. <a id="TorCheckResult" target="dnsleak" href="/"></a>
  85. Firefox extensions such as Torbutton would then be able to
  86. issue an XMLHttpRequest for the page and query the result
  87. with resultXML.getElementById("TorCheckResult").target
  88. to automatically report the Tor status to the user when
  89. they first attempt to enable Tor activity, or whenever
  90. they request a check from the extension preferences window.
  91. If the check website is to be themed with heavy graphics and/or
  92. extensive documentation, the check result itself should be
  93. contained in a seperate lightweight iframe that extensions can
  94. request via an alternate url.
  95. Security and resiliency implications:
  96. What attacks are possible?
  97. If the IP address used for this feature moves there will be two
  98. consequences:
  99. - A new website at this IP address will remain inaccessible over
  100. Tor
  101. - Tor users who are leaking DNS will be informed that Tor is not
  102. working, rather than that it is active but leaking DNS
  103. We should thus attempt to find an IP address which we reasonably
  104. believe can remain static.
  105. Open issues:
  106. If a Tor version which does not support this extra feature is used,
  107. the webpage returned will indicate that Tor is not being used. Can
  108. this be safely fixed?
  109. Related work:
  110. The proposed mechanism is very similar to config.privoxy.org. The
  111. most significant difference is that if the web browser is
  112. misconfigured, Tor will only get an IP address. Even in this case,
  113. Tor should be able to respond with a webpage to notify the user of how
  114. to fix the problem. This also implies that Tor must be told of the
  115. special IP address, and so must be effectively permanent.