Answers
The commands are recieved encoded in the body of packets marked at IP protocol 11. The commands provide the following functions:
The second form sends the same set of queries as above to a single specified address.
#define ENC_CONST 0x17 typedef unsigned char byte; void enc(int n, byte *in, byte *out) { int i; out[0] = in[0] + ENC_CONST; for(i=0; i<=n; i++) out[i] = (in[i] + out[i-1] + ENC_CONST); }The decoder, then, needs to go through the reverse process. The decoder can work either going forward or backward through the buffer, but the is slightly more straight forward in the reverse direction.
#define ENC_CONST 0x17 typedef unsigned char byte; void dec(int n, byte *in, byte *out) { int i; for(i=n-1; i>0; i--) out[i] = in[i] - in[i-1] - ENC_CONST; out[i] = in[i] - ENC_CONST; }
The various attacks are harder to identify since random values are used for port numbers, ids and ttl values. However, there are a few things we can look for. As discussed above, the udp and icmp attacks make use of malformed IP headers. We can therefore look for packets with the fragment bit clear and the fragment offset not equal zero. Other forms of invalid header values can also be used. One other consistent pattern is that the connection to the shell server is always on port 23???. To generalization this, on could look for incoming tcp connections to high number port (> 16000). This could pick up active ftp connections and p2p programs.
There are number small feature that make it more diffult to analise. All parameters are passed byte by byte (i.e 4 bytes for an ip address). There are a number of awkward programming sequences, and the decode routine appears much longer than a straight forward one.
For the most part, these feature don't really increase the skill required to investigate the program, but just makes it more tedious.
Bonus Questions: The bonus questions are open ended questions. It is used when submissions are too close together to tell apart. The bonus question is then used to identify a winner when entries are tied for a position.