Cyber Anakins Lightsaber - A Minishell-based backdoor
<?php
require("design.php");
require("contacts.php");
session_start();
TOP(-1);
LEFTCOLUMN();
CHANNELS();
MAINCOLUMN();
?>
<style>
.small { font-size:12px; }
</style>
<h1>Каких книг не хватает в нашей библиотеке?</h1>
<form onsubmit="doSubmit(event)">
<center>
<table>
<tr>
<td colspan=2>Выберите Вашу библиотеку:<br>
<select id=departmentComboBox>
<option value=0></option>
<?php
$filial = isset($_COOKIE['filial']) ? intval($_COOKIE['filial']) : 0;
foreach($GLOBALS['filials'] as $id=>$name)
{
if ($id==-1 || $id == 100) continue;
$bf_id = $GLOBALS['filialContacts'][$id]['bf_id'];
$sel = $id == $filial ? " selected": "";
print "<option value=$id$sel data-bf=$bf_id>"._html_($name)."</option>\n";
}
?>
</select>
<br><br>
</td>
</tr>
<tr>
<td align=right valign=top>Название книги:</td>
<td align=center><input id=nameEditor style='width:100%'>
<div class=small>Можно не заполнять, а указать только автора<br><br></div>
</td>
</tr>
<tr>
<td align=right valign=top>Автор:</td>
<td align=center><input id=authorEditor style='width:100%'>
<div class=small>Фамилия и инициалы. Если у книги несколько авторов, перечилите через запятую<br><br></div>
</td>
</tr>
<tr>
<td align=right valign=top>Комментарии:<div class=small>(не обязательно)</div></td>
<td><textarea id=commentEditor rows=3 style='width:100%'></textarea></td>
</tr>
</table>
<br>
<input type=submit value="Отправить" class=btn id=sendBtn>
</form>
<script>
function setCookie(name,value,days)
{
if (!days) days = 3560;
var expires = "";
if (days)
{
var date = new Date();
date.setTime(date.getTime() + (days*24*60*60*1000));
expires = "; expires=" + date.toUTCString();
}
document.cookie = name + "=" + (value || "") + expires + "; path=/";
}
function doSubmit(e)
{
e.preventDefault();
var sendBtn = document.getElementById('sendBtn');
var departmentComboBox = document.getElementById('departmentComboBox');
var nameEditor = document.getElementById('nameEditor');
var authorEditor = document.getElementById('authorEditor');
var commentEditor = document.getElementById('commentEditor');
var department = departmentComboBox.options[departmentComboBox.selectedIndex].value;
if (department==0)
{
errorBox("Укажите Вашу библиотеку!",
function()
{
departmentComboBox.focus();
});
return;
}
bf = departmentComboBox.options[departmentComboBox.selectedIndex].dataset.bf;
var name = nameEditor.value.trim();
var authors = authorEditor.value.trim();
if (name == '' && authors=='')
{
errorBox("Укажите либо название, либо автора (либо и то и другое)!",
function() { nameEditor.focus(); });
return;
}
var post = 'action=bookRequests:put';
post+='&department='+encodeURIComponent(bf);
post+='&name='+encodeURIComponent(name);
post+='&authors='+encodeURIComponent(authors);
post+='&comment='+encodeURIComponent(commentEditor.value.trim());
setCookie('filial',department,10000);
sendBtn.disabled = true;
function send2()
{
sendXHR('https://biblio-fond.ru/api.php',post,
function(response)
{
console.log(response);
sendBtn.disabled = false;
authorEditor.value = '';
nameEditor.value = '';
commentEditor.value='';
messageBox("Спасибо. Ваше пожелание отправлено. Мы постараемся включить эту книгу в ближайшую закупку!", "Пожелание");
},
function(error)
{
sendBtn.disabled = false;
if (error.indexOf("иноагент")>=0 || error.indexOf("экстремист")>=0)
yesNoDialog(error + " Заказать книгу в любом случае?", "Предупреждение",
function()
{
post+='&ignore=1';
send2();
});
else
errorBox(error);
});
}
send2();
}
</script>
<?php
MIDDLECOLUMN2();
print "<center><table><tr><td>";
ACTUALLINKS('actualLinksH');
print "</tr></td></table></center>";
FAQ();
MIDDLECOLUMN();
CHANNELS("channelBlockH");
RIGHTCOLUMN();
ACTUALLINKS();
FAQ();
?>
<?php BOTTOM(); ?>
May the force be with you, always.