Example #1
0
dvwaPageStartup(array('authenticated', 'phpids'));
$page = dvwaPageNewGrab();
$page['title'] .= $page['title_separator'] . 'DVWA Security';
$page['page_id'] = 'security';
$securityHtml = '';
if (isset($_POST['seclev_submit'])) {
    $securityLevel = 'high';
    switch ($_POST['security']) {
        case 'low':
            $securityLevel = 'low';
            break;
        case 'medium':
            $securityLevel = 'medium';
            break;
    }
    dvwaSecurityLevelSet($securityLevel);
    dvwaMessagePush("Security level set to {$securityLevel}");
    dvwaPageReload();
}
if (isset($_GET['phpids'])) {
    switch ($_GET['phpids']) {
        case 'on':
            dvwaPhpIdsEnabledSet(true);
            dvwaMessagePush("PHPIDS is now enabled");
            break;
        case 'off':
            dvwaPhpIdsEnabledSet(false);
            dvwaMessagePush("PHPIDS is now disabled");
            break;
    }
    dvwaPageReload();
Example #2
0
// Creates a 'Full Path Disclosure' vuln.
// Include configs
require_once DVWA_WEB_PAGE_TO_ROOT . 'config/config.inc.php';
require_once 'dvwaPhpIds.inc.php';
// Declare the $html variable
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)) {
        dvwaSecurityLevelSet($_DVWA['default_security_level']);
    } else {
        dvwaSecurityLevelSet('impossible');
    }
    if ($_DVWA['default_phpids_level'] == 'enabled') {
        dvwaPhpIdsEnabledSet(true);
    } else {
        dvwaPhpIdsEnabledSet(false);
    }
}
// DVWA version
function dvwaVersionGet()
{
    return '1.10 *Development*';
}
// DVWA release date
function dvwaReleaseDateGet()
{
Example #3
0
// Creates a 'Full Path Disclosure' vuln.
// Include configs
require_once DVWA_WEB_PAGE_TO_ROOT . 'config/config.inc.php';
require_once 'dvwaPhpIds.inc.php';
// Declare the $html variable
if (!isset($html)) {
    $html = "";
}
// Valid security levels
$security_levels = array('low', 'medium', 'high');
if (!isset($_COOKIE['security']) || !in_array($_COOKIE['security'], $security_levels)) {
    // Set security cookie to high if no cookie exists
    if (in_array($_DVWA['default_security_level'], $security_levels)) {
        dvwaSecurityLevelSet($_DVWA['default_security_level']);
    } else {
        dvwaSecurityLevelSet('high');
    }
}
// DVWA version
function dvwaVersionGet()
{
    return '1.8';
}
// DVWA release date
function dvwaReleaseDateGet()
{
    return '11/01/2011';
}
// Start session functions --
function &dvwaSessionGrab()
{