JACOB ROBINSONOpen.
← Blog ArchiveARTICLE 251 / 265

Blog Archive / JACOB ROBINSON

A Deep Dive on Cybersecurity

This is a direct continuation off our last article, A Deep Dive on Networking. More specifically, we’ll be moving into some networking concepts that deal with security.

The Session Layer

In the last article, we talked about the OSI layer — we covered virtually everything except layers 5 and 6. We also cut quite a large chunk off layer 7, which I hinted at with the very end of the article (spoiler: its the web proxy). So let’s order this to focus on these last 3 layers in order, and end on some more info about what a cyberattack really looks like.

So, we’ve already covered how two IPs connect with one another, and how they send information to each over over a channel. But we sort of skimmed over how they establish that channel in the first place. At the time, I simplified things by describing them purely in the speed and reliability we could get the data across, but not how to keep it secure. After all, we don’t want a third party coming in and seeing what we’re downloading!

So, before we actually send data like HTTP or SMTP over TCP/UDP (all terms we learned last article), we need to make sure that the coast is clear. This is what session security is all about.

There are two methods of session security: SSL and TLS. And by two methods of session security, I mean there is only one method of session security, and that’s TLS — but SSL was the standard for quite awhile, and older cybersecurity experts still have a habit of calling session security “SSL”, so we use both names.

The move from SSL to TLS was complicated — there was a lot going on behind the scenes, and many small updates made TLS superior, such as PFS and 0-RRT. But before I explain what those terms mean, I have to explain to you how session security works — and with it the number one reason SSL was abandoned in favor of TLS.

If one IP (for simplicity… IP1) wants to connect to another (IP2), it’ll start by asking IP2 for its public key. IP2 sends over the requested key, and IP1 encrypts it given the instructions to create a session key. IP1 sends back over the session key and, if all goes well, IP2 will be able to decrypt it using its private key.

Key-based encryption is something that can use its very own article, so for simplicity’s sake just assume that these keys allow each other to interpret the packets that the other IP is sending. Now, it’s worth noting that the session structure I just described to you is not TLS. It’s actually the old method, SSL.

You see, SSL used an asymmetric encryption known as RSA. It is asymmetric in how IP2 has to be doing the majority of the work in sending its public key over and then decrypting using its private. This system worked well enough, with two issues: the first was that it was slow. The second, perhaps more worrisome, is that if the private key had been snatched, every single piece of data ever sent or received by IP2 is up for grabs. Combine that with the fact that RSA’s security encryption is quantumly solvable (read: if given a quantum computer and enough time, you can find every person’s private key) and you start to realize that maybe we should be using something else.

Fortunately, two people — whose last names are presumably “Diffie” and “Hellman” — created a new encryption, Diffie-Hellman, which served as a symmetric encryption. This time we didn’t need private or public keys — the two servers simply engaged in the same (rather complicated and too low level for this post) mathematical encryption process in order to come out with the same session key. This came with a lot of small advantages, including the two I previewed to you — PFS,
or “Perfect Forward Secrecy”, which means that every session key is unique and therefore there is no master (private) key which would allow you to see all previous comms, and 0-RRT (Zero Round Trip Time) which meant you are now able to reuse old session keys since they each have their own built-in security.

The Presentation Layer

The presentation layer is arguably the most vague and opaque of the OSI layers. There’s not much to it that we haven’t already discussed previously, but it does give us the opportunity to present a security concept we have not yet touched:

One way to “present” a packet across a connection (or as we now know it, a session) is by wrapping it in some sort of security. There are two major forms of this — GRE and ESP. The GRE focuses on privacy, while ESP focuses on encryption — usually people combo these two together alongside a VPN for extra-good corporate security.

The focus of the GRE is just to obfuscate the header. As you now know, the header of a packet contains all sorts of IP-identifying information that sort of ruins the point of a VPN. The purpose of a GRE is to wrap the real header in a dummy header, therefore hiding its true intentions. Any authorized users of the packet (such as the VPN or the destination IP) will be able to read its true contents, but everyone else will have to dig deeper to find the actual header.

That being said… you can dig deeper, and its pretty trivial to do so if you just have GRE by itself. So that’s where ESP comes in — ESP encrypts the entire packet so that it isn’t accessible by any packet sniffers/interceptors. In that case, all anyone is getting is — at most — the fake dummy header that the GRE assigned. Funny enough, this ties all the way back to our conversation on IPv6, as one of the major features of v6 (outside of expanding the availability of public IP addresses) was built-in packet encryption and session security which IPv4 did not have.

The Application Layer (and the value of a Proxy)

Speaking of VPNs, I mentioned that people often confuse the abilities of a VPN with that of a web proxy, one of the major players of Layer 7.

Layer 7 is the final layer, and pretty much involves everything that happens right before a packet reaches its target. There is a lot going on at this layer, and I could probably dedicate an entire article to it. Instead, I’m going to focus on just the proxies, which is arguably the biggest “value” concept in the Layer 7 ecosystem.

A proxy, at a fundamental level, takes packet data such as HTTP and forwards it to different places based on different use-cases. For example, if you’re trying to connect to a popular site, the server’s proxy (known as a “reverse proxy”) might forward you to a different server hosting the same site in order to balance the load and make sure the website doesn’t go down due to too many people trying to access it. In our VPN example from last article, a client’s proxy (known as a “forward proxy”) might tell the server, “Actually, we’re in Canada”, thus giving the client access to the Canadian Netflix results rather than the Netflix results of their home country.

But of course, this is the cybersecurity section, as you might imagine proxies have a lot of security purposes too. A proxy might block access to something you shouldn’t be viewing, or if it thinks your connection is sketchy it might send you to a sandbox environment where you can’t actually effect the servers. Proxies can even do something called a “TLS Intercept”, where it intercepts TLS-encrypted traffic coming towards the web server just to make extra sure this session wasn’t organized by a nefarious client.

You know, this talk of “blocking access to nefarious connections” reminds me of something… we still haven’t even mentioned the most common and well-known cybersecurity tool of them all!

Oh, Yeah — Firewalls!

The cybersecurity tools you know well — firewalls and anti-viruses — mostly live outside the OSI paradigm. A firewall, for example, is based within the realm of routing. Remember when I said BGP was “policy-based”? Well, most policies are those defined by firewalls: based around the content and context of a packet, BGP will drop the packets that firewalls ask it to.

Historically, there are three different types of firewalls: Stateless, Stateful, and — most recently — Next-Gen. You can tell when product marketing took over the naming conventions.

In a stateless firewall, all we’re looking at is the packet header. Source IP, Destination IP, and all that other miscellaneous metadata attached. If it’s coming from a sketchy source, or there’s some other weird inconsistency or red flag in the header, we drop it. This type of firewall worked for a long time, until hackers got a bit more clever: they realized that if this was all the information firewalls were taking in, they could intercept an ongoing connection and sent out a packet which, on its surface, looks like it belongs with the rest — but in reality has a dangerous payload.

This is where stateful firewalls come into play. As you could imagine, the “state” in this case is the state, or flow, of the connection. For example, if we are expecting 20 packets of data from a Source IP, and we end up getting 21, then we know something fishy is going on and that we should look into things further. This takes a bit more time to calculate then the stateless firewalls, but are usually worth the improved security.

Now, there should be one glaring red flag for you as to how this is done. Why the hell are we looking at the headers? Couldn’t we just check out the data itself, see the obvious malware written in plaintext, and just drop the packet that way?

Well, there’s two reasons we didn’t do this. The first is related to the fact that snooping on everyone’s connection 24/7 is a huge privacy issue. But as we all know privacy is a secondary concern, and so the real reason stopping companies from doing this was speed: if you tried to inspect the data of every single packet, the connection would slow to an unusable crawl. We had to wait until technology sped up in order to do this.

Well eventually technology did, and the Next-Gen Firewall (or NGFW) was born. This is another thing where there’s a ton of smaller fixes and patches and additions (and also the fact that every company has a different definition of NGFW) but for our 101-level knowledge sake you can say the main deal about Next-Gen is that it inspects packet data.

Antivirus works more or less the same way, though its actually not connected to the network but rather the device itself. Old antiviruses had a list of known malware, that they would then cross-reference with every single one of your local files every time you did a scan. As predicted, this took forever. The answer to this was Next-Gen Antivirus (sigh) where the system was always operating, and would simply look for ongoing occurrences — files making changes in the background, trying to connect to the network, etc. etc. — and immediately root out and delete any bad actors.

What is a Security Threat, Anyway?

To wrap this up, I wanted to cover very briefly what we are protecting ourselves against in the first place. In general, there are five attack techniques, and three attack strategies. We’ll do the lightning round on this to speed things up:

Attack Techniques – The bad stuff which hackers use to do bad things.

  1. Phishing. One of the oldest and simplest tricks in the book, but also astonishingly effective to this day. You essentially pretend to be someone you’re not, so you can gain access to things you aren’t supposed to have access to. Common types of phishing include making a fake login screen to scrape passwords, or calling a tech support number to gain access to someone’s credentials. Spam also falls under this category (though it could also be used as a DDOS).
  2. Malware. This is a pretty generic term, and is just used to describe anything that is a computer program which does bad things. Viruses, worms, adware, etc. are all examples of malware. Surprisingly ransomware, despite technically being malware, does get its own slot on the techniques category.
  3. DDOS. With this one, you’re essentially sending a ton of fake packets to a server for the sole purpose of trying to crash its system. This doesn’t really work against bigger companies due to the amount of servers that they have and tools such as proxy load-balancing, but it can still be effective against smaller targets with less servers, or companies who have a focus on server compute instead of server quantity (such as videogames).
  4. Man-in-the-middle. Remember the example I gave where a third party could snoop on a connection, and send a dangerous payload that looks exactly like the other data? This is the essence of a MitM attack. Most network-based security is trying to stop this one from happening.
  5. Ransomware. The newest addition to the technique roster: its a type of malware that specifically encrypts all your data and asks you pay money to get it decrypted. Usually individuals like you or me don’t have to worry about this one, but its a huge risk for companies with a ton of cash that hackers know they can squeeze a lot out of. Hospitals tend to be prime targets since they need their systems back up ASAP and due to that are pressured to just pay the hacker rather than call in a security firm to decrypt it manually.

Attack Strategies – The means by which hackers get the bad stuff to you.

  1. Zero-day. The most common type of strategy, by a huge margin. A zero-day refers to anything that 1) is a bug or loophole in a popular service, and 2) the creator of the service doesn’t know about yet. This can be anything from an unprotected connection that a hacker can snoop on, all the way to a new way of writing a spam email that doesn’t trigger Gmail’s spam filter.
  2. APT. If you’ve ever played the games Plague Inc. or Pandemic, you know the best strategy is to maximize spread before you maximize lethality. Ideally you want to infect every person on Earth with zero symptoms to not trigger vaccine research, then all of a sudden dump every point into lethal and watch the population go from 8 billion to zero in less than a year. Well, believe it or not, hacking works the same way! Why ransomware one random computer in a hospital, if you can ransomware the entire hospital? Why ransomware one hospital, when you can ransomware a network of hospitals? The longer you stay undetected, the longer you stay patient, the more damage you can do before getting kicked out.
  3. State-sponsored. Oh, now this is a fun one! Sure you could spend years looking for a perfect security bug or quietly nesting in some rich corporate network, or you could just contact your government’s intelligence agency and find targets that way. They give you the resources, the access points, the immunity from jailtime, and you get paid. With that in mind it should come at no surprise as to why so many hacker groups are tied to a specific country’s government.

Anyway, thanks for reading this two-parter! I learned a lot just writing about these topics, and I hope you learned something from reading it. Your normally scheduled programming returns next week!

[Image omitted]

Select text in the article to highlight it.

Your saved highlights

    Article contents

    Blog Archive · 265 articles

    1. 01 Five Takeaways from #100DaysofCode
    2. 02 Getting Past the Bump
    3. 03 How Important are Principles?
    4. 04 How to Avoid Writer’s Fatigue
    5. 05 The Dangers of Catastrophizing
    6. 06 State of the Union 2019
    7. 07 The Rise of the Personal Brand
    8. 08 Finding Adventure in 2019
    9. 09 5 Ways to Use Automation to Vastly Increase Your Efficiency
    10. 10 What you Should be Doing Instead of Networking
    11. 11 Creatives vs. Technicals: Which Should You Focus On?
    12. 12 The Difference between Quitting and Giving Up
    13. 13 3 Ways To Get Value Out Of Nature
    14. 14 What is the Purpose of Dreams?
    15. 15 How to develop intellectual success in future generations
    16. 16 What the Definition of Luck Really Is
    17. 17 Who Makes the Culture?
    18. 18 Sexual Frustration and Trying to Find Love in the Age of the Internet
    19. 19 The Lazy Man’s Guide to More Efficient Research
    20. 20 How One Joke Can Ruin Your Life
    21. 21 Why IQ is BS
    22. 22 Why it’s Impossible for the Illuminati to Exist
    23. 23 Some of my Favorite Blogs
    24. 24 The Most Important Indicator on Why a Company Succeeds
    25. 25 Returning to Tesla
    26. 26 Living in a Post-Truth World
    27. 27 The Function of Success
    28. 28 Lessons at 20
    29. 29 If the Recession Happened This Year…
    30. 30 Why People Don’t Read
    31. 31 Social Media and Truth
    32. 32 Making Things 1% Better
    33. 33 What the Book of Job Really Means
    34. 34 Life as a Game
    35. 35 The Function of Opportunity
    36. 36 Exponential Growth
    37. 37 The Machine Learning Revolution
    38. 38 Practical Thoughts on Blockchain
    39. 39 Why the Humanities Are Just as Important as STEM
    40. 40 Dow 30,000
    41. 41 The Shame Economy
    42. 42 You Can’t Do It All Alone
    43. 43 Favorites of 2019
    44. 44 State of the Union 2020
    45. 45 The Tolerance Paradox
    46. 46 Null
    47. 47 Social Game Theory
    48. 48 3 Tips for Developing a Positive Mindset
    49. 49 Why Social Gaming is So Popular
    50. 50 A Design Study on YourStack
    51. 51 Relationships, Careers, and Investments
    52. 52 The Fall of GAFA
    53. 53 Wartime CEO
    54. 54 Mass Shooting Cycles
    55. 55 But Who’s Right?
    56. 56 What Matters in the End
    57. 57 Is AR/VR too “weird”?
    58. 58 Convenience + Efficiency
    59. 59 Vicious Cycles
    60. 60 With Smart People
    61. 61 The Third Moat
    62. 62 The Secret to Success
    63. 63 The End of Education
    64. 64 The Ben Carson Effect
    65. 65 Biological Evolution, Cultural Evolution
    66. 66 Suicide and the Self
    67. 67 The Life Cycle of a Business
    68. 68 How to Get into Harvard
    69. 69 Managing Your Personal KPIs
    70. 70 Fog of War
    71. 71 Make-or-Break vs. Nice-to-Have
    72. 72 Identity and Political Groups
    73. 73 Nationalism’s Pros and Cons
    74. 74 How to Win an Election
    75. 75 Why You Shouldn’t Network
    76. 76 On Relative Morality
    77. 77 Death in the Age of the Internet
    78. 78 Audience of One
    79. 79 The Rise of Anxiety
    80. 80 Stop Getting Scared By AI
    81. 81 If You Build It, They Will Come
    82. 82 Building Knowledge Advantage
    83. 83 The Quest to be Kinder
    84. 84 Everything You Do Sucks
    85. 85 Niche Monopolies
    86. 86 Up Shit Creek
    87. 87 Emotional Equivalent Salary
    88. 88 Uncertainty Principle
    89. 89 Building a Startup with Anxiety
    90. 90 Punishment and Forgiveness
    91. 91 Favorites of 2020
    92. 92 State of the Union 2021
    93. 93 Random Factor Social Suicide
    94. 94 Old World Business, New World Business
    95. 95 The Customer Takes Care of Itself
    96. 96 How to Use Reddit as a Business
    97. 97 Genetic Obsolescence
    98. 98 A Social Capital Theory of Management
    99. 99 If I Could Do My Education Over Again
    100. 100 Aggregation and Decoupling
    101. 101 The Crazies, Part II
    102. 102 Art as Inspiration, Art as Education
    103. 103 Free to Play Models for SaaS Services
    104. 104 A Recap on my 2020 Politics Posts
    105. 105 Making Mistakes, Post-Internet
    106. 106 Taste is Not Tech
    107. 107 Immortality
    108. 108 Biases Against Consistency
    109. 109 The Mythical Self
    110. 110 Faulty Mental Models
    111. 111 Honor and Glory
    112. 112 Momentum, and the Value of Cold Showers
    113. 113 The Prestige Myth: Providing Structure to Structureless Forms
    114. 114 The Unluckiest Man Alive
    115. 115 Those Who Make, And Those Who Work
    116. 116 Post-Truth, Revisited
    117. 117 Conscience Questions, Unchristianized Edition
    118. 118 On Being You
    119. 119 Effective versus Efficient
    120. 120 The Experimental Method of Learning
    121. 121 A New Model for Teaching Humanities
    122. 122 A Dialogue on Mindset
    123. 123 I Am Not Your Friend
    124. 124 My 5 Tips Towards Reading Books
    125. 125 Buying Immortality
    126. 126 Do this, but…
    127. 127 Leverage and Wealth: A Simplification
    128. 128 Mind’s Eye and Creative Application
    129. 129 Intersection of Technology and Art
    130. 130 Blog Writing for Robots
    131. 131 10 Tips on Writing
    132. 132 The Cost of Staying Alive in America
    133. 133 Taste on the Margin
    134. 134 Top 10 Tools I Use in 2021
    135. 135 Income Generators 101
    136. 136 Strategies for David, Versus Goliath
    137. 137 Progress in the Long Term
    138. 138 The End of Journalism
    139. 139 Myths of People
    140. 140 Heroism
    141. 141 External Mentors
    142. 142 Favorites of 2021
    143. 143 State of the Union 2022
    144. 144 The End of Gender
    145. 145 The Work After Work
    146. 146 There Is No Metaverse
    147. 147 On Dealing With Chaos
    148. 148 Risk/Return Bets in Entrepreneurship
    149. 149 The Weird, Magical World of Modern Day Quora
    150. 150 On Business
    151. 151 What’s “Hivemind”?
    152. 152 Life as a War
    153. 153 On Culture
    154. 154 My Approach to Investing
    155. 155 Stop Caring About Your Reputation
    156. 156 On Humility
    157. 157 Is Relative Morality Helpful?
    158. 158 Achievement-Based Thinking
    159. 159 On Success
    160. 160 Moral Implications in Maximums and Minimums
    161. 161 Sentience and Suffering
    162. 162 On Improving
    163. 163 The Suicide Disease
    164. 164 Social Diversification
    165. 165 On Meaning
    166. 166 Convenience and Pareto Optimality
    167. 167 Mental Illness is Not a Permanent State
    168. 168 Biased Science
    169. 169 People as Means
    170. 170 Being Wise and Being Smart
    171. 171 The New Working Class
    172. 172 Fitness, Suffering, Self
    173. 173 Political Theory and Evolution
    174. 174 Explaining my Rating System
    175. 175 Why You Might Want A Trading Account Over An IRA
    176. 176 Why NFTs Don’t Work For Games
    177. 177 A Few Thoughts on MMOs
    178. 178 A Review of MyMind
    179. 179 Read, Think, Make, Share, Monetize
    180. 180 Is Science Perfect?
    181. 181 A Guide to Fiction Writing
    182. 182 The Productivity Tool World Tour 2022
    183. 183 My Daily Routine
    184. 184 The Curse of The Conqueror
    185. 185 Some Brief Notes on Programming
    186. 186 My Life Principles
    187. 187 Cyberpunk in 2022
    188. 188 What Decides Good Art?
    189. 189 Trends in Mass Murder Techniques
    190. 190 Changing to Fit the Times
    191. 191 Why Did Photographers Embrace NFTs, but Artists Didn’t?
    192. 192 Favorites of 2022
    193. 193 State of the Union 2023
    194. 194 New Blog Post Schedule
    195. 195 Was Lex Fridman’s “Reading List” Controversy Caused by Mass Psychosis?
    196. 196 Is Notion “Too Good”?
    197. 197 Mastodon is Social Media PvP with Permadeath Enabled
    198. 198 Arc, Vivaldi, and the Next Generation of Browsers
    199. 199 Is the Four-Hour Workweek Actually Possible?
    200. 200 Do Not Obsess Over Your Customer. Obsess Over Your Community.
    201. 201 Why Big Entertainment Failed to Bring in Diversity
    202. 202 My All-Time Favorite Tools
    203. 203 Museums on the Computer
    204. 204 How to use AI to get you motivated to work
    205. 205 The Best Way to Focus: Do Nothing
    206. 206 Can Buddhism and Ego Intertwine?
    207. 207 How I Write My Blog Posts Now
    208. 208 Practice and Mysticism
    209. 209 Automate the Boring Stuff with ChatGPT
    210. 210 State of the Union 2024
    211. 211 The Secret to Great Products You Aren’t Doing
    212. 212 How to build a $5 billion dollar business in 5 minutes
    213. 213 How To Easily Automate Investments, Beat Big Tech, and more!
    214. 214 Can I Use AI To Solve The World’s Unsolvable Problems?
    215. 215 How A “Taste Matrix” Can Improve Your Art And Kill Writer’s Block
    216. 216 My Bizarre, Counterintuitive, and Lifechanging Approach to Work
    217. 217 Top 3 Recommended Browsers (They Aren’t What You Think)
    218. 218 How Hard Is It To Make Money On Steam?
    219. 219 What To Do If You’re Socially Anxious
    220. 220 My New New Way of Reading Books (I Abandoned AI)
    221. 221 References Are The Best Way To Learn Anything
    222. 222 How To Quit Planning Goals And Start Achieving Them
    223. 223 The Only Good Self-Help Book
    224. 224 Be Nice To Everyone. It Just Might Save Your Life.
    225. 225 I Learned An Ancient 3-Step Process And Became A Master Meditator
    226. 226 How Canva Became The Home of Everything
    227. 227 Has The Internet Made More People Mentally Ill?
    228. 228 The Biology Behind Why We Like Stories
    229. 229 This Tape Haunted An Entire Nation. But Was It Even Real?
    230. 230 We Are All Most Certainly Going To Make It
    231. 231 What Makes Good Taste?
    232. 232 In a World of Cancel Culture, Reputation Doesn’t Matter Anymore
    233. 233 Why You Hate Diversity In Media
    234. 234 I Used Readwise for 200 days. Here’s what happened.
    235. 235 Lessons on Bootstrapping Solo with Little Income
    236. 236 This Ancient Story Was Drowned In Lies. The Truth is Much More Interesting.
    237. 237 How To Get Actionable, Memorable Advice Out Of Anything You Read
    238. 238 You Are A Coward. And That’s Not So Bad, Really.
    239. 239 Time Travel is Real. Here’s How to Use It.
    240. 240 How I Got Into Old Games
    241. 241 Is Every Story Political?
    242. 242 Your Culture Decides Your Fate
    243. 243 In Defense of the Jumpscare
    244. 244 Final Fantasy XIV’s Story Is A Mess
    245. 245 Markov Chains and You!
    246. 246 I used Obsidian for 90 days. Here’s what happened.
    247. 247 Ideas That Can Kill You
    248. 248 Porting A 250k+ Item Database from Notion to Obsidian
    249. 249 Why the Fast Inverse Square Root Matters
    250. 250 A Deep Dive on Networking
    251. 251 A Deep Dive on Cybersecurity
    252. 252 Converting a $100k+ Trading Algorithm from Excel to Python
    253. 253 How To Make A (Super) Hard Drive From Scratch
    254. 254 So, How Do Computer Graphics Work?
    255. 255 The Quantum Physics Rabbit Hole, Part I
    256. 256 The Quantum Physics Rabbit Hole, Part II
    257. 257 The Story (and Meaning) of Humanity’s Greatest Achievement
    258. 258 Explaining Tonal Indicators
    259. 259 AI should have you thinking MORE, not less
    260. 260 Forbidden Knowledge: The Vela Incident
    261. 261 All success in life comes back to pain tolerance
    262. 262 The AI Revolution rewards the curious
    263. 263 Forbidden Knowledge: Marco Evaristti
    264. 264 Forbidden Knowledge: Casket Failure
    265. 265 Forbidden Knowledge: Coriander Theory

    Share

    Make it your own before sharing.

    Page link

    Send to

    EmailWhatsAppBlueskyFacebookX

    Facebook shares the link only; add your message there.