Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering Modern Web Penetration Testing

You're reading from   Mastering Modern Web Penetration Testing Master the art of conducting modern pen testing attacks and techniques on your web application before the hacker does!

Arrow left icon
Product type Paperback
Published in Oct 2016
Publisher Packt
ISBN-13 9781785284588
Length 298 pages
Edition 1st Edition
Arrow right icon
Authors (2):
Arrow left icon
Prakhar Prasad Prakhar Prasad
Author Profile Icon Prakhar Prasad
Prakhar Prasad
Rafay Baloch Rafay Baloch
Author Profile Icon Rafay Baloch
Rafay Baloch
Arrow right icon
View More author details
Toc

Table of Contents (13) Chapters Close

Preface 1. Common Security Protocols FREE CHAPTER 2. Information Gathering 3. Cross-Site Scripting 4. Cross-Site Request Forgery 5. Exploiting SQL Injection 6. File Upload Vulnerabilities 7. Metasploit and Web 8. XML Attacks 9. Emerging Attack Vectors 10. OAuth 2.0 Security 11. API Testing Methodology Index

Reading and writing files


DBMS systems these days provide many facilities, one of which includes the ability to read and write files from the file system. In a classic web application architecture, such as the one depicted as follows, the database server and web server are meant to be run on separate boxes, but there are instances when both are run on the same box and share the same underlying file system. If there is an SQL injection and sufficient conditions (DB privileges, file permissions) are met then we can even upload a backdoor shell or read/download server configurations or files whose locations are generally predefined:

A simple web application architecture. (Source: http://tutorials.jenkov.com/)

Checking privileges

Using a similar error-based example, let us first check to see if the database user has FILE privileges or not. To get this we'll use the --privileges switch in SQLMap as follows:

./sqlmap.py -u http://192.168.50.2/Less-1/?id=2 --privileges

The output is shown in the following...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime