Web Application Advanced Hacking - podcast episode cover

Web Application Advanced Hacking

Apr 07, 202521 min
--:--
--:--
Download Metacast podcast app
Listen to this episode in Metacast mobile app
Don't just listen to podcasts. Learn from them with transcripts, summaries, and chapters for every episode. Skim, search, and bookmark insights. Learn more

Episode description

Maor Tal's "Web Application Advanced Hacking" is a hands-on guide to advanced web application hacking techniques for security researchers and bug bounty hunters. The book covers a range of topics, including deserialization attacks, type juggling, NoSQL injection, API hacking (GraphQL), misconfigured cloud storage, server-side request forgery, application logic flaws, and attacks against JSON Web Tokens, SAML, and OAuth 2.0 flows. Each chapter provides both theoretical explanations and practical examples, illustrating how vulnerabilities arise and how to exploit them. The book emphasizes a practical, hands-on approach, but cautions readers to obtain permission before attempting any attacks on systems they do not own. The author also encourages reader feedback to improve future editions.


You can listen and download our episodes for free on more than 10 different platforms:
https://linktr.ee/cyber_security_summary





Discover our free courses in tech and cybersecurity, Start learning today:
https://linktr.ee/cybercode_academy

Transcript

Speaker 1

All right, let's dive into something pretty cool today, something a little cloak and dagger. We're going to be looking at web application hacking.

Speaker 2

Oh fun.

Speaker 1

Yeah, you know the kind of stuff gug bounty hunters use to uncover those nasty vulnerabilities. Right, we're working with some excerpts from a cybersecurity book kind of like our little secret weapon.

Speaker 2

I like it.

Speaker 1

It goes deep into advanced techniques and our mission today. Yeah. Imagine you right now are tasked with securing a web application. What are those sneaky, unexpected attacks that keep you up at night? Well, today's your crash course.

Speaker 2

I like that. And what's great about this book is it doesn't just list out vulnerability. It actually gets inside the hacker's head. It shows how they chain together exploits, how they turn even harmless features into weapons.

Speaker 1

It really does. And right off the bat it jumps into de serialization attacks. I'll admit the term itself sounds kind of techy. Did you break it down for us, like, what's going on there?

Speaker 2

Sure? Sure? Imagine packing a suitcase, right, Ok, you get your clothes, toiletries all neat and tidy.

Speaker 1

Yeah, that's like serialization in the coding world. Taking data, all those structures within an application and packing up for travel, for storage or transmission.

Speaker 2

Okay, making it compact, easy to move around exactly Now.

Speaker 1

De serialization, that's unpacking the suitcase at your destination, getting that data back to its original usable form.

Speaker 2

Got it. So, where's the danger. It's just unpacking data.

Speaker 1

Uh, that's where things get tricky. The danger comes in when a hacker messes with that suitcase before you unpack it. Oh, if they can tamper with the serialized data, slip in some malicious kind sneaky. Well, when the application unpacks it, boom, that code executes. It's like hiding something dangerous in your luggage, waiting for it to wreak havoc when you open it.

Speaker 2

So, in a web app, how do I stop someone from sneaking that dangerous something into my data?

Speaker 1

Never ever de serialized data from untrusted sources without some serious checks. It's like inspecting your suitcase for anything suspicious before you open it up completely.

Speaker 2

Right, make sure there's no weird ticking sounds. Exactly now. The book mentions PHP object injection and Python peockle serialization as common targets.

Speaker 1

I've heard of those.

Speaker 2

Yeah, these mechanisms. If they're not carefully implemented well, hackers can inject malicious objects, exploiting how those languages rebuild the data.

Speaker 1

So they're like twisting the instructions for how to unpack.

Speaker 2

You got it. Now, you've probably heard the term PIOP chains.

Speaker 1

Oh yeah, that one sounds kind of scary.

Speaker 2

It can be property oriented programming chains. It's like the hacker setting up a domino effect.

Speaker 1

Oh okay.

Speaker 2

Each domino is a little piece of code, harmless on its own right, but trigger them in the right order. Those harmless pieces can lead to taking over the server, stealing data, all sorts of nasty stuff.

Speaker 1

Yikes. So, as someone trying to keep an application safe, what are the best defenses against these de serialization attacks?

Speaker 2

You got to have a multi layered approach. First, sanitize, sanitize, sanitize user input before even thinking about de serializing.

Speaker 1

It, right like scrub it clean exactly.

Speaker 2

Second, use secure serialization libraries. One's less prone to these attacks. And of course, keep everything updated patching those known vulnerabilities.

Speaker 1

So it's not just writing secure code, it's a whole strategy.

Speaker 2

You got it. And speaking of sneaky attacks, let's switch gears a bit. Type juggling attacks heard of those?

Speaker 1

I have, Yeah, But to be honest, I'm a bit fuzzy on the details. Are they really as bad as some make them sound?

Speaker 2

Oh? They can be, They can be. It might not sound as dramatic as say, taking over a whole server, right, but type juggling exploits how some languages, especially PHP, compare different kinds of data. Like PHP might say the number zero and the string zero are basically the same if you're not careful.

Speaker 1

Uh oh, I see where this is going.

Speaker 2

Let's say you've got a log in form username, admin, password password classic.

Speaker 1

Right, yeah, not very secure though, huh huh.

Speaker 2

Right, But the point is a hacker with type juggling in mind might just enter zero for.

Speaker 1

Both zero for user name and password. That's it.

Speaker 2

And if the application uses loose comparisons, the kind that doesn't check the data type.

Speaker 1

It just sees zero matches zero, and boom, they're.

Speaker 2

In admin privileges just like that.

Speaker 1

So as a developer, how do I stop these type juggling shenanigans.

Speaker 2

Strict comparisons, my friend. Strict comparisons always, especially when you're checking user input.

Speaker 1

So not just if the values match, but if they're the same type of.

Speaker 2

Data precisely gets rid of all that ambiguity that hackers love to exploit.

Speaker 1

Okay, starting to see how those little quirks in programming languages can become huge security flaws.

Speaker 2

Oh. Absolutely, It's all about knowing those quirks and then thinking, like the bad guy, how would they twist this to their advantage?

Speaker 1

Right, get inside their heads now.

Speaker 2

The book also mentioned something called zero like type juggling.

Speaker 1

Zero Like that sounds even trickier it is.

Speaker 2

It is certain strings in PHP, when you compare them loosely, Oh, they end up being treated like the number zero.

Speaker 1

So like a blank space or something.

Speaker 2

Empty string, a string with just spaces. Yeah, that sort of thing, And a.

Speaker 1

Hacker could use those to sneak past checks that are looking for numbers.

Speaker 2

Exactly, manipulate input fields, parameters, stuff that wouldn't be obvious at first glance but can have big consequences.

Speaker 1

Wow. So type juggling really praise on the assumptions developers make.

Speaker 2

It does it does? And that brings us to our next topic. No SEQL databases. There's this myth out there that they're immune to injection attacks because they don't use SQL right.

Speaker 1

No SQL all about flexibility handling all sorts of unstructured data, right right.

Speaker 2

But just because it's not SQL doesn't mean it's safe.

Speaker 1

So hackers has figured out how to inject commands even without that classic SQL syntax they have.

Speaker 2

The book goes into some specific examples, with Mango dB and couch dB two of the popular ones. They show how hackers can craft these malicious queries that exploit weaknesses in how the database handles user input.

Speaker 1

So even if I'm not using SQUEL, I still got to be super careful about how I handle that data coming in from users.

Speaker 2

Absolutely improvalidation, standardization. Those principles apply no matter what kind of database you're using. And by the way, there are tools out there like no SQL map made specifically to find and exploit those no SQL vulnerabilities.

Speaker 1

It's like hackers have a special toolkit for every occasion they do.

Speaker 2

And speaking of toolkits, let's move on to another area where hackers are pretty creative. API hacking, especially when it comes to graph ql.

Speaker 1

APIs so graphql it's known for being really efficient, flexible, all that, but is it also known for being well insecure?

Speaker 2

Graphql itself doesn't prevent common vulnerabilities like SQL injection or cross site scripting. It all depends on how it's implemented, how secure the data sources and logic are underneath.

Speaker 1

So a hacker going after a graph QLAPI, they're not necessarily exploiting graphql itself, but rather how it's used.

Speaker 2

Exactly. Think of graph ql as a powerful tool, like a really sharp knife.

Speaker 1

Right.

Speaker 2

It can be used for good or bad. It's all in how you wield it.

Speaker 1

Okay, So walk me through this. How would a hacker approach a graph ql API? What are they trying to do?

Speaker 2

First step is usually reconnaissance. They got to find those graph ql endpoints and then figure out the schemer.

Speaker 1

Schema like a map of the API.

Speaker 2

That's it, the structure, the capabilities. They're a little blueprint for the attack.

Speaker 1

So intel gathering before the actual attack.

Speaker 2

Yep. Then they start crafting malicious queries, looking for ways to bypass authentication, grab sensitive data, even inject code that'll run on the server.

Speaker 1

Yis. So securing a graph ql API is more than just slapping on some basic login protection.

Speaker 2

Way more. You gotta think like a hacker. Imagine how they'd try to abuse.

Speaker 1

The system, right, stay one step ahead.

Speaker 2

That's the game. Now, let's not forget another big target for these guys, misconfigured cloud storage.

Speaker 1

Oh yeah, that's a big one these days.

Speaker 2

Cloud storage it's super convenient, but if it's.

Speaker 1

Not set up right, the gold mine for hackers.

Speaker 2

You got it, all those AWSS three buckets, Digital Ocean spaces, Azure blobs, Google cloud storage. If the permissions are loose, files are public.

Speaker 1

It's like leaving the door wide open.

Speaker 2

And this book has some scary examples of the commands hackers use. They probe for weaknesses, list files, download data, even delete or modify stuff.

Speaker 1

So it's not just about stealing data, it's about causing chaos unfortunately.

Speaker 2

Yeah, and what's worse, there are tools out there aws bucket dump, spaces Finder, things like that. These tools automate the whole process of finding and exploiting these misconfigured cloud setups.

Speaker 1

So it's like a shopping spree for hackers, browsing through vulnerable storage buckets taking what they want.

Speaker 2

That's a pretty accurate picture. And the scary part is a lot of companies don't even know how much sensitive data they have out there in the cloud or how bad their security is.

Speaker 1

All right, starting to feel a little paranoid.

Speaker 2

Now, don't worry, We're not done yet. There's a lot more ground to cover in this deep dive. Next up, we'll get into server side request forgery, a really sneaky attack that takes advantage of how applications trust each other.

Speaker 1

Okay, I'm all ears. Let's see what other tricks these hackers have up their sleeves. Yeah, we've been talking about how hackers target databases and APIs, and it seems like no matter what you use, there's always some angle they can exploit.

Speaker 2

Yeah, that's true. And as applications get more complex, right, you know, relying on all these different systems talking to each other, Well, that just creates more opportunities for attacks. That's what makes this next topic so interesting. Server side request forgery SSRF.

Speaker 1

SSRF. I've heard that term, yeah, yeah, but not really sure what it is.

Speaker 2

Okay, So think about it this way. A lot of web apps they need to fetch data from other systems, right, internal services, things like that.

Speaker 1

Right behind the scenes stuff exactly.

Speaker 2

And they do this by making requests within their own network, you know, where they trust everything, right. SSRF is all about tricking the application into making those requests to places that shouldn't be going.

Speaker 1

Oh so it's like the app becomes its own insider threat.

Speaker 2

Exactly, it's tricked into fetching data that it shouldn't have access.

Speaker 1

To, and the hacker is pulling the string, pulling the.

Speaker 2

Strings exactly, the app is making requests on the hacker's behalf. Essentially, in this book, it goes into some really clever techniques they use. Okay, like what well, for example, they might use tools like BURP Collaborator or SSRF.

Speaker 1

Maps sound familiar.

Speaker 2

Yeah, these tools they act like little listening posts. The hacker can see if the application is making requests to their servers.

Speaker 1

Oh so that's how they test if it's vulnerable in the first place.

Speaker 2

Exactly, if they see those requests coming in, they know they've got a potential SSRF vulnerability.

Speaker 1

Okay, So let's say they find a vulnerable app. What's the worst case scenario? What can they actually do with that?

Speaker 2

Oh, it can be bad. It can be bad. They can use SSRF to get into sensitive internal systems. Okay, steal data that's not publicly accessible, even run commands on those internal servers.

Speaker 1

Yikes.

Speaker 2

Imagine them getting into a company's financial records or they're customer database.

Speaker 1

It's been manipulating these internal requests exactly.

Speaker 2

Now, the book also mentioned something interesting, exploiting cloud based metadata APIs.

Speaker 1

How does that work?

Speaker 2

Okay, So with the cloud, applications often run in these environments where they can access metadata services. These services provide info about the app's configuration, the infrastructure around it. Hackers can use SSRF to force the application to query these metadata services.

Speaker 1

Oh, so they can learn about the whole cloud.

Speaker 2

Environment exactly, potentially revealing sensitive details that they can then use for further attacks. And what makes it tricky is that these cloud metadata services, they often have very predictable structures. It's like giving the hacker a blueprint of the cloud environment.

Speaker 1

All thanks to one vulnerable app.

Speaker 2

And the book even talks about using the Gopher protocol.

Speaker 1

Gopher that's like ancient, right it is.

Speaker 2

But it can still be effective for SSRF in certain situations.

Speaker 1

So they're dusting off these old tricks.

Speaker 2

They are they are. It just shows you how creative these guys can be. Now, let's shift gears a bit. Let's talk about application logic flaws. Okay, these are vulnerabilities that come from mistakes in how the app is designed, not necessarily from bad code itself.

Speaker 1

Oh interesting, So, like, what's an example of that.

Speaker 2

Imagine an e commerce site, right, they have discount coupons you can apply it check out.

Speaker 1

Yeah, pretty common.

Speaker 2

A hacker might find a way to mess with the logic of that coupon system, you know, to apply multiple discounts at once.

Speaker 1

So they get set for free or almost free.

Speaker 2

Exactly. The book has all sorts of examples like this, okay, like what manipulating input fields to bypass checks, exploding race conditions where multiple things happen at the same time, even tricking the application into revealing sensitive info through error messages.

Speaker 1

So it's not about breaking the code, it's about breaking the rules of the game exactly.

Speaker 2

It's like they're master illusionists, finding those loopholes in the logic to do things that shouldn't be possible.

Speaker 1

And these logic flaws they seem harder to defend against.

Speaker 2

They are. They are because you need a really deep understanding of how the application works what it's supposed to do.

Speaker 1

So it's not enough to just write secure code. You need to understand the whole picture precisely.

Speaker 2

Now, let's talk about something that's supposed to make things more secure. Authentication and authorization protocols like SAML and OTH two point zero.

Speaker 1

Okay, I've heard those terms, but I'm not really sure how they work.

Speaker 2

Okay. So SAMLUS that stands for Security Assertion Markup Language. It's a way for different systems to securely exchange info about authentication and authorization. It's often used in businesses for single sign on. You know where you log in once and you can access multiple applications.

Speaker 1

Right, makes things easier for users exactly.

Speaker 2

But of course hackers have found ways to attack SAML too.

Speaker 1

No surprise there, AMLL.

Speaker 2

It uses XML, and that makes it vulnerable to something called XML external entity injection attacks or x e XX.

Speaker 1

I think I heard of that.

Speaker 2

Yeah, it's all about exploiting how XML documents are processed. Hackers can craft these malicious XML documents okay, and trick the server into accessing external entities and that can lead to oh, all sorts of bad stuff, sensitive data leaks, denial of service attacks, even remote code execution.

Speaker 1

So it's like turning the XML processing into a weapon exactly.

Speaker 2

They can use it to read files from the server, okay, access internal networks, even run commands.

Speaker 1

Wow, that's a lot of power from one seemingly simple attack.

Speaker 2

It is, so if you're implementing SAML, you've got to be really careful about how you can figure that XML parser right.

Speaker 1

Make sure it's not doing anything it shouldn't.

Speaker 2

Be doing exactly. Disable external entity resolution if you don't absolutely need it, and always sanitize any external input before you even think about treating it as XML.

Speaker 1

Treat it with extreme caution exactly.

Speaker 2

And the book also mentions other SAMMEL attacks, things like signature stripping and XML signature wrapping.

Speaker 1

So it's like a whole world of vulnerabilities within SAML.

Speaker 2

It can be if you're not careful. Now let's talk about both two point zero. That's another popular authorization protocol.

Speaker 1

Yeah, oh, I see that all the time logging into websites with my Google account.

Speaker 2

Or Facebook, right exactly. OATH is all about delegating authorization. So instead of sharing your password with a third party app, right, you just give them permission to access your account through this secure process.

Speaker 1

Much safer than typing in your password everywhere, way safer.

Speaker 2

But like any complex system, OATH two point zero has its own weaknesses, like.

Speaker 1

What give me an example of something that would keep a developer up at night.

Speaker 2

Okay, so one common attack is insufficient redirect URI validation redirect URI.

Speaker 1

What's that?

Speaker 2

So when you authorize a third party app with OTH, there's this redirect URI that tells your browser where to go after you've given permission.

Speaker 1

Okay, so it's like the return address exactly.

Speaker 2

Now, if the app doesn't properly validate those redirect URIs, a hacker can create a malicious one and.

Speaker 1

Send the user to a fake website exactly.

Speaker 2

The user thinks they're going back to the legitimate app.

Speaker 1

But they're actually giving their info to the hacker.

Speaker 2

That's right. And the book goes into other obooth vulnerabilities too, things like cross site request forgery, Yeah I've heard of that one, and authorization code replay attacks. So even with these modern authorization protocols, there's still plenty of room for error.

Speaker 1

It seems like everywhere we look there's another potential vulnerability.

Speaker 2

It's a constant game of cat and mouse. Attackers are always finding new ways to exploit things.

Speaker 1

This deep dive is definitely making me rethink my whole approach to security.

Speaker 2

It's all about awareness. The more you know about these vulnerabilities, the better you can defend against them.

Speaker 1

Right, So what comes next?

Speaker 2

Well, in part three, we'll take all this information we've covered and we'll distill it down into some key takeaways, some actionable advice you can actually use to make your systems more secure.

Speaker 1

Okay, we've gone through a lot. Yeah, we have decerialization, sam l O Walth all those vulnerabilities, right, I gotta be honest, it's kind of overwhelming.

Speaker 2

I can't understand.

Speaker 1

That makes you realize just how many ways a hacker could get into an application.

Speaker 2

But that's not the point of this deep dive, right. The goal isn't to scare you. It's to give you the knowledge you need to build things better, more secure systems.

Speaker 1

Okay, so let's talk defense. If I'm building a web app, what are the biggest lessons here the must dos to protect myself from all these attacks?

Speaker 2

I think the biggest thing is security. It's not just a checklist, it's a way of thinking. You got to constantly be thinking like a hacker.

Speaker 1

Easy to say, hard to do, huh, Right.

Speaker 2

But seriously, you've got to imagine how they try to exploit your app.

Speaker 1

But how do I get into that hacker mindset. I'm not a security expert.

Speaker 2

Well, this book is a good start. It shows you the common attack patterns. Okay, so you can start to see your app through their eyes, and then you can build defenses that actually address those vulnerabilities.

Speaker 1

So it's not just about generic security tools, No, it's about understanding the specific threats.

Speaker 2

You face exactly now. One thing that keeps coming up again and again in this deep dive input validation and sanitization.

Speaker 1

Right, assume all user input.

Speaker 2

Is evil exactly. Never trust it, validate it, sanitize it, escape it properly before you use it for anything.

Speaker 1

Queries commands, anything like.

Speaker 2

That prevents a whole bunch of attacks right there.

Speaker 1

Doable injection, cross site scripting, even those deserialization attacks, all of them.

Speaker 2

It's like having a security checkpoint at the entrance to your.

Speaker 1

App, carefully screening everything that comes in.

Speaker 2

Another big one, secure configuration and patching strong passwords, access controls, disabling anything you don't need, okay, and keep your software up to date. Those security patches are crucial.

Speaker 1

Sounds pretty basic, but I guess it's easy to overlook.

Speaker 2

It is, and you'd be surprised how many attacks happen because of simple configuration mistakes.

Speaker 1

It's like leaving the door wide open exactly now.

Speaker 2

Besides secure coding, input validation, a good configuration.

Speaker 1

Yeah, what else?

Speaker 2

Testing and monitoring. You can't just build something, add some security features and then forget about.

Speaker 1

It, right, It's an ongoing process.

Speaker 2

Security is a journey, not a destination. Regular penetry, creation, testing, vulnerability scanning, security audits, all that stuff is essential.

Speaker 1

So it's like having a security team constantly on patrol looking for weaknesses.

Speaker 2

That's a good way to think about it. And technology keeps changing. New threats pop up all the time, so you got to keep adapting.

Speaker 1

This deep dive has definitely made me realize how important it is to stay informed.

Speaker 2

It is, it is, but that's also what makes security so interesting. Yeah, it's a constant challenge. You got to be creative, solve problems, learn from your mistakes.

Speaker 1

I'm definitely leaving this deep dive feeling a lot more aware of security, maybe a little more paranoid, but also more empowered.

Speaker 2

You know, good, good knowledge is power, like they say, And remember security isn't just about preventing attacks. It's also about building systems that can recover if something does happen.

Speaker 1

So it's not just about walls, it's about resilience.

Speaker 2

Exactly as we wrap up one less thought, Okay, we're moving into a world of even more interconnected systems, the cloud, IoT a all that the security challenges are only going to get tougher.

Speaker 1

That's exciting and scary at the same time.

Speaker 2

It is it is, but if we understand the principles of secure design, think like those hackers, keep adapting our defenses, we can build a more secure future for ourselves and for all the technology we create.

Speaker 1

Well said, thanks for taking us on this deep dive, my pleasure. It's an eye opening definitely something to think about.

Speaker 2

Remember, stay curious, stay vigilant, never stop learning, And.

Speaker 1

For everyone listening, thanks for joining us. Until next time, stay secure out there.

Transcript source: Provided by creator in RSS feed: download file
For the best experience, listen in Metacast app for iOS or Android