132-browser-check-tor-service.txt 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. Filename: 132-browser-check-tor-service.txt
  2. Title: A Tor Web Service For Verifying Correct Browser Configuration
  3. Version: $Revision$
  4. Last-Modified: $Date$
  5. Author: Robert Hogan
  6. Created: 2008-03-08
  7. Status: Draft
  8. Overview:
  9. Tor should operate a primitive web service on the loopback network device
  10. that tests the operation of user's browser, privacy proxy and Tor client.
  11. The tests are performed by serving unique, randomly generated elements in
  12. image URLs embedded in static HTML. The images are only displayed if the DNS
  13. and HTTP requests for them are routed through Tor, otherwise the 'alt' text
  14. may be displayed. The proposal assumes that 'alt' text is not displayed on
  15. all browsers so suggests that text and links should accompany each image
  16. advising the user on next steps in case the test fails.
  17. The service is primarily for the use of controllers, since presumably users
  18. aren't going to want to edit text files and then type something exotic like
  19. 127.0.0.1:9999 into their address bar. In the main use case the controller
  20. will have configured the actual port for the webservice so will know where
  21. to direct the request. It would also be the responsibility of the controller
  22. to ensure the webservice is available, and tor is running, before allowing
  23. the user to access the page through their browser.
  24. Motivation:
  25. This is a complementary approach to proposal 131. It overcomes some of the
  26. limitations of the approach described in proposal 131: reliance
  27. on a permanent, real IP address and compatibility with older versions of
  28. Tor. Unlike 131, it is not as useful to Tor users who are not running a
  29. controller.
  30. Objective:
  31. Provide a reliable means of helping users to determine if their Tor
  32. installation, privacy proxy and browser are properly configured for
  33. anonymous browsing.
  34. Proposal:
  35. When configured to do so, Tor should run a basic web service available
  36. on a configured port on 127.0.0.1. The purpose of this web service is to
  37. serve a number of basic test images that will allow the user to determine
  38. if their browser is properly configured and that Tor is working normally.
  39. The service can consist of a single web page with two columns. The left
  40. column contains images, the right column contains advice on what the
  41. display/non-display of the column means.
  42. The rest of this proposal assumes that the service is running on port
  43. 9999. The port should be configurable, and configuring the port enables the
  44. service. The service must run on 127.0.0.1.
  45. In all the examples below [uniquesessionid] refers to a random, base64
  46. encoded string that is unique to the URL it is contained in. Tor only ever
  47. stores the most recently generated [uniquesessionid] for each URL, storing 3
  48. in total. Tor should generate a [uniquesessionid] for each of the test URLs
  49. below every time a HTTP GET is received at 127.0.0.1:9999 for index.htm.
  50. The most suitable image for each test case is an implementation decision.
  51. Tor will need to store and serve images for the first and second test
  52. images, and possibly the third (see 'Open Issues').
  53. 1. DNS Request Test Image
  54. This is a HTML element embedded in the page served by Tor at
  55. http://127.0.0.1:9999:
  56. <IMG src="http://[uniquesessionid]:9999/torlogo.jpg" alt="If you can see
  57. this text, your browser's DNS requests are not being routed through Tor."
  58. width="200" height="200" align="middle" border="2">
  59. If the browser's DNS request for [uniquesessionid] is routed through Tor,
  60. Tor will intercept the request and return 127.0.0.1 as the resolved IP
  61. address. This will shortly be followed by a HTTP request from the browser
  62. for http://127.0.0.1:9999/torlogo.jpg. This request should be served with
  63. the appropriate image.
  64. If the browser's DNS request for [uniquesessionid] is not routed through Tor
  65. the browser may display the 'alt' text specified in the html element. The
  66. HTML served by Tor should also contain text accompanying the image to advise
  67. users what it means if they do not see an image. It should also provide a
  68. link to click that provides information on how to remedy the problem. This
  69. behaviour also applies to the images described in 2. and 3. below, so should
  70. be assumed there as well.
  71. 2. Proxy Configuration Test Image
  72. This is a HTML element embedded in the page served by Tor at
  73. http://127.0.0.1:9999:
  74. <IMG src="http://torproject.org/[uniquesessionid].jpg" alt="If you can see
  75. this text, your browser is not configured to work with Tor." width="200"
  76. height="200" align="middle" border="2">
  77. If the HTTP request for the resource [uniquesessionid].jpg is received by
  78. Tor it will serve the appropriate image in response. It should serve this
  79. image itself, without attempting to retrieve anything from the Internet.
  80. If Tor can identify the name of the proxy application requesting the
  81. resource then it could store and serve an image identifying the proxy to the
  82. user.
  83. 3. Tor Connectivity Test Image
  84. This is a HTML element embedded in the page served by Tor at
  85. http://127.0.0.1:9999:
  86. <IMG src="http://torproject.org/[uniquesessionid]-torlogo.jpg" alt="If you
  87. can see this text, your Tor installation cannot connect to the Internet."
  88. width="200" height="200" align="middle" border="2">
  89. The referenced image should actually exist on the Tor project website. If
  90. Tor receives the request for the above resource it should remove the random
  91. base64 encoded digest from the request (i.e. [uniquesessionid]-) and attempt
  92. to retrieve the real image.
  93. Even on a fully operational Tor client this test may not always succeed. The
  94. user should be advised that one or more attempts to retrieve this image may
  95. be necessary to confirm a genuine problem.
  96. Open Issues:
  97. The final connectivity test relies on an externally maintained resource, if
  98. this resource becomes unavailable the connectivity test will always fail.
  99. Either the text accompanying the test should advise of this possibility or
  100. Tor clients should be advised of the location of the test resource in the
  101. main network directory listings.
  102. Any number of misconfigurations may make the web service unreachable, it is
  103. the responsibility of the user's controller to recognize these and assist
  104. the user in eliminating them. Tor can mitigate against the specific
  105. misconfiguration of routing HTTP traffic to 127.0.0.1 to Tor itself by
  106. serving such requests through the SOCKS port as well as the configured web
  107. service report.
  108. Now Tor is inspecting the URLs requested on its SOCKS port and 'dropping'
  109. them. It already inspects for raw IP addresses (to warn of DNS leaks) but
  110. maybe the behaviour proposed here is qualitatively different. Maybe this is
  111. an unwelcome precedent that can be used to beat the project over the head in
  112. future. Or maybe it's not such a bad thing, Tor is merely attempting to make
  113. normally invalid resource requests valid for a given purpose.