403Webshell
Server IP : 202.61.199.114  /  Your IP : 216.73.217.139
Web Server : nginx/1.22.1
System : Linux de.arni-solutions.de 6.1.0-49-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.174-1 (2026-05-26) x86_64
User : web20 ( 1018)
PHP Version : 8.4.23
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /tmp/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /tmp/smi_mkconfig.php
<?php
// Baut wp-config.php aus dem Sample. Args: <webroot> <dbpass>
$web = $argv[1];
$pass = $argv[2];

$sample = file_get_contents("$web/wp-config-sample.php");
$c = $sample;

// DB-Zugang
$c = str_replace('database_name_here', 'smi_web', $c);
$c = str_replace('username_here', 'smi_safety_user', $c);
$c = str_replace('password_here', $pass, $c);
$c = str_replace('localhost', '127.0.0.1', $c);

// Table-Prefix (beide Quote-Varianten abdecken)
$c = preg_replace('/\$table_prefix\s*=\s*[\'"]wp_[\'"]\s*;/', '$table_prefix = \'smi_\';', $c);

// Salts lokal erzeugen (kein externer Aufruf)
$keys = ['AUTH_KEY','SECURE_AUTH_KEY','LOGGED_IN_KEY','NONCE_KEY','AUTH_SALT','SECURE_AUTH_SALT','LOGGED_IN_SALT','NONCE_SALT'];
$chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#%^&*()-_=+[]{}';
$salt = '';
foreach ($keys as $k) {
    $v = '';
    for ($i = 0; $i < 64; $i++) { $v .= $chars[random_int(0, strlen($chars) - 1)]; }
    $salt .= "define('$k', '$v');\n";
}

// vorhandenen Platzhalter-Salt-Block entfernen und ersetzen
$c = preg_replace('/define\(\s*[\'"]AUTH_KEY[\'"].*?NONCE_SALT[\'"].*?\);\s*/s', '', $c);
$c = str_replace('/**#@-*/', $salt . "/**#@-*/", $c);

// Härtung + dynamische URLs
$hard = "\n/* --- SafeMyIdent Konfiguration & Härtung --- */\n"
  . "if (!defined('WP_HOME')) {\n"
  . "    \$smi_scheme = (isset(\$_SERVER['HTTPS']) && \$_SERVER['HTTPS'] !== 'off') ? 'https' : 'http';\n"
  . "    \$smi_host = \$_SERVER['HTTP_HOST'] ?? 'safemyident.de';\n"
  . "    define('WP_HOME', \$smi_scheme . '://' . \$smi_host);\n"
  . "    define('WP_SITEURL', WP_HOME);\n"
  . "}\n"
  . "define('DISALLOW_FILE_EDIT', true);\n"
  . "define('WP_POST_REVISIONS', 5);\n"
  . "define('EMPTY_TRASH_DAYS', 14);\n"
  . "define('WP_AUTO_UPDATE_CORE', 'minor');\n";

// vor "stop editing" einfügen (EN + DE Sample)
if (strpos($c, "That's all, stop editing") !== false) {
    $c = preg_replace("/(\/\* That's all, stop editing)/", $hard . "\n$1", $c, 1);
} elseif (strpos($c, "Schluss mit dem Bearbeiten") !== false) {
    $c = preg_replace("/(\/\* .*Schluss mit dem Bearbeiten)/u", $hard . "\n$1", $c, 1);
} else {
    // Fallback: vor require ABSPATH
    $c = str_replace("require_once", $hard . "\nrequire_once", $c);
}

file_put_contents("$web/wp-config.php", $c);
echo "wp-config.php geschrieben (" . strlen($c) . " bytes)\n";

Youez - 2016 - github.com/yon3zu
LinuXploit