TL;DR: Week 7 of the #MagnetWeeklyCTF tests your knowledge of the presence of a single file on a Linux machine.
Review
Check out the week 1 blog post for how to get started on the Magnet Weekly CTF.
Get the first challenge
The weekly challenge for week 6 was split into three, short parts. The first was:
What is the IP address of the HDFS primary node?
If you had access to the system itself, this would be quickly answered with ifconfig
or the more modern ip addr
. Without access to the running system, the answer is just as simple if you know where that information is kept.
Open the target file(s)
On Debian-based distributions1, you can find the information you would normally expect from ip addr
in /etc/network/interfaces/
. The analysis here is going to be really straight forward, we’re going to cat
the file and read.
There are three potential interfaces listed, lo
, ens33
, and ens36
with ens33
having a commented out entry for a dynamic IP and a static entry that is active. The only entry that has an IP address is the static entry for ens33
, which happens to match the IP address we see in the Hadoop logs. Based on that, “192.168.2.100” is the right answer.
Get the Second Challenge
The second weekly challenge was:
Is the IP address on HDFS-Primary dynamically or statically assigned?
Based on the same file and the same entry we got the IP address from, the answer must be “static”.
Get the Third Challenge
The third weekly challenge was:
What is the interface name name for the primary HDFS node?
Based on the same file and the same entry we got the IP address from, the answer must be “ens33”.
Alternatives
I honestly couldn’t come up with an easier way to answer the question. But in the interests of having a tweet, I came up with a more complicated way of reading the file.
Conclusion
This week trended towards the “too easy” end, with one file answering all three parts of the question. There is still no need for tools other than the command line, and I can’t imagine any commercial tool could do this without taking a few hundred times as long to load and let you display the answer. On the off chance this becomes a competition, here are the stats to beat using the complicated method:
Footnotes
-
See Debian’s Wiki for more information. ↩