GnuDIP Client-Server Update Protocol |
There are in fact two update protocols. The original protocol involves a direct TCP connection by the client to the server. There is also an adaptation of the original protocol to HTTP (web server protocol). The HTTP protocol is more convenient for authors of generic Windows dynamic DNS update clients, such as DynSite.
With either of these protocols it is not possible for wire tappers to determine the clear text password, nor is it possible for them to "spoof" the update server using captured and modified update messages.
ASCII is (of course) used for representing printable characters.
The client makes a TCP connection to the appropriate port on the server host. This port is normally 3495, but a GnuDIP site could choose another port.
As soon as the connection is established the server will send a randomly generated 10 character "salt" string. This is used in the following algorithm for hashing the password:
The update message character string is then transmited to the GnuDIP server. This must be in one of these forms:
user_name:hashed_password:domain:0
This requests that any IP address currently registered for FQDN
user_name.domain
be removed ("offline" request). The FQDN user_name.domain
will no longer correspond to any IP address.
In response to this message, the server will return one of:
1
This indicates an invalid login.
2
This indicates a successful offline.
user_name:hashed_password:domain:1:address
This requests that the IP address provided be registered as the (only) address
for FQDN user_name.domain
.
In the most common case, the client would pass the address it detects at its end of the connection. For compatibility with earlier releases of GnuDIP, the IP adddress may be omitted. If the IP address is not provided, the server writes a notice to the log, and the IP address the server detects at the other end of the connection is registered instead. Note that these two addresses will be the same unless the client is behind some sort of proxy.
In response to this message, the server will return one of:
1
This indicates an invalid login.
0
This indicates a successful update.
user_name:hashed_password:domain:2
This requests that the server determine the IP address it sees at the client end
of the connection, and register that as the (only) address for FQDN
user_name.domain
. This IP address will also be returned
to the client.
In response to this message, the server will return one of:
1
This indicates an invalid login.
0:address
This indicates a successful update and provides the address that was registered.
The HTTP version of the protocol requires the client issue an HTTP GET request, parse the response, use MD5 to obscure the password, issue a second HTTP GET request and parse that response. We first give a conceptual overview, then a concrete example.
If a GnuDIP site operator follows the default installation procedure,
the path part of the URL (the part after the host name) for the HTTP
update server CGI script will be
/gnudip/cgi-bin/gdipupdt.cgi
.
In the first HTTP GET request, no query string (the part of an URL after the "?") is provided. It is interpreted as a "request for a salt". The response contains three pieces of data:
Each meta tag will be on its own line and left justified on the line. The white space gaps before "name=" and "content=" will each consist of a single space. The tags will be in the order shown. There will be no other HTML meta tags in the response.<meta name="salt" content="XLCDgXvzSo"> <meta name="time" content="1002164730"> <meta name="sign" content="8278f108c83d822048ce0375bede5c15">
The salt is used in the following algorithm for hashing the password:
Now the second HTTP GET request is issued. In this request the query string (the part of an URL after the "?") contains the following parameters:
This is an example of a query string:
salt=XLCDgXvzSo&time=1002164730&sign=8278f108c83d822048ce0375bede5c15&user=macdonnell&pass=305dff8b78e694a02eafb0c19e48292f&domn=dyn.mpis.net&reqc=0&addr=192.168.0.4
The response to the second request contains:
Each meta tag will be on its own line and left justified on the line. The white space gaps before "name=" and "content=" will each consist of a single space. The tags will be in the order shown. There will be no other HTML meta tags in the response.<meta name="retc" content="0"> <meta name="addr" content="24.81.172.128">
This protocol allows the GnuDIP server to "time out" the prompt. If the response does not come within 60 seconds (for example), it would be denied. The signature is generated using a key known only to the server. This allows the server to know that the "salt" and "time generated" value are valid, without having to maintain state information on the server side.
There is a transcript of three actual protocol exchanges (done using the Perl GnuDIP client) in protocol_sample.txt.