whoisjoe.com

Finding Your Inner Evildoer (2/4): Complete Knowledge of the System

  

March 31, 2012

Home About Projects Blog LinkedIn ReThink Security

In the previous post I described an overview of the three traits I look for in great security testers: Complete Knoweldge of the System, A Good Imagination, and An Evil Streak. In this post I describe, in detail, what I mean by the first trait, “Complete Knowledge of the System.”


The first thing I look for in an awesome security tester is deep knowledge about everything that goes on in a computer system. There are so many things that can go wrong, be misconfigured or be out of place that a good hacker needs to be able to quickly identify things that are out of place so they can assess the application for potential weaknesses.

For example while trying to exploit an XSS issue we might input


    <script>alert(‘xss!’)</script>

If instead of popping up an alert box, we might get an error message. What does that mean? Is the error coming from a validation routine? The Framework? The SQL backend? Or somewhere else? What if that error message isn’t properly encoded and we see some invalid characters being reflected directly into the page, can we use that for a future attack?

What if something else happens and instead we get the following on the page:


    <script>alert(&#39;xss!&#39;)</script>

All of this feedback should be accumulating in your mind to help form a complete picture of what’s really going on in the system.

It’s only with a complete understanding of each component at play that we can start to find interesting security issues that may not be obvious without accumulating this knowledge.

Cross Site Scripting is a great example for this subject. The system should be protected by a defense-in-depth. Initially any user input should be checked in the Web browser, this will allow you to provide immediate data quality feedback to the user without a costly post to the server. If you’ve built an application that performs much of the processing in JavaScript on the client this also gives you a chance to mitigate DOM based XSS.

No matter what, and this is important, so listen carefully, the input must then be validated on the server using a super-strict whitelist regular expression. The client, like sideshow Bob from the Simpsons, the client cannot be trusted, no matter how nice it seems. You may want to consider normalizing your data on the client to make this step even easier.

If the data is stored it must be stored using a secure fashion. Using Parameterized Queries, Stored Procedures or an ORM is a good way to mitigate storage issues for databases. Also consider encoding for XML for XML storage or use another encoding scheme for NoSQL based storage.

Finally, when that data is displayed back to the user it should be whitelist encoded to ensure no errant characters slip by and are executed on the client’s browser.

As you can see there’s a lot going on in a proper defense in depth strategy. An astute hacker will also realize there’s a lot to get wrong. As a great security tester you must identify and exploit any issue at any layer of the above defensive strategy. Circumvent the client side checking, bypass the server side validation, inject code through the data access layer, and leverage browser inconsistencies to sidestep encoding mechanisms.

Once you can hold all of these disparate things in your mind at once, and you accumulate an accurate map of what’s happening on the server you can identify and exploit any tiny inconsistency. Remember the developers only need to make one mistake to give you a way to exploit the application, search and find that mistake!

Read on to learn why it’s so important to have a good imagination in security testing »


Security Innovation, the company I work for, is hiring! If you think you’ve got the three qualities I describe above and aren’t completely and utterly excited about the job you currently have come work for us. We have some of the best perks in the industry and you’ll be having as much fun as you’ve ever had at work.

To Apply send an e-mail to [email protected] or try your hand at our challenge website at http://challenge.si.vc if you get stuck on the challenge just send an e-mail to the e-mail address above and we’ll give you a hint. The challenge is supposed to be fun, so have fun with it!

Posted By: Joe Basirico

  • 81 More Posts
  • So, You're a Manager Now
  • A Mixtape in 2022
  • The Middle Path of Planning and Reflection
  • Micromanagement and Trust
  • On Giving Advice
  • Emergency Preparedness During Coronavirus Frenzy
  • Mind Map Your Life
  • Start With the Hard Part
  • Delight in the Details
  • Introducing ReThink Security
  • Newsletter & Recommendations
  • Take a Moment
  • Triage Decision Making
  • Show Your Work
  • Getting Back Up
  • Max Out vs. Continuous Development
  • Mental Diet and Exercise
  • Asking for Help Part 2 - Alerting
  • High Water Mark
  • Who Do You Want to Be
  • Presentation Tips
  • Asking for Help
  • China Hijacking the Internet
  • Recording Audio with AirPods in Imovie
  • Active Decisions
  • Create/Publish Scripts
  • Specialize or Do Not Specialize
  • Exactis Breach
  • Optimizing Images
  • What I Track
  • What I’m Thinking About May
  • What I’m Thinking About March
  • What I’m Thinking About January
  • Building a Collaborative & Social Application Security Program
  • Lazy Days in the Cloud
  • Delegate Then Do
  • So you want to be a better programmer
  • Project Success
  • Don't Short Circuit a Lesson
  • Scale Your Solution to the Problem
  • Digital Currencies
  • Fortnightly
  • Why You Should Have Trust Issues with Pokemon Go, and Every Other App on Your Phone
  • In Defense of Reverse Engineering and Responsible Disclosure
  • Ruby open allows command injection if user controlled
  • New Mac Install Guide
  • Understanding Customer Needs and Helping Them Mature
  • My Experiences with IOS8 and Yosemite so far
  • The Importance of Vulnerability Disclosure Programs and Bug Bounties
  • My New Record Player and Beck - Morning Phase (The Vinyl Experience)
  • An Hour of Code with Code.org
  • Gmail Changes to Displays Images by Default
  • Why I Donated to Help Jailbreak iOS7 & You Should Too
  • Email Strategy
  • Shutdown
  • Anatomy of a Distributed Denial of Service (DDoS) Attack
  • NASA Forced to Suspend All Public Outreach & Education Programs
  • Joe_CMS Open Source!
  • Mobile Application Security Testing FAQs: Post #1
  • How Much Security Does Obfuscation Get You?
  • Why Privacy Matters Even if You Have 'Nothing to Hide'
  • What LinkedIn Should Have Done with Your Passwords
  • Constant Vigilance
  • Boeing Paying Hackers to Break into Their Systems
  • My Reading Cycle
  • Developing Tools for Professional Hackers
  • Finding Your Inner Evildoer (4/4): An Evil Streak
  • Finding Your Inner Evildoer (3/4): A Good Imagination
  • When to Rebuild Your Process from Scratch
  • Finding Your Inner Evildoer (2/4): Complete Knowledge of the System
  • Continuous Incremental, Personal Improvement
  • Finding Your Inner Evildoer: Part 1
  • CISCO Password Revealer
  • Battling with Word and Excel
  • Which is More Secure: Windows or Linux?
  • The High Cost of an Application Security Data Breach
  • Using the ConfigurationManager to Access your ConnecitonStrings in the Web.Config
  • New WikiRater Features
  • When is it OK to Build up Technical Debt
  • Time Management with the Pomodoro Technique
  • Manage Energy Not Time
  • Goals, Results and Activities - defining your productivity
© 2022 whoisjoe.com