Saturday, November 12, 2022

 Subnetting

I suspect that many networking students find this week's subject difficult. I certainly have. Subnetting isn't too difficult conceptually, but internalizing all the steps in a week is an incredible undertaking. If someone told me, "I can learn segmentation, including IPv6, VLSM, and various VLAN configurations in a single week, while taking other classes", I would think they were arrogant. And that's exactly the position I find myself in.

I tried a different strategy for studying this week: I started with the lab and then read the textbook. I find that this makes the dry, dense material of the textbook easier to make meaningful.

Before moving on with this weeks assignment, I just want to take a moment to talk about octets. In decimal, an IP address might look like the following: 

192.168.89.126

These four numbers separated by periods are called octets. Why octets? Because they are each made up of one byte, or 8 bits. So an octet of 255 in decimal translates to 11111111. This is also the highest number for an octet because all eight bits are in the on position. And 128 translates to 10000000 and is another useful one to memorize... All of this is important to conceptualize so talk of borrowing bits is easier to wrap one's head around.

 

I have been tasked with watching all the videos on this page: https://subnetipv4.com/#learn

After which, I am to do ten practice questions from the same page.

Using what I have learned, I draw up a cheat sheet using the following procedure:

Step one: Starting at the bottom/left corner of your sheet, write /1 /2 /3 /4 /5 /6 /7 /8 evenly spaced across the bottom.

Step two: Add another row above the previous one starting where the last row left off. Each number should be 8 more than the number in the column below it.

Step three: Follow step two 2 more times.

We now have our complete CIDR notation with the bottom row applying to the first octet and the fourth row applying to the fourth octet of any IP address.

Step four: Skip one row and from right to left, start with 1 and proceed to double for each column created by steps one - three. It will end on 128. This gives us our group size.

Step five: In the row we skipped from the previous step, now subtract the number above for each column from 256. The rightmost column will be 255 which I covered above (8 bits, all turned on), and the leftmost column will match the number (128) in the column above it. This gives us our subnet.

Steps four and five work like a reverse process of identifying the interesting octet (an octet that is not 255 or 0), and finding the magic number (group size) by subtracting it from 256. However, for the purposes of writing up a cheat sheet, it is easier to follow steps four and five as described above.

For most subnetting problems, the first step is to locate the CIDR notation in the cheat sheet corresponding to the IP address in question. This will tell us what column we are working in. The row the CIDR number is in will tell us what octet we are working on.

Then we increment by the number in the top row (group size) until we pass the number in the corresponding octet of the given IP address by one increment.

We now have all the information we need to answer subnetting questions.

The subnet can be found by locating the correct octet and filling it out using the second row. Any octets to the left will be 255 and any to the right will be 0.

The last two numbers in our incremental list will give us our Network ID (the lower of the two numbers) and the Next Network (the higher of the two numbers)

 

This started easy enough. 4th octet:

 

 

 

 

Another 4th octet problem:

 

 

 

 

Then a 3rd octet problem:

At this point, I had to review and relearn. Getting the network and first host was trivial enough, but I had not understood, when watching the videos, the next three rows. A quick review cleared it up.

 

 

 

 

Another 3rd octet problem and again, I had to check my notes, but I worked it out:





A Second octet problem





First Host caught me off guard on this one, but I quickly figured out which column I was supposed to be working in. Then a typo in Next Subnet left me scratching my head for a long time.





The next three were easy:


 

 

 

 


 

 

 

 


 

 

 

 

I kept rolling until I got a first octet problem. It felt like I was playing an old-school CRPG, rolling for good stats.





And that's it. I have rarely felt so insecure about something I've spent a week studying, but if there's one thing I learned from my acting class it's this, "Go before you're ready." Because for someone like me, I can't be allowed to wait until I feel comfortable. Ain't no one gonna wait that long for me.


Sunday, November 6, 2022

 This week I am tasked with completing the following room at TryHackMe:

Active Reconnaissance

This is the second room in their Network Security Module, so I decided to do the first one in the module first.

Passive Reconnaissance

I had to do quite a bit of work to figure out how to connect via OpenVPN. There are a large number of tutorials on YouTube, telling you how to connect and confirm your connection, but they all neglect to mention how you actually use it after connecting. In the time it took to do the research, my attackbox expired. I will try again.

I completed the Active room before returning to this one. And again this website frustrates me. Despite following numerous steps to set up the network. The terminal on the AttackBox can't ping google, and I can't run # whois tryhackme.com; I receive the following error:

connect: Network is unreachable

If I was more misanthropic, I would assume they are trying to frustrate me into paying for a subscription. I'm not wasting any more time on this today.

Active Reconnaissance

After a brief introduction and a list of tools used this room begins with a description of ports used by web browsers. A brief explanation of how to inspect elements of a website using Developers Tools was followed by a list of browser extensions to help with pen testing. A question about an element of another website was easy to suss out using the Developers Toolkit and some poking around.

Then we went over the ping command. The questions required me to break out the man page. Until now I've only ever used ping to test if my system can connect to the world wide web on a new, minimal Linux installation.

Next we are introduced to tracerout and a much-needed refresher on TTL. Using my connection between the AttackBox and a target machine I ran traceroute on the target machine to find how many licks it takes to get to the tootsie-roll-center of a tootsie-pop.

Next I probed the target machine's port 80 with telnet. The instructions for this section are clear enough to execute, but there is a lot of information in just a few sentences (almost as dense as my networking textbook). When I'm not neck deep in schoolwork, I'm going to come back and work through this whole module.

Then I used netcat to probe port 21 on the target machine. EverythingISaidAboutTheLastSection = 1

EverythingISaidAboutTheLastSection * 2 

The room wrapped up with a summary and some links to tools and resources.