protocol.html 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  2. "http://www.w3.org/TR/html4/loose.dtd">
  3. <html>
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  6. <title>
  7. GnuDIP Client-Server Update Protocol
  8. </title>
  9. <base target="_blank">
  10. </head>
  11. <body bgcolor=white>
  12. <table><tr valign=middle><td>
  13. <img align=middle src="gnudip.jpg" alt="GnuDIP Logo" border=0 height=60 width=113>
  14. </td><td>
  15. <h1>GnuDIP Client-Server Update Protocol</h1>
  16. </table>
  17. <p><hr>
  18. <p>
  19. There are in fact two update protocols. The original
  20. protocol involves a direct TCP connection by the client to the server.
  21. There is also an adaptation of the original protocol
  22. to HTTP (web server protocol). The HTTP protocol is more convenient for
  23. authors of generic Windows dynamic DNS update clients, such as
  24. <a href="http://www.noeld.com/dldynsite.htm">DynSite</a>.
  25. <p>
  26. <b>
  27. With either of these protocols it is not possible for wire tappers
  28. to determine the clear text password, nor is it possible for them to
  29. "spoof" the update server using captured and modified update messages.
  30. </b>
  31. <p><hr>
  32. <h2><u>
  33. The Original Direct TCP Connection Protocol
  34. </u></h2>
  35. <p>
  36. ASCII is (of course) used for representing printable characters.
  37. <p>
  38. The client makes a TCP connection to the appropriate port on the server host.
  39. This port is normally 3495, but a GnuDIP site could choose another port.
  40. <p>
  41. As soon as the connection is established the server will send a randomly
  42. generated 10 character "salt" string. This is used in the following algorithm for
  43. hashing the password:
  44. <ul>
  45. <li>
  46. Digest the user's password using
  47. <a href="http://www.ietf.org/rfc/rfc1321.txt">
  48. the MD5 digest message digest algorithm</a>.
  49. Convert the digest value (which is a <u>binary</u> value)
  50. to its hexadecimal character string representation
  51. (characters 0-9 and lower case a-f).
  52. <p><li>
  53. Append a period (".") and the salt value to create a longer character string.
  54. <p><li>
  55. Digest this longer character string and convert it to its hexadecimal
  56. character representation.
  57. </ul>
  58. <p>
  59. The update message character string is then transmited to the GnuDIP server.
  60. This must be in one of these forms:
  61. <ul>
  62. <li>
  63. <code>
  64. user_name:hashed_password:domain:0:address
  65. </code>
  66. <p>
  67. This requests that the IP address provided be registered as the (only) address
  68. for FQDN <code>user_name.domain</code>.
  69. <p>
  70. In the most common case, the client would pass the address it detects at its end
  71. of the connection.
  72. <p>
  73. By default, for compatibility with earlier releases of GnuDIP, the GnuDIP server
  74. will allow the IP adddress to be omitted. If the IP address is not provided,
  75. the server writes a notice to the log, and the IP address the server detects at
  76. the other end of the connection is registered instead.
  77. Note that these two addresses will be the same unless the client is behind some
  78. sort of proxy. However a site operator
  79. may choose to override this backwards compatibility, in order to discourage the
  80. use of old clients.
  81. <p>
  82. In response to this message, the server will return one of:
  83. <ul>
  84. <li>
  85. <code>1</code>
  86. <p>
  87. This indicates an invalid login.
  88. <p><li>
  89. <code>0</code>
  90. <p>
  91. This indicates a successful update.
  92. </ul>
  93. <p><li>
  94. <code>
  95. user_name:hashed_password:domain:1
  96. </code>
  97. <p>
  98. This requests that any IP address currently registered for FQDN
  99. <code>user_name.domain</code> be removed ("offline" request). The FQDN <code>user_name.domain</code>
  100. will no longer correspond to any IP address.
  101. <p>
  102. In response to this message, the server will return one of:
  103. <ul>
  104. <li>
  105. <code>1</code>
  106. <p>
  107. This indicates an invalid login.
  108. <p><li>
  109. <code>2</code>
  110. <p>
  111. This indicates a successful offline.
  112. </ul>
  113. <p><li>
  114. <code>
  115. user_name:hashed_password:domain:2
  116. </code>
  117. <p>
  118. This requests that the server determine the IP address it sees at the client end
  119. of the connection, and register that as the (only) address for FQDN
  120. <code>user_name.domain</code>. This IP address will also be returned
  121. to the client.
  122. <p>
  123. In response to this message, the server will return one of:
  124. <ul>
  125. <li>
  126. <code>1</code>
  127. <p>
  128. This indicates an invalid login.
  129. <p><li>
  130. <code>0:address</code>
  131. <p>
  132. This indicates a successful update and provides the address that was registered.
  133. </ul>
  134. </ul>
  135. <p><hr>
  136. <h2><u>
  137. The HTTP Based Protocol
  138. </u></h2>
  139. <p>
  140. The HTTP version of the protocol requires the client issue an HTTP
  141. GET request, parse the response, use MD5 to obscure the password,
  142. issue a second HTTP GET request and parse that response. We first
  143. give a conceptual overview, then a concrete example.
  144. <p>
  145. If a GnuDIP site operator follows the default installation procedure,
  146. the path part of the URL (the part after the host name) for the HTTP
  147. update server CGI script will be
  148. <code>/gnudip/cgi-bin/gdipupdt.cgi</code>.
  149. <p>
  150. In the first HTTP GET request, no query string (the part of an URL
  151. after the "?") is provided. It is interpreted as
  152. a "request for a salt". The response contains three pieces of
  153. data:
  154. <ol>
  155. <li>a randomly generated 10 character "salt" string
  156. <li>a "time salt generated" value
  157. <li>a "signature"
  158. </ol>
  159. These values are passed in <u>HTML meta tags</u>, as in this example:
  160. <blockquote><pre>
  161. &lt;meta name="salt" content="XLCDgXvzSo"&gt;
  162. &lt;meta name="time" content="1002164730"&gt;
  163. &lt;meta name="sign" content="8278f108c83d822048ce0375bede5c15"&gt;
  164. </pre></blockquote>
  165. Each meta tag will be on its own line and left justified on the line.
  166. The white space gaps before "name=" and "content=" will each consist
  167. of a single space.
  168. The tags will be in the order shown. There will be no other HTML meta
  169. tags in the response.
  170. <p>
  171. The salt is used in the following algorithm for hashing the password:
  172. <ul>
  173. <li>
  174. Digest the user's password using
  175. <a href="http://www.ietf.org/rfc/rfc1321.txt">
  176. the MD5 digest message digest algorithm</a>.
  177. Convert the digest value (which is a <u>binary</u> value)
  178. to its hexadecimal character string representation
  179. (characters 0-9 and lower case a-f).
  180. <p><li>
  181. Append a period (".") and the salt value to create a longer character string.
  182. <p><li>
  183. Digest this longer character string and convert it to its hexadecimal
  184. character representation.
  185. </ul>
  186. <p>
  187. Now the second HTTP GET request is issued. In this request the query string
  188. (the part of an URL after the "?") contains the following parameters:
  189. <ol>
  190. <li>the "salt" from the first response ("salt=")
  191. <li>the "time salt generated" value from the first response ("time=")
  192. <li>the "signature" from the first response ("sign=")
  193. <li>the GnuDIP user name ("user=")
  194. <li>the GnuDIP domain name ("domn=")
  195. <li>the MD5 digested password created above ("pass=")
  196. <li>the server "request code" ("reqc="):
  197. <ul>
  198. <li>"0" - register the address passed with this request
  199. <li>"1" - go offline
  200. <li>"2" - register the address you see me at, and pass it back to me
  201. </ul>
  202. <li>the IP address to be registered, if the request code is "0" ("addr=")
  203. </ol>
  204. A request with a request code of "0" and an address of "0.0.0.0" will be treated
  205. as an offline request.
  206. <p>
  207. This is an example of a query string:
  208. <blockquote><pre>
  209. salt=XLCDgXvzSo&amp;time=1002164730&amp;sign=8278f108c83d822048ce0375bede5c15&amp;user=gnudip&amp;pass=305dff8b78e694a02eafb0c19e48292f&amp;domn=dyn.mpis.net&amp;reqc=0&amp;addr=192.168.0.4
  210. </pre></blockquote>
  211. <p>
  212. The response to the second request contains:
  213. <ol>
  214. <li>the return code
  215. <ul>
  216. <li>"0" - successful update
  217. <li>"1" - invalid login (or other problem)
  218. <li>"2" - successful offline
  219. </ul>
  220. <li>the IP address that the server registered, for request code "2"
  221. </ol>
  222. These values are again passed in <u>HTML meta tags</u>, as in this example:
  223. <blockquote><pre>
  224. &lt;meta name="retc" content="0"&gt;
  225. &lt;meta name="addr" content="24.81.172.128"&gt;
  226. </pre></blockquote>
  227. Each meta tag will be on its own line and left justified on the line.
  228. The white space gaps before "name=" and "content=" will each consist
  229. of a single space.
  230. The tags will be in the order shown. There will be no other HTML meta
  231. tags in the response.
  232. <p>
  233. This protocol allows the GnuDIP server to "time out" the prompt. If the
  234. response does not come within 60 seconds (for example), it would be
  235. denied. The signature is generated using a key known only to the
  236. server. This allows the server to know that the "salt" and "time
  237. generated" value are valid, without having to maintain state
  238. information on the server side.
  239. <p>
  240. There is a transcript of three actual protocol exchanges (done using the
  241. Perl GnuDIP client) in
  242. <a href="protocol_sample.txt">protocol_sample.txt</a>.
  243. <p><hr>
  244. </body>
  245. </html>