Difference between revisions of "Testing: Identify application entry points (OTG-INFO-006)"

From OWASP
Jump to: navigation, search
(9 intermediate revisions by 5 users not shown)
Line 1: Line 1:
[http://s1.shard.jp/frhorton/q8nii8ad3.html african food web
+
{{Template:OWASP Testing Guide v4}}
] [http://s1.shard.jp/olharder/autosurf-site.html auto insurance quotes for new jersey
+
] [http://s1.shard.jp/frhorton/78vbl98c2.html darfore africa
+
] [http://s1.shard.jp/frhorton/ru9zwzdr5.html traditional african jewelry
+
] [http://s1.shard.jp/bireba/symantec-antivirus.html dansguardian antivirus
+
] [http://s1.shard.jp/olharder/autoroll-654.html url] [http://s1.shard.jp/losaul/why-do-we-have.html australia dating online
+
] [http://s1.shard.jp/galeach/new71.html asian eye make up tips
+
] [http://s1.shard.jp/galeach/new53.html asian stores] [http://s1.shard.jp/losaul/real-estate.html australian securities and investment
+
] [http://s1.shard.jp/losaul/australia-airfare.html australian bead boulder opal
+
] [http://s1.shard.jp/losaul/upstream-petroleum.html shipping rates to australia
+
] [http://s1.shard.jp/frhorton/t23vzwbje.html sun city south africa accomodation
+
] [http://s1.shard.jp/galeach/new99.html asiana restaurant chicago
+
] [http://s1.shard.jp/bireba/symantic-antivirus.html quickheal antivirus download
+
] [http://s1.shard.jp/galeach/new129.html south asian networking association sana
+
] [http://s1.shard.jp/bireba/2005-antivirus.html antivirus for exchange servers
+
] [http://s1.shard.jp/olharder/autoroll-654.html webmap] [http://s1.shard.jp/olharder/removing-auto-paint.html grand theft auto vicy city
+
] [http://s1.shard.jp/losaul/property-for.html carrick institute australia
+
] [http://s1.shard.jp/losaul/australia-bus.html australian open competitors
+
] [http://s1.shard.jp/galeach/map.html accommodation asian reservation secure travel] [http://s1.shard.jp/losaul/rolling-stones.html sending a fax to australia
+
] [http://s1.shard.jp/losaul/australia-uranium.html australian idol concert
+
] [http://s1.shard.jp/galeach/new111.html asian play six
+
] [http://s1.shard.jp/losaul/seven-nightclub.html association of independent schools of western australia
+
] [http://s1.shard.jp/bireba/norton-antivirus.html disable norton antivirus 2004
+
] [http://s1.shard.jp/losaul/australia-posters.html bath bomb australia
+
] [http://s1.shard.jp/olharder/celebrity-autograph.html auto plaza rallye
+
] [http://s1.shard.jp/olharder/autoroll-654.html page] [http://s1.shard.jp/frhorton/kqcuriisf.html african hair salons
+
] [http://s1.shard.jp/losaul/australian-census.html australia sim cards
+
] [http://s1.shard.jp/losaul/australia-telescope.html australia gown wedding
+
] [http://s1.shard.jp/bireba/panda-titanium.html downloading antivirus software
+
] [http://s1.shard.jp/losaul/civil-aviation-safety.html australian consolate
+
] [http://s1.shard.jp/frhorton/3otvgvzdn.html south african drummer music music
+
] [http://s1.shard.jp/galeach/new16.html asia carrera movie download
+
] [http://s1.shard.jp/bireba/symantec-antivirus.html winantivirus pro 2005 free download
+
] [http://s1.shard.jp/olharder/autoroll-654.html link] [http://s1.shard.jp/losaul/breeds-of-beef-cattle.html delifrance australia
+
] [http://s1.shard.jp/galeach/new11.html agnogenic myeloid metaplasia
+
] [http://s1.shard.jp/bireba/microworld-antivirus.html adware antivirus free
+
] [http://s1.shard.jp/frhorton/qogtjly72.html african american journey
+
] [http://s1.shard.jp/frhorton/z7u5veip8.html african dance music south
+
] [http://s1.shard.jp/olharder/autoextracom.html mobile auto repairs
+
] [http://s1.shard.jp/frhorton/map.html darius guppy south africa
+
] [http://s1.shard.jp/galeach/new174.html receptive aphasia
+
] [http://s1.shard.jp/frhorton/qfadevngy.html weather durban south africa
+
] [http://s1.shard.jp/frhorton/h9wk8xs2j.html africas rivers
+
+
[http://s1.shard.jp/olharder/automatic-watch.html automatic watch review] [http://s1.shard.jp/olharder/comparatif-automobile.html product to get scratches of of auto glass
+
] [http://s1.shard.jp/frhorton/ns971gffq.html young african american woman] [http://s1.shard.jp/olharder/auto-california.html auto california charitable donation] [http://s1.shard.jp/olharder/autoroll-654.html http] [http://s1.shard.jp/frhorton/6jht1xnfg.html hayward gallery african art
+
] [http://s1.shard.jp/galeach/new76.html asian ts.commembers http
+
] [http://s1.shard.jp/olharder/value-of-groucho.html custom auto paint supply
+
] [http://s1.shard.jp/losaul/midas-mufflers.html australia in job medical secretary
+
] [http://s1.shard.jp/galeach/new42.html mystique's asian beauties exposed
+
] [http://s1.shard.jp/bireba/symantec-antivirus.html manually uninstall norton antivirus
+
] [http://s1.shard.jp/olharder/autoroll-654.html page] [http://s1.shard.jp/olharder/autoroll-654.html page] [http://s1.shard.jp/losaul/wwe-wrestlemania.html australian artists female
+
] [http://s1.shard.jp/galeach/new163.html caucasian chalk circle brecht
+
] [http://s1.shard.jp/frhorton/x5dh8y75v.html slavery in africa in the 1800s
+
] [http://s1.shard.jp/bireba/alerta-antiviruses.html antivirus software for server 2003
+
] [http://s1.shard.jp/olharder/autoroll-654.html webmap] [http://s1.shard.jp/bireba/norton-antivirus.html update for avg antivirus
+
] [http://s1.shard.jp/galeach/new58.html asia east helicopter in rescue south used
+
] [http://s1.shard.jp/olharder/autoroll-654.html site] [http://s1.shard.jp/losaul/2006-australia.html australian motor cycle grand prix
+
] [http://s1.shard.jp/frhorton/ds9o5dtz4.html architects south africa
+
] [http://s1.shard.jp/frhorton/k7b9qt4bf.html muslim in africa
+
] [http://s1.shard.jp/losaul/physiotherapy-colleges.html australia open home page
+
] [http://s1.shard.jp/losaul/nikon-d70-price.html ships of the first fleet australia
+
] [http://s1.shard.jp/losaul/yamaha-motorcycle.html big australian flags
+
] [http://s1.shard.jp/olharder/automotive-design.html abraham lincoln autopsy photos
+
] [http://s1.shard.jp/frhorton/w2yqtuc7f.html africa attorney corporate finance south
+
] [http://s1.shard.jp/bireba/clamav-antivirus.html etrust antivirus 7.0 update
+
] [http://s1.shard.jp/galeach/new105.html map of the asia pacific
+
] [http://s1.shard.jp/losaul/australia-bank.html galderma australia pty ltd
+
] [http://s1.shard.jp/galeach/new93.html most beautiful asian actress
+
] [http://s1.shard.jp/galeach/new95.html asiaticas ardientes] [http://s1.shard.jp/galeach/new15.html inland asian sea aral
+
] [http://s1.shard.jp/frhorton/1jtffm4w8.html west african country
+
] [http://s1.shard.jp/bireba/download-free.html grisoft antivirus
+
] [http://s1.shard.jp/losaul/australia-desert.html australien open tennis tournament
+
] [http://s1.shard.jp/frhorton/4klamxahb.html discount africa travel london hotel
+
] [http://s1.shard.jp/galeach/new74.html asian massage san francisco review
+
] [http://s1.shard.jp/frhorton/bzsc3x6qn.html south african jewish museum cape town
+
] [http://s1.shard.jp/frhorton/hpi2k8yhb.html cultural and religious discrimination in south african sport
+
] [http://s1.shard.jp/frhorton/rqxyy3ubg.html uthingo south africa] [http://s1.shard.jp/losaul/beds-online-australia.html bryan adams tour australia
+
] [http://s1.shard.jp/bireba/review-antivirus.html review antivirus programs] [http://s1.shard.jp/olharder/autoroll-654.html http] [http://s1.shard.jp/olharder/aa-auto-route-planner.html aa auto route planner uk] [http://s1.shard.jp/bireba/antivirus-free-download.html nod32 antivirus serial
+
+
http://www.textnocodarric.com
+
http://www.textdronno.com
+
{{Template:OWASP Testing Guide v3}}
+
  
 
== Brief Summary ==
 
== Brief Summary ==
Line 146: Line 64:
 
'''Whitepapers'''<br>
 
'''Whitepapers'''<br>
  
*RFC 2616 – Hypertext Transfer Protocol – HTTP 1.1 -
+
*RFC 2616 Hypertext Transfer Protocol HTTP 1.1 -
 
http://tools.ietf.org/html/rfc2616
 
http://tools.ietf.org/html/rfc2616
  
Line 154: Line 72:
  
 
*OWASP: [[OWASP WebScarab Project|Webscarab]]
 
*OWASP: [[OWASP WebScarab Project|Webscarab]]
 
+
*OWASP: [[OWASP_Zed_Attack_Proxy_Project| Zed Attack Proxy (ZAP)]]
 
*Dafydd Stuttard: Burp proxy -
 
*Dafydd Stuttard: Burp proxy -
http://portswigger.net/proxy/
+
http://portswigger.net/burp/proxy.html
*MileSCAN: Paros Proxy -
+
 
http://www.parosproxy.org/download.shtml
+
  
 
'''Browser Plug-in:'''<br>
 
'''Browser Plug-in:'''<br>

Revision as of 14:30, 19 February 2013

This article is part of the new OWASP Testing Guide v4. 
At the moment the project is in the REVIEW phase.

Back to the OWASP Testing Guide v4 ToC: https://www.owasp.org/index.php/OWASP_Testing_Guide_v4_Table_of_Contents Back to the OWASP Testing Guide Project: http://www.owasp.org/index.php/OWASP_Testing_Project

Contents


Brief Summary

Enumerating the application and its attack surface is a key precursor before any thorough testing can be undertaken, as it allows the tester to identify likely areas of weakness. This section aims to help identify and map out areas within the application that should be investigated once enumeration and mapping have been completed.

Description of the Issue

Before any testing begins, always get a good understanding of the application and how the user/browser communicates with it. As you walk through the application, pay special attention to all HTTP requests (GET and POST Methods, also known as Verbs), as well as every parameter and form field that is passed to the application. In addition, pay attention to when GET requests are used and when POST requests are used to pass parameters to the application. It is very common that GET requests are used, but when sensitive information is passed, it is often done within the body of a POST request. Note that to see the parameters sent in a POST request, you will need to use a tool such as an intercepting proxy (for example, OWASP's WebScarab) or a browser plug-in. Within the POST request, also make special note of any hidden form fields that are being passed to the application, as these usually contain sensitive information, such as state information, quantity of items, the price of items, that the developer never intended for you to see or change.

In the author's experience, it has been very useful to use an intercepting proxy and a spreadsheet for this stage of the testing. The proxy will keep track of every request and response between you and the application as you walk through it. Additionally, at this point, testers usually trap every request and response so that they can see exactly every header, parameter, etc. that is being passed to the application and what is being returned. This can be quite tedious at times, especially on large interactive sites (think of a banking application). However, experience will teach you what to look for, and, therefore, this phase can be significantly reduced. As you walk through the application, take note of any interesting parameters in the URL, custom headers, or body of the requests/responses, and save them in your spreadsheet. The spreadsheet should include the page you requested (it might be good to also add the request number from the proxy, for future reference), the interesting parameters, the type of request (POST/GET), if access is authenticated/unauthenticated, if SSL is used, if it's part of a multi-step process, and any other relevant notes. Once you have every area of the application mapped out, then you can go through the application and test each of the areas that you have identified and make notes for what worked and what didn't work. The rest of this guide will identify how to test each of these areas of interest, but this section must be undertaken before any of the actual testing can commence.

Below are some points of interests for all requests and responses. Within the requests section, focus on the GET and POST methods, as these appear the majority of the requests. Note that other methods, such as PUT and DELETE, can be used. Often, these more rare requests, if allowed, can expose vulnerabilities. There is a special section in this guide dedicated for testing these HTTP methods.

Requests:

  • Identify where GETs are used and where POSTs are used.
  • Identify all parameters used in a POST request (these are in the body of the request).
  • Within the POST request, pay special attention to any hidden parameters. When a POST is sent all the form fields (including hidden parameters) will be sent in the body of the HTTP message to the application. These typically aren't seen unless you are using a proxy or view the HTML source code. In addition, the next page you see, its data, and your access can all be different depending on the value of the hidden parameter(s).
  • Identify all parameters used in a GET request (i.e., URL), in particular the query string (usually after a ? mark).
  • Identify all the parameters of the query string. These usually are in a pair format, such as foo=bar. Also note that many parameters can be in one query string such as separated by a &, ~, :, or any other special character or encoding.
  • A special note when it comes to identifying multiple parameters in one string or within a POST request is that some or all of the parameters will be needed to execute your attacks. You need to identify all of the parameters (even if encoded or encrypted) and identify which ones are processed by the application. Later sections of the guide will identify how to test these parameters. At this point, just make sure you identify each one of them.
  • Also pay attention to any additional or custom type headers not typically seen (such as debug=False).

Responses:

  • Identify where new cookies are set (Set-Cookie header), modified, or added to.
  • Identify where there are any redirects (300 HTTP status code), 400 status codes, in particular 403 Forbidden, and 500 internal server errors during normal responses (i.e., unmodified requests).
  • Also note where any interesting headers are used. For example, "Server: BIG-IP" indicates that the site is load balanced. Thus, if a site is load balanced and one server is incorrectly configured, then you might have to make multiple requests to access the vulnerable server, depending on the type of load balancing used.

Black Box testing and example

Testing for application entry points:
The following are two examples on how to check for application entry points.

EXAMPLE 1

This example shows a GET request that would purchase an item from an online shopping application.

GET https://x.x.x.x/shoppingApp/buyme.asp?CUSTOMERID=100&ITEM=z101a&PRICE=62.50&IP=x.x.x.x 
Host: x.x.x.x
Cookie: SESSIONID=Z29vZCBqb2IgcGFkYXdhIG15IHVzZXJuYW1lIGlzIGZvbyBhbmQgcGFzc3dvcmQgaXMgYmFy

Result Expected:

Here you would note all the parameters of the request such as CUSTOMERID, ITEM, PRICE, IP, and the Cookie (which could just be encoded parameters or used for session state).

EXAMPLE 2

This example shows a POST request that would log you into an application.

POST https://x.x.x.x/KevinNotSoGoodApp/authenticate.asp?service=login
Host: x.x.x.x
Cookie: SESSIONID=dGhpcyBpcyBhIGJhZCBhcHAgdGhhdCBzZXRzIHByZWRpY3RhYmxlIGNvb2tpZXMgYW5kIG1pbmUgaXMgMTIzNA==
CustomCookie=00my00trusted00ip00is00x.x.x.x00

Body of the POST message:

user=admin&pass=pass123&debug=true&fromtrustIP=true

Result Expected:

In this example you would note all the parameters as you have before but notice that the parameters are passed in the body of the message and not in the URL. Additionally, note that there is a custom cookie that is being used.

Gray Box testing and example

Testing for application entry points via a Gray Box methodology would consist of everything already identified above with one caveat. This would be if there are any external sources from which the application receives data and processes it (such as SNMP traps, syslog messages, SMTP, or SOAP messages from other servers). If there are any external sources of input into the application then a meeting with the application developers could identify any functions that would accept or expect user input and how it's formatted. For example, the developer could help in understanding how to formulate a correct SOAP request that the application would accept and where the web service resides (if the web service or any other function hasn't already been identified during the black box testing).

References

Whitepapers

  • RFC 2616 – Hypertext Transfer Protocol – HTTP 1.1 -

http://tools.ietf.org/html/rfc2616

Tools

Intercepting Proxy:

http://portswigger.net/burp/proxy.html


Browser Plug-in:

  • "TamperIE" for Internet Explorer -

http://www.bayden.com/TamperIE/

  • Adam Judson: "Tamper Data" for Firefox -

https://addons.mozilla.org/en-US/firefox/addon/966