Brute-force attacks are often used for attacking authentication and discovering hidden content/pages within a web application. These attacks are usually sent via GET and POST requests to the server. In regards to authentication, brute force attacks are often mounted when an [[account lockout policy Authentication_Cheat_Sheet#Implement_Account_Lockout in not in place.

+

Brute-force attacks are often used for attacking authentication and discovering hidden content/pages within a web application. These attacks are usually sent via GET and POST requests to the server. In regards to authentication, brute force attacks are often mounted when an [https://www.owasp.org/index.php/Authentication_Cheat_Sheet#Implement_Account_Lockout account lockout policy] in not in place.

===Example 1===

===Example 1===

Line 31:

Line 31:

A web application can be attacked via brute force by taking a word list of known pages, for instance from a popular content management system, and simply requesting each known page then analyzing the HTTP response code to determine if the page exists on the target server.

A web application can be attacked via brute force by taking a word list of known pages, for instance from a popular content management system, and simply requesting each known page then analyzing the HTTP response code to determine if the page exists on the target server.

+

[https://www.owasp.org/index.php/Category:OWASP_DirBuster_Project DirBuster] is a tool that does exactly this.

−

===Example 2===

+

Other tools for this type of attack are as follows:

−

+

−

In the first scenerio, where the goal of brute-forcing is to know the password in its decrypted form, it may appear that [http://www.openwall.com/john/ John the Ripper] is a very helpful tool. The TOP10 tools for password cracking with different methods, including brute-force, may be found on

+

−

http://sectools.org/crackers.html.

+

−

+

−

For testing web services there are tools like:

- dirb (http://sourceforge.net/projects/dirb/)

- dirb (http://sourceforge.net/projects/dirb/)

- WebRoot (http://www.cirt.dk/tools/webroot/WebRoot.txt)

- WebRoot (http://www.cirt.dk/tools/webroot/WebRoot.txt)

−

dirb belongs to more advanced tools. With its help we are able to:

+

Dirb is capable of:

- set cookies

- set cookies

- add any HTTP header

- add any HTTP header

Line 76:

Line 72:

(***) DIRECTORY (*)

(***) DIRECTORY (*)

</pre>

</pre>

−

In the output the attacker is informed that phpmyadmin/ catalogue was found. The attacker who knows that is now able to perform the attack on this application. In dirb's templates there is, among others, a dictionary containing information about invalid httpd configuration. This dictionary will detect weaknesses of this kind.

+

In the output the attacker is informed that phpmyadmin/ directory was found. The attacker has now found a potential directory of interest within this application. In dirb's templates there are, among others, a dictionary containing information about invalid httpd configurations. This dictionary will detect weaknesses of this kind.

−

+

−

+

−

One of the main problems with tools like dirb is recognition if the given response from the server is expected and reliable. With more advanced server configuration (e.g. with mod_rewrite) automatic tools are unable to determine if server response informs about an error or that the file, which the attacker is after, was found.

+

−

+

The application [http://www.cirt.dk/tools/webroot/WebRoot.txt WebRoot.pl], written by CIRT.DK, has embedded mechanisms for parsing server responses, and based on the phrase specified by the attacker, measures if the server response is expected.

The application [http://www.cirt.dk/tools/webroot/WebRoot.txt WebRoot.pl], written by CIRT.DK, has embedded mechanisms for parsing server responses, and based on the phrase specified by the attacker, measures if the server response is expected.

One of the main issues with tools like dirb/dirbuster consist in the analysis of server responses. With more advanced server configuration (e.g. with mod_rewrite) automatic tools are sometimes unable to determine "File not found" errors due to the server response being an HTTP response code 200 but the page itself indicates "File not found". This can lead to false positives if the brute force tool is only relying on HTTP response codes.

+

+

An advanced application assessment tool, such as [http://portswigger.net/ Burp Suite], can be used to parse specific parts of the page returned, looking for certain strings in an effort to reduce false positives.

+

+

===Example 2===

+

+

In regards to authentication, when no password policy is in place an attacker can use lists of common username and passwords to brute force a username and/or password field until successful authentication.

Related Security Activities

How to Test for Brute Force Vulnerabilities

Description

A brute force attack can manifest itself in many different ways, but primarily consists in an attacker configuring predetermined values, making requests to a server using those values, and then analyzing the response. For the sake of efficiency, an attacker may use a dictionary attack (with or without mutations) or a traditional brute-force attack (with given classes of characters e.g.: alphanumerical, special, case (in)sensitive). Considering a given method, number of tries, efficiency of the system which conducts the attack, and estimated efficiency of the system which is attacked the attacker is able to calculate approximately how long it will take to submit all chosen predetermined values.

Risk Factors

Examples

Brute-force attacks are often used for attacking authentication and discovering hidden content/pages within a web application. These attacks are usually sent via GET and POST requests to the server. In regards to authentication, brute force attacks are often mounted when an account lockout policy in not in place.

Example 1

A web application can be attacked via brute force by taking a word list of known pages, for instance from a popular content management system, and simply requesting each known page then analyzing the HTTP response code to determine if the page exists on the target server.

- set cookies
- add any HTTP header
- use PROXY
- mutate objects which were found
- test http(s) connections
- seek catalogues and/or files using defined dictionaries and templates
- and much much more

In the output the attacker is informed that phpmyadmin/ directory was found. The attacker has now found a potential directory of interest within this application. In dirb's templates there are, among others, a dictionary containing information about invalid httpd configurations. This dictionary will detect weaknesses of this kind.

The application WebRoot.pl, written by CIRT.DK, has embedded mechanisms for parsing server responses, and based on the phrase specified by the attacker, measures if the server response is expected.

One of the main issues with tools like dirb/dirbuster consist in the analysis of server responses. With more advanced server configuration (e.g. with mod_rewrite) automatic tools are sometimes unable to determine "File not found" errors due to the server response being an HTTP response code 200 but the page itself indicates "File not found". This can lead to false positives if the brute force tool is only relying on HTTP response codes.

An advanced application assessment tool, such as Burp Suite, can be used to parse specific parts of the page returned, looking for certain strings in an effort to reduce false positives.

Example 2

In regards to authentication, when no password policy is in place an attacker can use lists of common username and passwords to brute force a username and/or password field until successful authentication.