Mi da questo errore e non lo trovo: Parse error: parse error, unexpected '}' in C:\Programmi\EasyPHP 2.0b1\www\beef\submit_config.php on line 50
<?
include ('pw.php');
$cache_dir = getcwd() . '/cache';
$config_file_dir = getcwd() . '/include';
$config_file = $config_file_dir . '/config.inc.php';
if ( strcmp( $_GET['passwd'], $passwd) == 0 )
{
if (!function_exists('file_put_contents')) {
define('FILE_APPEND', 1);
function file_put_contents($n, $d, $flag = false) {
$mode = ($flag == FILE_APPEND || strtoupper($flag) == 'FILE_APPEND') ? 'a' : 'w';
$f = @fopen($n, $mode);
if ($f === false) {
return 0;
} else {
if (is_array($d)) $d = implode($d);
$bytes_written = fwrite($f, $d);
fclose($f);
return $bytes_written;
}
}
}
$beef_domain = "define('BEEF_DOMAIN', 'CONFIG');\n";
$base_dir = "define('BASE_DIR', 'CONFIG');\n";
$config = $_GET["config"];
if(empty($config)) {
echo "ERROR: no config passed";
exit(0);
}
$base_dir = preg_replace('/CONFIG/', getcwd() . '/', $base_dir);
$beef_domain = preg_replace('/CONFIG/', $config, $beef_domain);
// check permissions on the include and cache
if((is_writable($config_file) || is_writable($config_file_dir)) && is_writable($cache_dir)) {
$rtn = file_put_contents($config_file, "<?\n" . $base_dir . $beef_domain . "?>\n");
?>
<h2>BeEF Successfuly Configured</h2>
<form name="configform">
<input class="button" type="button" value="Finished" onClick="javascript:location.href='<? echo $config ?>/ui'"/>
</form>
<?php
} else {
?>
<h2>Error</h2>
Permissions on the <?php printf(getcwd() . '/include' ) ?> directory are incorrect. Running the
following command will corrent the problem:
# chown <?php printf(get_current_user() . " " . getcwd() . '/include' ) ?>
# chown -R <?php printf(get_current_user() . " " . getcwd() . '/cache' ) ?>
<?
}
} else { // the password was incorrect
?>
<h2>Password</h2>
Incorrect BeEF password, please try again.
<?
}
?>