Introduction - The Basics of Web Hacking: Tools and Techniques to Attack the Web (2013)

The Basics of Web Hacking: Tools and Techniques to Attack the Web (2013)

Introduction

Many of us rely on web applications for so many of our daily tasks, whether at work, at home, or at play, and we access them several times a day from our laptops, tablets, phones, and other devices. We use these web applications to shop, bank, pay bills, attend online meetings, social network with friends and family, and countless other tasks. The problem is that web applications aren’t as secure as we’d like to think, and most of the time the attacks used to gain access to a web application are relatively straightforward and simple. In fact, anyone can use widely available hacking tools to perform these devastating web attacks.

This book will teach you how to hack web applications and what you can do to prevent these attacks. It will walk you through the theory, tools, and techniques used to identify and exploit the most damaging web vulnerabilities present in current web applications. This means you will be able to make a web application perform actions it was never intended to perform, such as retrieve sensitive information from a database, bypass the login page, and assume the identity of other users. You’ll learn how to select a target, how to perform an attack, what tools are needed and how to use them, and how to protect against these attacks.

About This Book

This book is designed to teach you the fundamentals of web hacking from the ground up. It’s for those of you interested in getting started with web hacking but haven’t found a good resource. Basically, if you’re a web hacking newbie, this is the book for you! This book assumes you have no previous knowledge related to web hacking. Perhaps you have tinkered around with some of the tools, but you don’t fully understand how or where they fit into the larger picture of web hacking.

Top web hacking experts have a firm grasp on programming, cryptography, bug hunting, exploitation development, database layout, data extraction, how network traffic works, and much more. If you don’t have these skills, don’t be discouraged! These knowledge and skills are accumulated over the course of a career, and if you’re just getting started with web hacking, you probably won’t have all of these skills. This book will teach you the theory, tools, and techniques behind some of the most damaging web attacks present in modern web applications. You will gain not only knowledge and skill but also confidence to transition to even more complex web hacking in the future.

A Hands-On Approach

This book follows a very hands-on approach to introduce and demonstrate the content. Every chapter will have foundational knowledge so that you know the why of the attack and detailed step-by-step directions so that you know the how of the attack.

Our approach to web hacking has three specific targets: the web server, the web application, and the web user. These targets all present different vulnerabilities, so we need to use different tools and techniques to exploit each of them. That’s exactly what this book will do; each chapter will introduce different attacks that exploit these targets’ vulnerabilities.

What's in This Book?

Each chapter covers the following material:

Chapter 1: The Basics of Web Hacking provides an overview of current web vulnerabilities and how our hands-on approach takes aim at them.

Chapter 2: Web Server Hacking takes traditional network hacking methodologies and applies them directly to the web server to not only compromise those machines but also to provide a base of knowledge to use in attacks against the web application and web user. Tools include Nmap, Nessus, Nikto, and Metasploit.

Chapter 3: Web Application Recon and Scanning introduces tools, such as web proxies and scanning tools, which set the stage for you to exploit the targeted web application by finding existing vulnerabilities. Tools include Burp Suite (Spider and Intercept) and Zed Attack Proxy (ZAP).

Chapter 4: Web Application Exploitation with Injection covers the theory, tools, and techniques used to exploit web applications with SQL injection, operating system command injection, and web shells. Tools include Burp Suite (specifically the functions and features of the Proxy Intercept and Repeater tools), sqlmap, John the Ripper (JtR), custom web shell files, and netcat.

Chapter 5: Web Application Exploitation with Broken Authentication and Path Traversal covers the theory, tools, and techniques used to exploit web applications with brute forcing logins, sessions attacks, and forceful browsing. Tools include Burp Suite (Intruder and Sequencer) and various operating system commands for nefarious purposes.

Chapter 6: Web User Hacking covers the theory, tools, and techniques used to exploit other web users by exploiting web application cross-site scripting (XSS) and cross-site request forgery (CSRF) vulnerabilities as well as attacks that require no existing web server or web application vulnerabilities, but instead prey directly on the user’s willingness to complete dangerous actions. The main tool of choice will be Social-Engineer Toolkit (SET).

Chapter 7: Fixes covers the best practices available today to prevent all the attacks introduced in the book. Like most things security-related, the hard part is not identifying these mitigation strategies, but instead on how to best implement and test that they are doing what they are intended to do.

Chapter 8: Next Steps introduces where you can go after finishing this book to continue on your hacking journey. There are tons of great information security groups and events to take part in. Some of you may want formal education, while others may want to know what certifications are especially applicable to this type of security work. A quick list of good books to consider is also provided.

A Quick Disclaimer

The goal of this book is to teach you how to penetrate web servers, web applications, and web users; protect against common attacks; and generally improve your understanding of what web application security is. In a perfect world, no one would use the tools and techniques discussed in this book in an unethical manner. But since that’s not the case, keep the following in mind as you read along:

Think before you hack.

Don’t do malicious things.

Don’t attack a target unless you have written permission.

Many of the tools and techniques discussed in this book are easily detected and traced.

If you do something illegal, you could be sued or thrown into jail. One basic assumption this book makes is that you understand right from wrong. Neither Syngress (this book’s publisher) nor I endorse using this book to do anything illegal. If you break into someone's server or web application without permission, don’t come crying to me when your local law enforcement agency kicks your door in!