diff --git a/CHANGELOG.md b/CHANGELOG.md index 01edfaf96..4c036c5fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,30 +4,36 @@ DAMN VULNERABLE WEB APPLICATION v1.9 (*Not Yet Released*) ====== -+ Added CSRF token to pre-auth forms (login/setup/security pages). (g0tmi1k + Shinkurt) -+ Added HTTPOnly cookie flag on impossible levels. (g0tmi1k) -+ Added PDO for the impossible examples in SQLi & SQLi Blind. (g0tmi1k) -+ Added system check to setup. (g0tmi1k) -+ Changed brute force medium to be harder due to sleep. (g0tmi1k) -+ Changed file include landing page + added 3x example pages. (g0tmi1k) -+ Changed file include medium to be harder due to more filters. (g0tmi1k) -+ Changed HTTP REFERER check for medium level CSRF. (g0tmi1k) -+ Changed input box for medium level with SQLi + SQLi Blind. (g0tmi1k) -+ Changed SQLi + SQLi Blind to be $_POST rather than $_GET. (g0tmi1k) -+ Changed SQLi Blind to be a real example of the vulnerability. (g0tmi1k) -+ Fixed brute force and file upload impossible levels, as they were vulnerable. (g0tmi1k + Shinkurt) -+ Fixed bug with file fnclude page not loading. (g0tmi1k) -+ Fixed CAPTCHA bug to read URL parameters on impossible. (g0tmi1k) -+ Fixed CAPTCHA bug where the form wouldn't be visible. (g0tmi1k) -+ Fixed CAPTCHA bug where the URL parameters were not being used for low + medium. (g0tmi1k) -+ Fixed CSRF medium level bug when not on localhost. (g0tmi1k) -+ Fixed setup bug with custom URL path. (g0tmi1k) -+ Removed PostgreSQL DB support. (g0tmi1k) -+ Renamed 'Command Execution' to 'Command Injection'. (g0tmi1k) -+ Renamed 'high' level to 'impossible' and created new vectors for 'high'. (g0tmi1k) -+ Updated README and documentation. (g0tmi1k) -+ Various code cleanups in the core PHP files+CSS & Verbosed the documentation. (g0tmi1k) -+ Various setup improvements (e.g. redirection + limited menu links). (g0tmi1k) ++ Added a dedicated objective (or "flag") for file include. (@g0tmi1k) ++ Added a warning to any module that requires a certain configuration. (@g0tmi1k) ++ Added comments to all source code that would be visible via DVWA modules. (@g0tmi1k) ++ Added CSRF token to pre-auth forms (login/setup/security pages). (@g0tmi1k + @Shinkurt) ++ Added HttpOnly cookie flag on impossible levels. (@g0tmi1k) ++ Added more detail to the documentation. (@g0tmi1k) ++ Added PDO to all impossible levels requiring MySQL. (@g0tmi1k) ++ Added PHPIDS options into the config file. (@g0tmi1k) ++ Added system check to setup. (@g0tmi1k) ++ Added various information to all help pages for every module. (@g0tmi1k) ++ Changed brute force medium to be harder due to sleep. (@g0tmi1k) ++ Changed file include landing page + added 3x example pages. (@g0tmi1k) ++ Changed file include medium to be harder due to more filters. (@g0tmi1k) ++ Changed HTTP REFERER check for medium level CSRF. (@g0tmi1k) ++ Changed input box for medium level with SQLi + SQLi Blind. (@g0tmi1k) ++ Changed SQLi + SQLi Blind to be $_POST rather than $_GET. (@g0tmi1k) ++ Changed SQLi Blind to be a real example of the vulnerability. (@g0tmi1k) ++ Fixed brute force and file upload impossible levels, as they were vulnerable. (@g0tmi1k + @Shinkurt) ++ Fixed bug with file fnclude page not loading. (@g0tmi1k) ++ Fixed CAPTCHA bug to read URL parameters on impossible. (@g0tmi1k) ++ Fixed CAPTCHA bug where the form wouldn't be visible. (@g0tmi1k) ++ Fixed CAPTCHA bug where the URL parameters were not being used for low + medium. (@g0tmi1k) ++ Fixed CSRF medium level bug when not on localhost. (@g0tmi1k) ++ Fixed setup bug with custom URL path. (@g0tmi1k) ++ Removed PostgreSQL DB support. (@g0tmi1k) ++ Renamed 'Command Execution' to 'Command Injection'. (@g0tmi1k) ++ Renamed 'high' level to 'impossible' and created new vectors for 'high'. (@g0tmi1k) ++ Updated README and documentation. (@g0tmi1k) ++ Various code cleanups in the core PHP files+CSS. (@g0tmi1k) ++ Various setup improvements (e.g. redirection + limited menu links). (@g0tmi1k) v1.8 (2013-05-01) ====== @@ -40,42 +46,42 @@ v1.8 (2013-05-01) v1.0.7 (2010-09-08) ====== -+ Re-designed the login page + made some other slight cosmetic changes. 06/06/2010 (ethicalhack3r) -+ Started PostgreSQL implementation. 15/03/2010 (ethicalhack3r) -+ A few small cosmetic changes. 15/03/2010 (ethicalhack3r) -+ Improved the help information and look. 15/03/2010 (ethicalhack3r) -+ Fixed a few bugs thanks to Digininja. 15/03/2010 (ethicalhack3r) ++ Re-designed the login page + made some other slight cosmetic changes. 06/06/2010 (@ethicalhack3r) ++ Started PostgreSQL implementation. 15/03/2010 (@ethicalhack3r) ++ A few small cosmetic changes. 15/03/2010 (@ethicalhack3r) ++ Improved the help information and look. 15/03/2010 (@ethicalhack3r) ++ Fixed a few bugs thanks to @Digininja. 15/03/2010 (@ethicalhack3r) + Show logged in username. 05/02/2010 (Jason Jones) -+ Added new info on RandomStorm. 04/02/2010 (ethicalhack3r) -+ Added 'SQL Injection (Blind)'. 04/02/2010 (ethicalhack3r) -+ Added official documentation. 21/11/2009 (ethicalhack3r) -+ Implemented view all source functionality. 16/10/2009 (tmacuk, craig, ethicalhack3r) ++ Added new info on RandomStorm. 04/02/2010 (@ethicalhack3r) ++ Added 'SQL Injection (Blind)'. 04/02/2010 (@ethicalhack3r) ++ Added official documentation. 21/11/2009 (@ethicalhack3r) ++ Implemented view all source functionality. 16/10/2009 (tmacuk, craig, @ethicalhack3r) v1.0.6 (2009-10-05) ====== -+ Fixed a bug where the logo would not show on first time use. 03/09/2009 (ethicalhack3r) -+ Removed 'current password' input box for low+med CSRF security. 03/09/2009 (ethicalhack3r) -+ Added an article which was written for OWASP Turkey. 03/10/2009 (ethicalhack3r) -+ Added more toubleshooting information. 02/10/2009 (ethicalhack3r) -+ Stored XSS high now sanitises output. 02/10/2009 (ethicalhack3r) -+ Fixed a 'bug' in XSS stored low which made it not vulnerable. 02/10/2009 (ethicalhack3r) -+ Rewritten command execution high to use a whitelist. 30/09/09 (ethicalhack3r) -+ Fixed a command execution vulnerability in exec high. 17/09/09 (ethicalhack3r) -+ Added some troubleshooting info for PHP 5.2.6 in readme.txt. 17/09/09 (ethicalhack3r) -+ Added the upload directory to the upload help. 17/09/09 (ethicalhack3r) ++ Fixed a bug where the logo would not show on first time use. 03/09/2009 (@ethicalhack3r) ++ Removed 'current password' input box for low+med CSRF security. 03/09/2009 (@ethicalhack3r) ++ Added an article which was written for OWASP Turkey. 03/10/2009 (@ethicalhack3r) ++ Added more toubleshooting information. 02/10/2009 (@ethicalhack3r) ++ Stored XSS high now sanitises output. 02/10/2009 (@ethicalhack3r) ++ Fixed a 'bug' in XSS stored low which made it not vulnerable. 02/10/2009 (@ethicalhack3r) ++ Rewritten command execution high to use a whitelist. 30/09/09 (@ethicalhack3r) ++ Fixed a command execution vulnerability in exec high. 17/09/09 (@ethicalhack3r) ++ Added some troubleshooting info for PHP 5.2.6 in readme.txt. 17/09/09 (@ethicalhack3r) ++ Added the upload directory to the upload help. 17/09/09 (@ethicalhack3r) v1.0.5 (2009-09-03) ====== -+ Made IE friendly as much as possible. 30/08/2009 (ethicalhack3r) -+ Removed the acunetix scan report. 30/08/2009 (ethicalhack3r) -+ Added 'Clear Log' button to PHPIDS parser. 27/08/2009 (ethicalhack3r) -+ Implemented PHPIDS log parser. 27/08/2009 (ethicalhack3r) -+ Implemented Stored XSS vulnerability. 27/08/2009 (ethicalhack3r) -+ Added htaccess rule for localhost access only. 22/08/2009 (ethicalhack3r) -+ Added CSRF. 01/08/2009 (ethicalhack3r) -+ Implemented sessions/login. 01/08/2009 (ethicalhack3r) ++ Made IE friendly as much as possible. 30/08/2009 (@ethicalhack3r) ++ Removed the acunetix scan report. 30/08/2009 (@ethicalhack3r) ++ Added 'Clear Log' button to PHPIDS parser. 27/08/2009 (@ethicalhack3r) ++ Implemented PHPIDS log parser. 27/08/2009 (@ethicalhack3r) ++ Implemented Stored XSS vulnerability. 27/08/2009 (@ethicalhack3r) ++ Added htaccess rule for localhost access only. 22/08/2009 (@ethicalhack3r) ++ Added CSRF. 01/08/2009 (@ethicalhack3r) ++ Implemented sessions/login. 01/08/2009 (@ethicalhack3r) + Complete recode. (jamesr) + Complete redesign. (jamesr) + Delimited 'dvwa' in session- minimising the risk of clash with other projects running on localhost. 01/08/2009 (jamesr) diff --git a/README.md b/README.md index 8da0c1339..9fd47751d 100644 --- a/README.md +++ b/README.md @@ -42,9 +42,9 @@ along with Damn Vulnerable Web Application (DVWA). If not, see http://www.gnu.o DVWA is available either as a package that will run on your own web server or as a Live CD: - + DVWA v1.9 (Testing) - (1.3 MB) [Download ZIP](https://github.com/RandomStorm/DVWA/archive/master.zip) - `git clone https://github.com/RandomStorm/DVWA` - + DVWA v1.8 (Stable) - (1.3 MB) [Download ZIP](https://github.com/RandomStorm/DVWA/archive/v1.0.8.zip) - + DVWA v1.0.7 LiveCD - (480 MB) [Download ISO](http://www.dvwa.co.uk/DVWA-1.0.7.iso) + + DVWA v1.9 Source (Testing) - \[1.3 MB\] [Download ZIP](https://github.com/RandomStorm/DVWA/archive/master.zip) // `git clone https://github.com/RandomStorm/DVWA` + + DVWA v1.8 Source (Stable) - \[1.3 MB\] [Download ZIP](https://github.com/RandomStorm/DVWA/archive/v1.0.8.zip) - Released 2013-05-01 + + DVWA v1.0.7 LiveCD - \[480 MB\] [Download ISO](http://www.dvwa.co.uk/DVWA-1.0.7.iso) - Released 2010-09-08 - - - @@ -90,12 +90,12 @@ $_DVWA[ 'db_database' ] = 'dvwa'; Depening on your Operating System as well as version of PHP, you may wish to alter the default configuration. The location of the files will be different on a per-machine basis. Note, You are unable to use PHP v7.0 or later with DVWA. -**Folders Permissions**: +**Folder Permissions**: * `./hackable/uploads/` - Needs to be writable by the web service (for File Upload). -* `./external/phpids/0.6/lib/IDS/tmp/` - Needs to be writable by the web service (if you wish to use PHPIDS). +* `./external/phpids/0.6/lib/IDS/tmp/phpids_log.txt` - Needs to be writable by the web service (if you wish to use PHPIDS). -**PHP**: +**PHP configuration**: * `allow_url_include = on` - Allows for Remote File Inclusions (RFI) [[allow_url_include](https://secure.php.net/manual/en/filesystem.configuration.php#ini.allow-url-include)] * `allow_url_fopen = on` - Allows for Remote File Inclusions (RFI) [[allow_url_fopen](https://secure.php.net/manual/en/filesystem.configuration.php#ini.allow-url-fopen)] @@ -103,9 +103,9 @@ Note, You are unable to use PHP v7.0 or later with DVWA. * `magic_quotes_gpc = off` - (If PHP <= v5.4) Allows for SQL Injection (SQLi) [[magic_quotes_gpc](https://secure.php.net/manual/en/security.magicquotes.php)] * `display_errors = off` - (Optional) Hides PHP warning messages to make it less verbose [[display_errors](https://secure.php.net/manual/en/errorfunc.configuration.php#ini.display-errors)] -**`config/config.inc.php`**: +**File: `config/config.inc.php`**: -* `$_DVWA[ 'recaptcha_public_key' ]` & `$_DVWA[ 'recaptcha_private_key' ]` - Need to be generated from: https://www.google.com/recaptcha/admin/create +* `$_DVWA[ 'recaptcha_public_key' ]` & `$_DVWA[ 'recaptcha_private_key' ]` - These values need to be generated from: https://www.google.com/recaptcha/admin/create ### Default Credentials @@ -122,9 +122,9 @@ Login URL: http://127.0.0.1/dvwa/login.php For the latest troubleshooting information please visit: https://github.com/RandomStorm/DVWA/issues -+Q. SQL Injection wont work on PHP version 5.2.6. ++Q. SQL Injection wont work on PHP v5.2.6. --A.If you are using PHP version 5.2.6 you will need to do the following in order for SQL injection and other vulnerabilities to work. +-A.If you are using PHP v5.2.6 you will need to do the following in order for SQL injection and other vulnerabilities to work. In `.htaccess`: @@ -154,7 +154,7 @@ With: +Q. My XSS payload won't run in IE. --A. If your running IE8 or above IE actively filters any XSS. To disable the filter you can do so by setting the HTTP header `X-XSS-Protection: 0` or disable it from internet options. There may also be ways to bypass the filter. +-A. If your running IE8 or above, IE actively filters any XSS. To disable the filter you can do so by setting the HTTP header `X-XSS-Protection: 0` or disable it from internet options. There may also be ways to bypass the filter. - - - diff --git a/about.php b/about.php index a80089b13..3e147e720 100644 --- a/about.php +++ b/about.php @@ -1,46 +1,46 @@
Version ".dvwaVersionGet()." (Release date: ".dvwaReleaseDateGet().")
+Version " . dvwaVersionGet() . " (Release date: " . dvwaReleaseDateGet() . ")
Damn Vulnerable Web Application (DVWA) is a PHP/MySQL web application that is damn vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, help web developers better understand the processes of securing web applications and aid teachers/students to teach/learn web application security in a class room environment
The official documentation for DVWA can be found here.
DVWA is a RandomStorm OpenSource project. All material is copyright 2008-2015 RandomStorm & Ryan Dewhurst.
The PHPIDS library is included, in good faith, with this DVWA distribution. The operation of PHPIDS is provided without support from the DVWA team. It is licensed under separate terms to the DVWA code.
+The PHPIDS library is included, in good faith, with this DVWA distribution. The operation of PHPIDS is provided without support from the DVWA team. It is licensed under separate terms to the DVWA code.
Everyone is welcome to contribute and help make DVWA as successful as it can be. All contributors can have their name and link (if they wish) placed in the credits section. To contribute pick an Issue from the Project Home to work on or submit a patch to the Issues list.
- -"; +\n"; dvwaHtmlEcho( $page ); exit; diff --git a/config/config.inc.php b/config/config.inc.php index 763a006bb..37c190cda 100644 --- a/config/config.inc.php +++ b/config/config.inc.php @@ -17,17 +17,28 @@ $_DVWA[ 'db_user' ] = 'root'; $_DVWA[ 'db_password' ] = 'p@ssw0rd'; -# Only used for PostgreSQL/PGSQL +# Only used with PostgreSQL/PGSQL database selection. $_DVWA[ 'db_port '] = '5432'; # ReCAPTCHA settings -# Get your keys at https://www.google.com/recaptcha/admin/create +# Used for the 'Insecure CAPTCHA' module +# You'll need to generate your own keys at: https://www.google.com/recaptcha/admin/create $_DVWA[ 'recaptcha_public_key' ] = ''; $_DVWA[ 'recaptcha_private_key' ] = ''; # Default security level -# The default is impossible, you may wish to set this to either low, medium or high. -# If you specify an invalid level, DVWA will default to impossible. +# Default value for the secuirty level with each session. +# The default is 'impossible'. You may wish to set this to either 'low', 'medium', 'high' or impossible'. $_DVWA[ 'default_security_level' ] = 'impossible'; +# Default PHPIDS status +# PHPIDS status with each session. +# The default is 'disabled'. You can set this to be either 'enabled' or 'disabled'. +$_DVWA[ 'default_phpids_level' ] = 'disabled'; + +# Verbose PHPIDS messages +# Enabling this will show why the WAF blocked the request on the blocked request. +# The default is 'disabled'. You can set this to be either 'true' or 'false'. +$_DVWA[ 'default_phpids_verbose' ] = 'false'; + ?> diff --git a/dvwa/css/help.css b/dvwa/css/help.css index 286618066..abe9ebf5e 100644 --- a/dvwa/css/help.css +++ b/dvwa/css/help.css @@ -8,11 +8,9 @@ h1 { font-size: 25px; } - div#container { } - div#code { background-color: #ffffff; } @@ -20,3 +18,8 @@ div#code { div#area { margin-left: 30px; } + +span.spoiler { + background-color: black; + color: black; +} diff --git a/dvwa/css/login.css b/dvwa/css/login.css index e8d89ab2f..e4727a02e 100644 --- a/dvwa/css/login.css +++ b/dvwa/css/login.css @@ -1,8 +1,27 @@ body { background: #fefffe; font: 12px/15px Arial, Helvetica, sans-serif; - line-height:20px; - color:#6b6b6b; + line-height: 20px; + color: #6b6b6b; +} + +#wrapper { + text-align: center; + margin: 0 auto; +} + +#content { + display: inline-block; + padding: 20px; + width: auto; +} + +#footer { + position: absolute; + width: 100%; + height: 50px; + bottom: 0px; + left: 0px; } label { @@ -15,7 +34,7 @@ label { font-weight: bold; } -.loginInput{ +.loginInput { float: left; color: #6B6B6B; width: 320px; @@ -31,9 +50,10 @@ fieldset { width: 350px; padding: 10px 20px 10px 20px; overflow: hidden; - border-style:none; + border-style: none; } p { font-size: 10px; } + diff --git a/dvwa/css/main.css b/dvwa/css/main.css index e713947c3..82e6658a4 100644 --- a/dvwa/css/main.css +++ b/dvwa/css/main.css @@ -1,13 +1,13 @@ -body{ - margin:0; +body { + margin: 0; color: #2f2f2f; font: 12px/15px Arial, Helvetica, sans-serif; - min-width:981px; + min-width: 981px; height: 100%; - position:relative; + position: relative; } -body.home{ +body.home { background: #e7e7e7; } @@ -25,7 +25,7 @@ a img { border: 0; } -a:hover { +a: hover { text-decoration: none; } @@ -34,29 +34,25 @@ input, textarea, select { vertical-align: middle; } -form,fieldset{ +form,fieldset { margin: 0; padding: 0; border-style: none; } - em { font-weight: bold; font-style: normal; } - h1, h2, h3, h4, h5, h6 { margin-top: 0px; } - h1 { font-size: 200%; } - h2 { font-size: 160%; } @@ -66,7 +62,6 @@ h3 { font-size: 130%; } - hr { border-width: 0px; color: #C3D9FF; @@ -74,7 +69,6 @@ hr { height: 1px; } - ul.menuBlocks { list-style-type: none; padding-left: 0px; @@ -83,18 +77,15 @@ ul.menuBlocks { margin-left: 0px; } - ul + ul, ul + ul.menuBlocks, ul + h1, ul + h2, ul + p { margin-top: 20px; } - .fixed { font-family: Fixed, Courier, monospace; font-size: 13px; } - div.warning { border: 2px solid #ff0000; padding: 10px 20px 10px 20px; @@ -120,13 +111,13 @@ div#container { height: 100%; margin-left: auto; margin-right: auto; - background:#f4f4f4; + background: #f4f4f4; font-size: 13px; } div#header { padding: 10px; - overflow:hidden; + overflow: hidden; background: #2f2f2f; border-bottom: 5px solid #A1CC33; text-align: center; @@ -137,9 +128,8 @@ div#system_info { text-align: right; } - div#main_body { - float:right; + float: right; width: 693px; background: #f4f4f4; padding-top: 20px; @@ -147,13 +137,11 @@ div#main_body { font-size: 13px; } - div.body_padded { padding-left: 20px; padding-right: 20px; } - div#main_menu { float: left; width: 200px; @@ -163,7 +151,6 @@ div#main_menu { padding-bottom: 10px; } - div#main_menu li { border-width: 1px; border-style: solid; @@ -173,40 +160,33 @@ div#main_menu li { background-color: #bebebe; } - div#main_menu li a { color: #000000; text-decoration: none; text-decoration: none; } - div#main_menu li.selected { border-color: #758DAE #758DAE #758DAE #758DAE; background-color: #99cc33; } - div#main_menu li.selected a { color: #F9F7ED; } - -div#main_menu li:hover { +div#main_menu li: hover { border-color: #D2D4D4; } - -div#main_menu li:hover a { +div#main_menu li: hover a { color: #F9F7ED; } - div#main_menu_padded { padding: 15px; } - div#footer { color: #999999; background: #2f2f2f; @@ -215,7 +195,6 @@ div#footer { border-top: 5px solid #A1CC33; } - input.popup_button { border-width: 1px; border-style: solid; @@ -226,7 +205,6 @@ input.popup_button { float: right; } - div.vulnerable_code_area { background-color: #f8fafa; border-width: 1px; @@ -253,12 +231,10 @@ div#idslog { background-color: #f8fafa; } - pre { color: red; } - div.submenu { border-bottom: 1px solid #000000; margin-bottom: 15px; @@ -266,18 +242,25 @@ div.submenu { font-size: 13px; } - span.submenu_item { padding: 0px 10px 0px 10px; } - span.submenu_item + span.submenu_item { border-left: 1px dashed #000000; font-size: 13px; } - span.selected { font-weight: bold; } + +span.success { + + color:green; +} + +span.failure { + color:red; + font-weight: bold; +} diff --git a/dvwa/css/source.css b/dvwa/css/source.css index 286618066..7d996c2f5 100644 --- a/dvwa/css/source.css +++ b/dvwa/css/source.css @@ -8,11 +8,9 @@ h1 { font-size: 25px; } - div#container { } - div#code { background-color: #ffffff; } diff --git a/dvwa/includes/dvwaPage.inc.php b/dvwa/includes/dvwaPage.inc.php index 021fe3f31..88ff699b0 100644 --- a/dvwa/includes/dvwaPage.inc.php +++ b/dvwa/includes/dvwaPage.inc.php @@ -8,24 +8,29 @@ session_start(); // Creates a 'Full Path Disclosure' vuln. // Include configs -require_once DVWA_WEB_PAGE_TO_ROOT.'config/config.inc.php'; +require_once DVWA_WEB_PAGE_TO_ROOT . 'config/config.inc.php'; require_once( 'dvwaPhpIds.inc.php' ); // Declare the $html variable -if(!isset( $html )) { +if( !isset( $html ) ) { $html = ""; } // Valid security levels $security_levels = array('low', 'medium', 'high', 'impossible'); -if(!isset( $_COOKIE[ 'security' ] ) || !in_array( $_COOKIE[ 'security' ], $security_levels ) ) { - // Set security cookie to impossible if no cookie exists - if( in_array( $_DVWA[ 'default_security_level' ], $security_levels) ) { +if( !isset( $_COOKIE[ 'security' ] ) || !in_array( $_COOKIE[ 'security' ], $security_levels ) ) { + // Set security cookie to impossible if no cookie exists + if( in_array( $_DVWA[ 'default_security_level' ], $security_levels) ) { dvwaSecurityLevelSet( $_DVWA[ 'default_security_level' ] ); - } - else { + } + else { dvwaSecurityLevelSet( 'impossible' ); } + + if( $_DVWA[ 'default_phpids_level' ] == 'enabled' ) + dvwaPhpIdsEnabledSet( true ); + else + dvwaPhpIdsEnabledSet( false ); } // DVWA version @@ -52,7 +57,7 @@ function &dvwaSessionGrab() { function dvwaPageStartup( $pActions ) { if( in_array( 'authenticated', $pActions ) ) { if( !dvwaIsLoggedIn()) { - dvwaRedirect( DVWA_WEB_PAGE_TO_ROOT.'login.php' ); + dvwaRedirect( DVWA_WEB_PAGE_TO_ROOT . 'login.php' ); } } @@ -112,12 +117,12 @@ function dvwaCurrentUser() { function &dvwaPageNewGrab() { $returnArray = array( - 'title' => 'Damn Vulnerable Web Application (DVWA) v'.dvwaVersionGet().'', + 'title' => 'Damn Vulnerable Web Application (DVWA) v' . dvwaVersionGet() . '', 'title_separator' => ' :: ', - 'body' => '', - 'page_id' => '', - 'help_button' => '', - 'source_button' => '', + 'body' => '', + 'page_id' => '', + 'help_button' => '', + 'source_button' => '', ); return $returnArray; } @@ -162,7 +167,7 @@ function dvwaMessagePop() { function messagesPopAllToHtml() { $messagesHtml = ''; - while( $message = dvwaMessagePop() ) { // TODO- sharpen! + while( $message = dvwaMessagePop() ) { // TODO- sharpen! $messagesHtml .= " "; } @@ -187,16 +192,16 @@ function dvwaHtmlEcho( $pPage ) { if( dvwaIsLoggedIn() ) { $menuBlocks[ 'vulnerabilities' ] = array(); - $menuBlocks[ 'vulnerabilities' ][] = array( 'id' => 'brute', 'name' => 'Brute Force', 'url' => 'vulnerabilities/brute/.' ); - $menuBlocks[ 'vulnerabilities' ][] = array( 'id' => 'exec', 'name' => 'Command Injection', 'url' => 'vulnerabilities/exec/.' ); - $menuBlocks[ 'vulnerabilities' ][] = array( 'id' => 'csrf', 'name' => 'CSRF', 'url' => 'vulnerabilities/csrf/.' ); + $menuBlocks[ 'vulnerabilities' ][] = array( 'id' => 'brute', 'name' => 'Brute Force', 'url' => 'vulnerabilities/brute/' ); + $menuBlocks[ 'vulnerabilities' ][] = array( 'id' => 'exec', 'name' => 'Command Injection', 'url' => 'vulnerabilities/exec/' ); + $menuBlocks[ 'vulnerabilities' ][] = array( 'id' => 'csrf', 'name' => 'CSRF', 'url' => 'vulnerabilities/csrf/' ); $menuBlocks[ 'vulnerabilities' ][] = array( 'id' => 'fi', 'name' => 'File Inclusion', 'url' => 'vulnerabilities/fi/.?page=include.php' ); - $menuBlocks[ 'vulnerabilities' ][] = array( 'id' => 'upload', 'name' => 'File Upload', 'url' => 'vulnerabilities/upload/.' ); - $menuBlocks[ 'vulnerabilities' ][] = array( 'id' => 'captcha', 'name' => 'Insecure CAPTCHA', 'url' => 'vulnerabilities/captcha/.' ); - $menuBlocks[ 'vulnerabilities' ][] = array( 'id' => 'sqli', 'name' => 'SQL Injection', 'url' => 'vulnerabilities/sqli/.' ); - $menuBlocks[ 'vulnerabilities' ][] = array( 'id' => 'sqli_blind', 'name' => 'SQL Injection (Blind)', 'url' => 'vulnerabilities/sqli_blind/.' ); - $menuBlocks[ 'vulnerabilities' ][] = array( 'id' => 'xss_r', 'name' => 'XSS (Reflected)', 'url' => 'vulnerabilities/xss_r/.' ); - $menuBlocks[ 'vulnerabilities' ][] = array( 'id' => 'xss_s', 'name' => 'XSS (Stored)', 'url' => 'vulnerabilities/xss_s/.' ); + $menuBlocks[ 'vulnerabilities' ][] = array( 'id' => 'upload', 'name' => 'File Upload', 'url' => 'vulnerabilities/upload/' ); + $menuBlocks[ 'vulnerabilities' ][] = array( 'id' => 'captcha', 'name' => 'Insecure CAPTCHA', 'url' => 'vulnerabilities/captcha/' ); + $menuBlocks[ 'vulnerabilities' ][] = array( 'id' => 'sqli', 'name' => 'SQL Injection', 'url' => 'vulnerabilities/sqli/' ); + $menuBlocks[ 'vulnerabilities' ][] = array( 'id' => 'sqli_blind', 'name' => 'SQL Injection (Blind)', 'url' => 'vulnerabilities/sqli_blind/' ); + $menuBlocks[ 'vulnerabilities' ][] = array( 'id' => 'xss_r', 'name' => 'XSS (Reflected)', 'url' => 'vulnerabilities/xss_r/' ); + $menuBlocks[ 'vulnerabilities' ][] = array( 'id' => 'xss_s', 'name' => 'XSS (Stored)', 'url' => 'vulnerabilities/xss_s/' ); } $menuBlocks[ 'meta' ] = array(); @@ -223,7 +228,7 @@ function dvwaHtmlEcho( $pPage ) { $menuHtml .= " "; } - // Get security cookie -- + // Get security cookie -- $securityLevelHtml = ''; switch( dvwaSecurityLevelGet() ) { case 'low': @@ -239,10 +244,10 @@ function dvwaHtmlEcho( $pPage ) { $securityLevelHtml = 'impossible'; break; } - // -- END (security cookie) + // -- END (security cookie) - $phpIdsHtml = 'PHPIDS: '.( dvwaPhpIdsIsEnabled() ? 'enabled' : 'disabled' ); - $userInfoHtml = 'Username: '.( dvwaCurrentUser() ); + $phpIdsHtml = 'PHPIDS: ' . ( dvwaPhpIdsIsEnabled() ? 'enabled' : 'disabled' ); + $userInfoHtml = 'Username: ' . ( dvwaCurrentUser() ); $messagesHtml = messagesPopAllToHtml(); if( $messagesHtml ) { @@ -253,16 +258,16 @@ function dvwaHtmlEcho( $pPage ) { if( dvwaIsLoggedIn() ) $systemInfoHtml = "Unable to connect to the database.-// Click here to setup the database. +// +//
'.$DBMS_errorFunc.'
Unable to connect to the database.+// Click here to setup the database. //
' . $DBMS_errorFunc . '
". dvwaReadIdsLog() ."
+" . dvwaReadIdsLog() . "
Damn Vulnerable Web Application is damn vulnerable! Do not upload it to your hosting provider's public html folder or any Internet facing servers, as they will be compromised. It is recommend using a virtual machine (such as ".dvwaExternalLinkUrlGet( 'https://www.virtualbox.org/','VirtualBox' )." or ".dvwaExternalLinkUrlGet( 'https://www.vmware.com/','VMware' )."), which is set to NAT networking mode. Inside a guest machine, you can downloading and install ".dvwaExternalLinkUrlGet( 'https://www.apachefriends.org/en/xampp.html','XAMPP' )." for the web server and database.
+Damn Vulnerable Web Application is damn vulnerable! Do not upload it to your hosting provider's public html folder or any Internet facing servers, as they will be compromised. It is recommend using a virtual machine (such as " . dvwaExternalLinkUrlGet( 'https://www.virtualbox.org/','VirtualBox' ) . " or " . dvwaExternalLinkUrlGet( 'https://www.vmware.com/','VMware' ) . "), which is set to NAT networking mode. Inside a guest machine, you can downloading and install " . dvwaExternalLinkUrlGet( 'https://www.apachefriends.org/en/xampp.html','XAMPP' ) . " for the web server and database.
We do not take responsibility for the way in which any one uses this application (DVWA). We have made the purposes of the application clear and it should not be used maliciously. We have given warnings and taken measures to prevent users from installing DVWA on to live web servers. If your web server is compromised via an installation of DVWA it is not our responsibility it is the responsibility of the person/s who uploaded and installed it.
@@ -37,7 +37,7 @@DVWA aims to cover the most commonly seen vulnerabilities found in today's web applications. However there are plenty of other issues with web applications. Should you wish to explore any additional attack vectors, or want more difficult challenges, you may wish to look into the following other projects: