Latest / CyberCode Academy / Course 27 - Hacking Web Applications, Penetration Testing, CTF | Episode 16: Web Technology Foundations: Protocols, Structure, and Scripting
Transcript
- 0:00Speaker 1: I want you to try something for me right now.
- 0:03Speaker 1: Just forget the screen in front of you for a second.
- 0:04Speaker 2: Yeah, that's a really good way to frame it. Just
- 0:06Speaker 2: drop the visuals entirely.
- 0:07Speaker 1: Right, Forget the logos, the videos, the sleek design of
- 0:11Speaker 1: whatever app you might be using right now to listen
- 0:13Speaker 1: to this mentally, just strip it all away, because.
- 0:16Speaker 2: The Internet isn't actually what we see.
- 0:18Speaker 1: No, it's not pictures. It's a conversation. It's this NonStop,
- 0:22Speaker 1: high speed exchange of letters happening in a language that
- 0:26Speaker 1: you know, billions of us use every single day, but
- 0:30Speaker 1: almost none of us actually speak it.
- 0:31Speaker 2: When you drop the interface, the GUI, that is exactly
- 0:34Speaker 2: what remains plaintext. Like you click a link, you aren't
- 0:38Speaker 2: actually going anywhere in a physical sense. You are sending
- 0:41Speaker 2: a letter. The server reads it, rips it open, and
- 0:44Speaker 2: then writes a letter back to you.
- 0:45Speaker 1: And that is exactly our mission for this deep dive.
- 0:48Speaker 1: We're looking at the invisible conversation that powers the World
- 0:51Speaker 1: Wide Web. We're going to break down the fundamental building blocks,
- 0:55Speaker 1: so HTTP, HTML and the code that just ties it
- 0:58Speaker 1: all together.
- 1:00Speaker 2: To be really clear right up front about this, this
- 1:02Speaker 2: isn't just for developers or engineers. Oh absolutely not. If
- 1:05Speaker 2: you want to understand your privacy, or if you want
- 1:07Speaker 2: to understand how your data leaks, or frankly, how a
- 1:10Speaker 2: hacker looks at your banking session, you have to understand
- 1:13Speaker 2: the grammar of this conversation. We are basically popping the
- 1:16Speaker 2: hood and looking at the engine today.
- 1:18Speaker 1: Yeah, so let's start with the rules of the road.
- 1:21Speaker 1: The protocol itself. HTTP. I mean, we see those four
- 1:25Speaker 1: letters before every web address, usually followed by a colon
- 1:28Speaker 1: and the slashes. But what are we actually agreeing to
- 1:31Speaker 1: when we type that? So?
- 1:32Speaker 2: HTTP stands for Hypertext Transfer Protocol, and it is the
- 1:37Speaker 2: rule book for how clients and by client I mean you,
- 1:40Speaker 2: your browser, your phone, how you talk to servers. Okay,
- 1:43Speaker 2: And the single most defining characteristic of HTTP, the thing
- 1:47Speaker 2: that shapes literally everything else we're going to talk about,
- 1:50Speaker 2: is that it is a stateless protocol.
- 1:52Speaker 1: Stateless. Now, in a political context that means you don't
- 1:55Speaker 1: have a country. But in tech, what are we actually
- 1:58Speaker 1: talking about.
- 1:58Speaker 2: It means the server has zero memory. It is purely transactional.
- 2:02Speaker 2: You send a request, the server sends a response, and
- 2:04Speaker 2: then amnesia, a neat complete amnesia. The server forgets you
- 2:08Speaker 2: ever existed. The connection is just closed.
- 2:11Speaker 1: That seems really counterintuitive, because I mean, when I'm on
- 2:14Speaker 1: a site, it feels like a continuous connection. I'm scrolling
- 2:17Speaker 1: and clicking around, I'm logged in. It feels like a
- 2:19Speaker 1: phone call where the line stays open, not a series
- 2:22Speaker 1: of isolated letters. Right.
- 2:23Speaker 2: It feels that way because we've built some very clever
- 2:26Speaker 2: hacks on top of it, which we'll get to it
- 2:28Speaker 2: a bit, specifically cookies, but at its core, no, it's
- 2:32Speaker 2: a series of one night stands. The connection opens, data swaps,
- 2:36Speaker 2: connection closes. Done. Wow, And understanding that limitation is totally
- 2:41Speaker 2: key to understanding web security.
- 2:43Speaker 1: Now, this protocol hasn't just stayed static over the years.
- 2:45Speaker 1: We started with HDP one point zero back in what in.
- 2:48Speaker 2: Nineteen ninety six, Yeah, nineteen ninety six.
- 2:50Speaker 1: And then one point one came out in ninety seven, right.
- 2:52Speaker 2: And HTTPA one point one was the workhorse. I mean,
- 2:55Speaker 2: it ran the web for over a decade. It used TCP,
- 2:58Speaker 2: which is transmission control per no.
- 3:00Speaker 1: One is reliable, right, yeah, but maybe a bit heavy exactly.
- 3:03Speaker 2: It requires a massive amount of back and forth handshakes
- 3:06Speaker 2: to ensure every single packet arrives in perfect order.
- 3:09Speaker 1: It's like requiring a signature for every single page of
- 3:12Speaker 1: a letter before you're allowed to send the next page.
- 3:15Speaker 2: Essentially, yes, it's safe but slow. Then HTTP two came
- 3:19Speaker 2: along in twenty fifteen to speed things up by multiplexing,
- 3:23Speaker 2: so sending multiple things at once. But the really interesting
- 3:26Speaker 2: shift is actually happening right now with HGTP three.
- 3:28Speaker 1: Yeah, this part is fascinating. HGP three is ditching TCP entirely.
- 3:32Speaker 2: It is. It's moving to a protocol based on UDP instead.
- 3:36Speaker 1: Okay, for those of us who aren't network engineers, why
- 3:38Speaker 1: does that matter? Why switch the entire foundation of the web?
- 3:41Speaker 2: Because TCP is obsessive. If one packet of data gets lost,
- 3:45Speaker 2: say just a tiny piece of an image, everything stops
- 3:49Speaker 2: and waits for it to be resented.
- 3:50Speaker 1: Everything just halts.
- 3:51Speaker 2: Yeah, it's called head ofline blocking. It's exactly like being
- 3:55Speaker 2: stuck behind a slow truck on a one lane road.
- 3:57Speaker 2: Nobody gets passed.
- 3:58Speaker 1: So what does UDP do differently?
- 4:00Speaker 2: VP is much more fire and forget. It allows data
- 4:02Speaker 2: to flow in parallel streams. It's way faster. It handles
- 4:06Speaker 2: messy networks like spotty five G connections, so much better,
- 4:10Speaker 2: and it's encrypted by default. It's a massive architectural shift
- 4:13Speaker 2: to make the modern web feel instantaneous.
- 4:16Speaker 1: But regardless of whether it's the old TCP or the
- 4:18Speaker 1: new UDP, underneath the conversation structure itself remains the same
- 4:22Speaker 1: right requests and response exactly. So let's roll play this
- 4:27Speaker 1: for a second. I'm the client. I'm knocking on the
- 4:29Speaker 1: server's door. What am I actually handing over to it?
- 4:32Speaker 2: You're handing over a request block, and it has three
- 4:36Speaker 2: main parts. First, the method, that's the verb, what do
- 4:39Speaker 2: you actually want to do?
- 4:40Speaker 1: Okay?
- 4:40Speaker 2: Second is the identifier what specific file or page are
- 4:43Speaker 2: you asking for? And third is the protocol version. But
- 4:46Speaker 2: right after that comes the metadata, the.
- 4:49Speaker 1: Headers, the headers, and one of those headers is the
- 4:51Speaker 1: user agent. I feel like this is one of those
- 4:53Speaker 1: terms people have heard of but don't quite grasp.
- 4:55Speaker 2: It's actually very simple. The user agent is just your
- 4:58Speaker 2: browser introducing itself. Literally, it really says, hi, I'm Chrome
- 5:01Speaker 2: running on Windows eleven, or hi, I'm Safari on an iPhone,
- 5:05Speaker 2: which seems helpful.
- 5:06Speaker 1: The server knows I'm on a phone, so it sends
- 5:08Speaker 1: me the mobile layout instead of the giant desktop one.
- 5:10Speaker 2: It is helpful, but it's also the very first place
- 5:13Speaker 2: where reality can be bent. Because the user agent is
- 5:16Speaker 2: just a string of text, you can change it to
- 5:18Speaker 2: whatever you want.
- 5:19Speaker 1: And this is what's called user agent spoofing.
- 5:21Speaker 2: Right if you're a web developer, maybe you want to
- 5:23Speaker 2: see how your site looks on an iPad, but you
- 5:25Speaker 2: don't have an iPad handy. You just tell your browser
- 5:28Speaker 2: lie to the server, say I'm an iPad. The server
- 5:31Speaker 2: believes you completely and sends the mobile code.
- 5:33Speaker 1: Okay, harmless enough for testing, But I assume there's a
- 5:38Speaker 1: much darker side to lying about who you are to
- 5:40Speaker 1: a server.
- 5:41Speaker 2: There always is insecurity. Think about spambots or malicious web crawlers.
- 5:46Speaker 2: If they knock on the door and say hi, I'm
- 5:48Speaker 2: a malicious bot written in a Python script, the server
- 5:51Speaker 2: will immediately slam the door shut, obviously, so they spoof it.
- 5:55Speaker 2: They say, Hi, I'm just a regular iPhone user just
- 5:57Speaker 2: browsing around. It's digital camouflage.
- 6:00Speaker 1: So I've set my request, I've introduced myself truthfully or not,
- 6:04Speaker 1: and now the server replies the response.
- 6:06Speaker 2: This is where we get the actual content, the HTML,
- 6:09Speaker 2: the images, but right before that we get the response headers.
- 6:12Speaker 1: Now, thinking about this like an envelope. How would you
- 6:15Speaker 1: describe these headers?
- 6:16Speaker 2: That's the perfect analogy. Actually, if the HTML content is
- 6:20Speaker 2: the letter inside, the headers are the instructions written on
- 6:24Speaker 2: the outside of the envelope. They tell the browser exactly
- 6:27Speaker 2: how to handle the letter. And this is where a
- 6:30Speaker 2: huge amount of web security actually happens.
- 6:32Speaker 1: It's not in the code of the page itself.
- 6:34Speaker 2: No, it's in the instructions on the envelope.
- 6:36Speaker 1: Let's look at a few of these, because some of
- 6:38Speaker 1: them sound incredibly critical. The first one that jumped out
- 6:41Speaker 1: is CSP. Content Security policy.
- 6:44Speaker 2: CSP is your absolute first line of defense against cross
- 6:48Speaker 2: site scripting or XSS.
- 6:50Speaker 1: Let's define EXSS quickly, just to make sure everyone is
- 6:53Speaker 1: on the exact same page.
- 6:54Speaker 2: Sure. XSS is when an attacker tricks a legitimate website
- 6:58Speaker 2: into running malicious code on your browser. So imagine you
- 7:02Speaker 2: visit a normal news site, but a hacker has found
- 7:04Speaker 2: a way to inject a script into the comment section, and.
- 7:07Speaker 1: That script steals your logging cookie.
- 7:09Speaker 2: Exactly nasty stuff.
- 7:10Speaker 1: So how does the content security policy header actually stop that?
- 7:14Speaker 2: The server sends a CSP header that basically yells at
- 7:17Speaker 2: your browser, listen to me, only run scripts that come
- 7:20Speaker 2: from my domain. If you see a script trying to
- 7:23Speaker 2: load from evilhacker dot dot com, block it immediately.
- 7:26Speaker 1: It's a strict whitelist. It locks down the environment so
- 7:29Speaker 1: nothing foreign can execute precisely.
- 7:31Speaker 2: Then you have another one called HSTS Strict Transport Security.
- 7:35Speaker 1: This is the one that forces the secure connection right.
- 7:38Speaker 2: Yes, it's the server telling the browser only talk to
- 7:40Speaker 2: me over HTTPS, never play HTTP. It prevents a really
- 7:45Speaker 2: specific attack called SSL stripping.
- 7:48Speaker 1: How does that work?
- 7:49Speaker 2: Imagine a hacker is sitting in the same coffee shop
- 7:51Speaker 2: as you. They try to downgrade your connection to plane
- 7:53Speaker 2: readable HTTP, so they can literally just spy on your
- 7:56Speaker 2: web traffic. Oh wow, Yeah, but HSTS tells the browser,
- 8:00Speaker 2: even if the user explicitly asks for HTTP, don't do
- 8:04Speaker 2: it auto upgrade to a secure line.
- 8:06Speaker 1: And this header seems to have a memory to it.
- 8:08Speaker 2: It does. It has a maxage directive, so the server
- 8:10Speaker 2: can say remember this rule for one entire year. So
- 8:13Speaker 2: even if you come back six months later on a
- 8:15Speaker 2: shady public Wi Fi network, your browser remembers Nope, secure
- 8:19Speaker 2: line only.
- 8:19Speaker 1: There was one more header that caught my eye just
- 8:21Speaker 1: because of the name x frame options.
- 8:23Speaker 2: Hmmm.
- 8:24Speaker 1: It sounds like a comic book villain or something.
- 8:26Speaker 2: It deals with a threat called clickjacking, which is honestly
- 8:30Speaker 2: just as sneaky as it sounds.
- 8:32Speaker 1: This is the invisible button trick, isn't it right?
- 8:34Speaker 2: An attacker builds a fake site that says click here
- 8:39Speaker 2: to win a free prize, but transparently layered perfectly right
- 8:43Speaker 2: on top of that button is your actual bank's transfer
- 8:47Speaker 2: money button, loaded in an invisible frame.
- 8:50Speaker 1: So you think you're clicking the prize button, but you're
- 8:52Speaker 1: actually clicking the bank button. That's terrifyingly clever, it really is.
- 8:56Speaker 2: But the xtram options header solves it. The bank sends
- 8:59Speaker 2: the head saying damy or same origin. It tells a browser,
- 9:05Speaker 2: do not allow anyone anywhere to put my website inside
- 9:09Speaker 2: a frame.
- 9:09Speaker 1: It effectively says, I cannot be overlaid exactly.
- 9:13Speaker 2: So we have all these invisible headers protecting us.
- 9:15Speaker 1: But how does a security professional or a hacker for
- 9:18Speaker 1: that matter, actually see them If they're just the writing
- 9:21Speaker 1: on the envelope and the browser throws the envelope away
- 9:23Speaker 1: to show me the letter, how do we read the writing?
- 9:26Speaker 2: You have to intercept the mail. Professionals use tools like
- 9:30Speaker 2: BURPSUEE or o wasp PZAP. These are called proxies, basically
- 9:35Speaker 2: a middleland, exactly middleman. You set up your computer so
- 9:38Speaker 2: that all your web traffic goes through this tool before
- 9:41Speaker 2: it hits the internet. It pauses every single request and response.
- 9:45Speaker 1: You essentially freeze time you do.
- 9:48Speaker 2: You can look at the headers, you can change them,
- 9:50Speaker 2: you can delete them entirely, and then hit forward to
- 9:53Speaker 2: send them on their way.
- 9:54Speaker 1: That's incredibly powerful. It's not just observing the traffic, it's
- 9:57Speaker 1: active tampering.
- 9:58Speaker 2: And that's exactly how you test a site. You strip
- 10:00Speaker 2: out the security headers and see if this eye breaks,
- 10:03Speaker 2: or you modify a cookie and see if you suddenly
- 10:05Speaker 2: become the admin.
- 10:07Speaker 1: Speaking of cookies, let's loop back to that stateless problem
- 10:10Speaker 1: from earlier. You said the server has complete amnesia, but
- 10:15Speaker 1: Amazon definitely remembers what is in my shopping cart when.
- 10:18Speaker 2: I close the tab, and that memory is entirely thanks
- 10:20Speaker 2: to the cookie.
- 10:22Speaker 1: We all click except on those annoying banners every day.
- 10:25Speaker 1: But what are the actual mechanics of it.
- 10:27Speaker 2: A cookie is just a tiny text file. When you
- 10:30Speaker 2: log in, the server generates a unique ID for you.
- 10:33Speaker 2: Let's just call it session ID one twenty three. It
- 10:36Speaker 2: writes that id onto a cookie and sends it to
- 10:39Speaker 2: your browser with the instruction keep this safe.
- 10:42Speaker 1: It's like a coat check ticket.
- 10:43Speaker 2: Right now, every single time you click a link on Amazon,
- 10:47Speaker 2: your browser quietly looks in its pocket, finds that cookie,
- 10:51Speaker 2: and staples it to your new request. The server reads
- 10:54Speaker 2: the request, sees session ID one twenty three and says, ah,
- 10:57Speaker 2: that's the person who wants the noise canceling headphone.
- 11:00Speaker 1: So without the cookie being sent every time, the cart
- 11:03Speaker 1: is just empty.
- 11:03Speaker 2: Without the cookie, you are a complete stranger every single
- 11:06Speaker 2: time you click.
- 11:07Speaker 1: Since this cookie is basically my digital ID card, surely
- 11:11Speaker 1: we need to protect it because if someone steals my cookie,
- 11:13Speaker 1: they literally are me effectively.
- 11:16Speaker 2: That is called session hijacking, and it's a massive threat.
- 11:19Speaker 2: That's why cookies have their own security flags, these little attributes.
- 11:22Speaker 1: Attached to them, Like what kind of flags?
- 11:24Speaker 2: The big one is htt poe only. It's a flag
- 11:27Speaker 2: that tells your browser this cookie is for the server's
- 11:29Speaker 2: eyes only. Do not let any JavaScript running on the
- 11:32Speaker 2: page touch this cookie.
- 11:34Speaker 1: Ah, I see the connection to what we discussed a
- 11:35Speaker 1: minute ago. So if that excess attack succeeds and a
- 11:39Speaker 1: hacker runs a script to steal my cookies.
- 11:41Speaker 2: If the httpoo only flag is turned on, the script
- 11:44Speaker 2: comes up completely empty handed. The browser just refuses to
- 11:48Speaker 2: give up the cookie. It's a brilliant fail safe. And
- 11:51Speaker 2: then you also have the secure flag, which ensures the
- 11:54Speaker 2: cookie is never ever sent over an unencrypted connection.
- 11:57Speaker 1: It says layers upon layers of rules. Let's shift gears
- 12:00Speaker 1: to the action verbs of this whole conversation. We mentioned
- 12:03Speaker 1: the method earlier. The request tells the server what to do.
- 12:06Speaker 2: The methods get, post, put, delete. There are a handful
- 12:10Speaker 2: of them.
- 12:10Speaker 1: And ninety nine percent of the web seems to just
- 12:12Speaker 1: be GAT and post requests. What's the practical difference between
- 12:16Speaker 1: those two?
- 12:17Speaker 2: G T is for retrieving data. When you type a
- 12:19Speaker 2: URL and hit enter, that's a GEET request. The key
- 12:23Speaker 2: thing about GIET is that any data you send is
- 12:25Speaker 2: totally visible in the URL bar. You've seen this before
- 12:28Speaker 2: question mark search equals podcasts, right.
- 12:31Speaker 1: The data just hangs off the end of the web address.
- 12:33Speaker 2: Now, imagine if you used a gt request for a
- 12:36Speaker 2: log inform. You type your password, hit enter, and suddenly
- 12:40Speaker 2: your URL bar at the top of the screen says
- 12:42Speaker 2: question mark password equals super secret one two three, And that.
- 12:46Speaker 1: URL gets saved in my browser history, it gets logged
- 12:49Speaker 1: by my internet provider, it gets saved on the server's
- 12:51Speaker 1: local logs.
- 12:52Speaker 2: Exactly. It's a complete privacy disaster. That is exactly why
- 12:56Speaker 2: we have pewist. Ppoost sends the data inside the body
- 13:00Speaker 2: of the message, inside the envelope, not written out on
- 13:03Speaker 2: the outside. It's meant for submitting data to be processed safely.
- 13:07Speaker 1: So general rule of thumb, if you are changing something
- 13:10Speaker 1: or sending secret information, use post you were just looking around, use.
- 13:14Speaker 2: Pet generally yes. But then there are the other methods,
- 13:17Speaker 2: the ones you rarely see in the wild, which is
- 13:19Speaker 2: what makes them so dangerous.
- 13:20Speaker 1: The risky methods.
- 13:21Speaker 2: Take trace for example, it's designed purely for diagnostics. It
- 13:25Speaker 2: basically asks the server for peep back to me exactly
- 13:27Speaker 2: what I just sent.
- 13:28Speaker 1: You, like an echo to test the line.
- 13:30Speaker 2: Useful for debugging connection issues, sure, but hackers found a
- 13:33Speaker 2: way to use it to bypass that exact HTTP only
- 13:37Speaker 2: protection we just praised. It's an attack called cross site tracing.
- 13:41Speaker 2: So in any modern secure environment you absolutely want trace disabled.
- 13:45Speaker 1: And what about put.
- 13:46Speaker 2: Put is used to upload files if a server is
- 13:49Speaker 2: misconfigured and lets an anonymous user use put. I can
- 13:53Speaker 2: upload a malicious script, then use get t to execute
- 13:56Speaker 2: that script, and now I own your entire server.
- 13:59Speaker 1: How does a hacker even know if the back door
- 14:01Speaker 1: is left unlocked like that? Do they just guess randomly?
- 14:03Speaker 2: They literally just ask politely. There is a method called options.
- 14:07Speaker 2: You send an options request to a web server and
- 14:09Speaker 2: it replies with a list of what it accepts. It says,
- 14:11Speaker 2: I allow get T east, and oh, look at that,
- 14:14Speaker 2: I allow PUT.
- 14:15Speaker 1: That is incredibly obliging of the server.
- 14:17Speaker 2: It is. It's like casing a neighborhood and finding a
- 14:19Speaker 2: house with a sign on the front lawn that lists
- 14:21Speaker 2: exactly which windows are currently unlocked. Tools like enmap automate
- 14:25Speaker 2: this entirely. They scan thousands of servers firing off options requests,
- 14:29Speaker 2: just looking for that one single server that accidentally left
- 14:32Speaker 2: put enabled.
- 14:33Speaker 1: Okay, so we've talked about the request which is the letter,
- 14:36Speaker 1: the headers which are the envelope, and the methods which
- 14:39Speaker 1: are the actions. Let's talk about the scoreboard now.
- 14:42Speaker 2: The status codes, the famous three digit numbers that tell
- 14:45Speaker 2: you how the whole transaction went.
- 14:47Speaker 1: I mean, everyone knows four h four it's basically pop culture.
- 14:49Speaker 2: At this point, then not found area. But the whole
- 14:52Speaker 2: system is actually very logical. It's grouped by the first digit.
- 14:55Speaker 2: The one hundreds mean hold on, I'm working on it.
- 14:58Speaker 2: The two hundreds means success. You rarely see two hundreds
- 15:01Speaker 2: on your screen because if it works, the page just
- 15:03Speaker 2: loads normally.
- 15:04Speaker 1: But if I'm a system ad man looking at traffic logs,
- 15:07Speaker 1: I want to see a wall of two hundreds exactly.
- 15:09Speaker 2: Then you have the three hundreds. Those are rederrecs. It
- 15:12Speaker 2: means the thing you want move down the street go
- 15:15Speaker 2: here instead.
- 15:15Speaker 1: And then we get into the error codes, the four
- 15:18Speaker 1: hundreds and the five hundreds. I feel like people mix
- 15:20Speaker 1: these two up all the time, but the distinction actually
- 15:23Speaker 1: implies whose faulty error is.
- 15:26Speaker 2: That's the critical takeaway. Four hundreds are client errors. It
- 15:29Speaker 2: means you made a mistake. Four oh one means you
- 15:32Speaker 2: aren't logged in. Four oh three means you're logged in,
- 15:35Speaker 2: but you aren't allowed to see this specific file. Four
- 15:38Speaker 2: oh four means you asked for something that flat out
- 15:41Speaker 2: doesn't exist. The server is saying I'm totally fine, but
- 15:44Speaker 2: you are confused.
- 15:45Speaker 1: Where's the five hundreds?
- 15:46Speaker 2: Five hundreds are server errors. Five hundred internal server error
- 15:50Speaker 2: that means the server crash or the back end databases offline.
- 15:54Speaker 2: The server is admitting I am broken. It's my fault.
- 15:57Speaker 1: From a cybersecurity perspective, do those five five hundred errors
- 16:00Speaker 1: reveal anything useful to an attacker?
- 16:02Speaker 2: Oh, they are absolute gold. A five hundred error often
- 16:05Speaker 2: means the application choked on something very specific you sent it.
- 16:09Speaker 2: If I send a special character like a single quote mark,
- 16:11Speaker 2: and the server throws a five hundred error, that strongly
- 16:13Speaker 2: hints that I might have just found a sequel injection vulnerability,
- 16:16Speaker 2: I broke the underlying logic.
- 16:18Speaker 1: So a crash isn't just a failure, it's a clue.
- 16:20Speaker 2: In hacking, errors are almost always more useful than successes.
- 16:24Speaker 1: That makes total sense. Let's move to the visible part
- 16:26Speaker 1: of the web now. HTML the actual structure of.
- 16:28Speaker 2: The page hypertext markup language. This is the skeleton, the
- 16:33Speaker 2: HTML tags, the body tags, the diff tags. It defines
- 16:36Speaker 2: where the text goes, where the image sits on the page.
- 16:39Speaker 1: And forms. We touched on this with did DT and
- 16:41Speaker 1: posey earlier. The form tag is basically the bridge between
- 16:45Speaker 1: the user typing and the server logic. Happening right.
- 16:48Speaker 2: The form is where the actual interaction happens, and in
- 16:51Speaker 2: the raw HTML you define the method form method equals post.
- 16:56Speaker 2: That is the developer making that exact security choice we
- 16:59Speaker 2: discuss earlier.
- 17:00Speaker 1: But there is something else hidden in the HTML source
- 17:03Speaker 1: code that is often a major risk.
- 17:04Speaker 2: Comments comments. Yeah, developers leave notes for themselves in the code,
- 17:08Speaker 2: things like fix this later, or this API is buggy.
- 17:12Speaker 1: But regular users don't see those notes when they visit
- 17:14Speaker 1: the page.
- 17:15Speaker 2: They don't see them on the rended visual page. But
- 17:17Speaker 2: if you write, click your browser and hit view source,
- 17:19Speaker 2: they are sitting right there in plain text.
- 17:21Speaker 1: And what kind of things do you actually find in there?
- 17:24Speaker 2: You would be amazed. I've found internal network IP addresses.
- 17:28Speaker 2: I found detailed logic explanations like if users admin bypass
- 17:34Speaker 2: the security check. I have even seen actual credentials hard
- 17:37Speaker 2: coded in there.
- 17:38Speaker 1: No way like real passwords or.
- 17:39Speaker 2: Temporary test passwords that somebody just forgot to remove before
- 17:42Speaker 2: going live. Attackers scour HTML comments automatically. It's literally like
- 17:47Speaker 2: finding a sticky note with a password hidden under a
- 17:49Speaker 2: keyboard but digital.
- 17:51Speaker 1: Finally, let's touch on the engines running all of this.
- 17:54Speaker 1: We've described the structure, But what is actually doing the
- 17:56Speaker 1: heavy lifting. Let's talk about the languages Python, JavaScript, Php.
- 18:01Speaker 1: How do they fit into this invisible conversation we're talking about.
- 18:04Speaker 2: Think of them as the agent's participating in the conversation.
- 18:07Speaker 2: JavaScript is the client side linguist. It lives in your browser.
- 18:10Speaker 2: It makes the page interactive and smooth, but it's also
- 18:13Speaker 2: the vehicle for those EXSS attacks we covered.
- 18:16Speaker 1: And Python, where does that fit in?
- 18:17Speaker 2: Python is the automator. You don't usually build the websites
- 18:20Speaker 2: in Python, though you certainly can, but you use Python
- 18:23Speaker 2: to talk to websites at scale. If I want to
- 18:26Speaker 2: test if a thousand different servers have that dangerous put
- 18:29Speaker 2: method enabled, I just write a ten line Python script
- 18:33Speaker 2: to go knock on all their doors for me.
- 18:34Speaker 1: It scales the conversation up to machine speed exactly.
- 18:38Speaker 2: And then you have PowerShell, which is Microsoft's built in
- 18:40Speaker 2: automation framework, great for system admins but incredibly dangerous because
- 18:45Speaker 2: attackers use it to live off the land without downloading
- 18:48Speaker 2: new malware.
- 18:48Speaker 1: And Php.
- 18:49Speaker 2: Php is the old guard of server side languages. It
- 18:53Speaker 2: builds the HTML on the server before sending it to you.
- 18:56Speaker 2: The major danger with PHP is simply that so much
- 18:58Speaker 2: of the Internet runs on v very old, completely unsupported
- 19:02Speaker 2: versions of it.
- 19:02Speaker 1: It's legacy code holding up the modern web.
- 19:05Speaker 2: It's a bangvault with a really rusty lock. If you're
- 19:08Speaker 2: running a version of PHP from twenty twelve, there are
- 19:11Speaker 2: known public exploits that even beginner script kitties can use
- 19:14Speaker 2: to just walk right in.
- 19:16Speaker 1: So we've essentially stripped the Web down to his bare
- 19:18Speaker 1: bones today, request response headers, methods, cookies. It's not magic
- 19:24Speaker 1: at all. It's just a very rigid, very chatty bureaucracy.
- 19:27Speaker 2: That's a fantastic way to put it, a highly structured
- 19:30Speaker 2: bureaucracy of plaintext.
- 19:32Speaker 1: I want to leave you the listener with a bit
- 19:34Speaker 1: of a challenge today, a way to kind of see
- 19:36Speaker 1: the matrix for yourself, so to speak.
- 19:38Speaker 2: Yes, a great exercise next time you are browsing around online.
- 19:43Speaker 2: Just stop looking at the content for a minute. Look
- 19:46Speaker 2: up at the URL bar.
- 19:47Speaker 1: Look to see if there's a question mark in the address.
- 19:49Speaker 2: Exactly. If you see question mark ID equals fifty or
- 19:53Speaker 2: category equals books, you are looking directly at a gt
- 19:56Speaker 2: request parameter. You are seeing the raw data that you
- 20:00Speaker 2: your browser is shouting over to the server.
- 20:02Speaker 1: And try changing it. If it says ID equals fifty,
- 20:04Speaker 1: just type fifty one and hit enter. See what happens.
- 20:07Speaker 2: You might see the next product in the catalog, or
- 20:09Speaker 2: you might see an error code, or if the site
- 20:12Speaker 2: is really poorly built, you might accidentally see someone else's
- 20:15Speaker 2: private order details.
- 20:16Speaker 1: And if you do see that, please act ethically and
- 20:18Speaker 1: report it. Don't exploit it.
- 20:20Speaker 2: Definitely report it. But honestly, once you start seeing the
- 20:23Speaker 2: web as just parameters and headers, you will never look
- 20:26Speaker 2: at a website the exact same way again. It really
- 20:29Speaker 2: changes your perspective.
- 20:30Speaker 1: The invisible conversation is happening right in front of you
- 20:33Speaker 1: all the time. You just have to know how to
- 20:35Speaker 1: read it. Thank you for joining us on this deep dive.
- 20:38Speaker 1: We'll catch you on the next request.