I’ve always thought it was pointless for game companies to hide their server addresses. Surely there are better ways to protect their servers…? I can understand the need to secure certain parts of your operation, for example, how it all works. However, IP addresses are easy to find for anyone with patience and it is sometimes necessary for customers to have them to troubleshoot connectivity or latency issues.
The other day I wanted to see how my password for my World of Warcraft account is sent over the wire. It turned out to be hashed, which is good. While investigating the traffic, I noticed that the client receives a full list of the servers with names, addresses, and other information. An example:
It is easy to see the server names, addresses, and the common port (3724)...but what is all the other information? When you view the entire stream, patterns definitely stand out. The 5th byte following the port of the server is commonly a (ASCII-translated) C, D, ?, or @. This byte appears to indicate the population level of the server. Servers with a value of “C” are “Full”, “D” is “High”, “?” is “Low” and “@” is “Medium”. If the 4th byte is “H” and the 5th is “C”, the server is “New”. Some of the dots seen in the screenshot are null, but others have values and I’m not sure what they mean. I would imagine: location, type (PvP, RP, Normal), Up or Down, etc.
I decided to go ahead and extract all of the server names and IP addresses from the stream. I saved the stream shown in the picture above to a file. I extracted the addresses manually the first time while I looked at the different patterns, but it took a while, and I wanted to be able to do it again quickly.
#!/usr/bin/perl
my @list = split(/:3724/, <STDIN>);
foreach (@list) {
if (/([A-Z]{1}[a-zA-Z0-9\'\-\s]+)\.(\d+\.\d+\.\d+\.\d+).*/) {
printf("%-25s %s %s", $1, $2, "\n");
}
}
$ cat serverlist.asc | tr -d '\n' | perl extract.pl
And you end up with a list: World of Warcraft Servers. The script could easily be modified to generate a CMD file for the PacketShaper to create a host list containing all of those addresses.
I created a script to create the list, rules, and apply policies: wowrules.cmd