19.09.2017 Views

the-web-application-hackers-handbook

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 8 n Attacking Access Controls 277<br />

HACK STEPS<br />

1. Identify any parameters that follow Java naming conventions (for example,<br />

get, set, add, update, is, or has followed by a capitalized word), or<br />

explicitly specify a package structure (for example, com.companyname<br />

.xxx.yyy.ClassName). Make a note of all referenced methods you can<br />

find.<br />

2. Look out for a method that lists <strong>the</strong> available interfaces or methods.<br />

Check through your proxy history to see if it has been called as part of<br />

<strong>the</strong> <strong>application</strong>’s normal communication. If not, try to guess it using <strong>the</strong><br />

observed naming convention.<br />

3. Consult public resources such as search engines and forum sites to determine<br />

any o<strong>the</strong>r methods that might be accessible.<br />

4. Use <strong>the</strong> techniques described in Chapter 4 to guess o<strong>the</strong>r method names.<br />

5. Attempt to access all methods ga<strong>the</strong>red using a variety of user account<br />

types, including unau<strong>the</strong>nticated access.<br />

6. If you do not know <strong>the</strong> number or types of arguments expected by some<br />

methods, look for methods that are less likely to take arguments, such as<br />

listInterfaces and getAllUsersInRoles.<br />

Testing Controls Over Static Resources<br />

In cases where static resources that <strong>the</strong> <strong>application</strong> is protecting are ultimately<br />

accessed directly via URLs to <strong>the</strong> resource files <strong>the</strong>mselves, you should test<br />

whe<strong>the</strong>r it is possible for unauthorized users to simply request <strong>the</strong>se URLs directly.<br />

HACK STEPS<br />

1. Step through <strong>the</strong> normal process for gaining access to a protected static<br />

resource to obtain an example of <strong>the</strong> URL by which it is ultimately<br />

retrieved.<br />

2. Using a different user context (for example, a less-privileged user or an<br />

account that has not made a required purchase), attempt to access <strong>the</strong><br />

resource directly using <strong>the</strong> URL you have identified.<br />

3. If this attack succeeds, try to understand <strong>the</strong> naming scheme being used<br />

for protected static files. If possible, construct an automated attack to<br />

trawl for content that may be useful or that may contain sensitive data<br />

(see Chapter 14).

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!