xxx-port-knocking.txt 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. Filename: xxx-port-knocking.txt
  2. Title: Port knocking for bridge scanning resistance
  3. Version: $Revision$
  4. Last-Modified: $Date$
  5. Author: Jacob Appelbaum
  6. Created: 19-April-2009
  7. Status: Draft
  8. Port knocking for bridge scanning resistance
  9. 0.0 Introduction
  10. This document is a collection of ideas relating to improving scanning
  11. resistance for private bridge relays. This is intented to stop opportunistic
  12. network scanning and subsequent discovery of private bridge relays.
  13. 0.1 Current Implementation
  14. Currently private bridges are only hidden by their obscurity. If you know
  15. a bridge ip address, the bridge can be detected trivially and added to a block
  16. list.
  17. 0.2 Configuring an external port knocking program to control the firewall
  18. It is currently possible for bridge operators to configure a port knocking
  19. daemon that controls access to the incoming OR port. This is currently out of
  20. scope for Tor and Tor configuration. This process requires the firewall to know
  21. the current nodes in the Tor network.
  22. 1.0 Suggested changes
  23. Private bridge operators should be able to configure a method of hiding their
  24. relay. Only authorized users should be able to communicate with the private
  25. bridge. This should be done with Tor and if possible without the help of the
  26. firewall. It should be possible for a Tor user to enter a secret key into
  27. Tor or optionally Vidalia on a per bridge basis. This secret key should be
  28. used to authenticate the bridge user to the private bridge.
  29. 1.x Issues with low ports and bind() for ORPort
  30. Tor opens low numbered ports during startup and then drops privileges. It is
  31. no longer possible to rebind to those lower ports after they are closed.
  32. 1.x Issues with OS level packet filtering
  33. Tor does not know about any OS level packet filtering. Currently there is no
  34. packet filters that understands the Tor network in real time.
  35. 1.x Possible partioning of users by bridge operator
  36. Depending on implementation, it may be possible for bridge operators to
  37. uniquely identify users. This appears to be a general bridge issue when a
  38. bridge operator uniquely deploys bridges per user.
  39. 2.0 Implementation ideas
  40. This is a suggested set of methods for port knocking.
  41. 2.x Using SPA port knocking
  42. Single Packet Authentication port knocking encodes all required data into a
  43. single UDP packet. Improperly formatted packets may be simply discarded.
  44. Properly formatted packets should be processed and appropriate actions taken.
  45. 2.x Using DNS as a transport for SPA
  46. It should be possible for Tor to bind to port 53 at startup and merely drop all
  47. packets that are not valid. UDP does not require a response and invalid packets
  48. will not trigger a response from Tor. With base32 encoding it should be
  49. possible to encode SPA as valid DNS requests. This should allow use of the
  50. public DNS infrastructure for authorization requests if desired.
  51. 2.x Ghetto firewalling with opportunistic connection closing
  52. Until a user has authenticated with Tor, Tor only has a UDP listener. This
  53. listener should never send data in response, it should only open an ORPort
  54. when a user has successfully authenticated. After a user has authenticated
  55. with Tor to open an ORPort, only users who have authenticated will be able
  56. to use it. All other users as identified by their ip address will have their
  57. connection closed before any data is sent or received. This should be
  58. accomplished with an access policy. By default, the access policy should block
  59. all access to the ORPort.
  60. 2.x Timing and reset of access policies
  61. Access to the ORPort is sensitive. The bridge should remove any exceptions
  62. to its access policy regularly when the ORPort is unused. Valid users should
  63. reauthenticate if they do not use the ORPort within a given time frame.
  64. 2.x Additional considerations
  65. There are many. A format of the packet and the crypto involved is a good start.