- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
public function comments()
{
$a = new common_articles($this);
switch ($this->prms[3]) {
case 'search':
{
break;
}
default:
{
$where = array();
$itemid = 0;
// и еще полторы сотни строк кода
}
}
}
Здесь говно в том, что пэхапэшный модуль imap использует дерьмовую библиотеку imap-2007f, которая за каким-то хреном для установления соединения вызывает бинарник rsh или ssh. Это примерно как system("pause"); в сишной лабе.
Вот тут всё по-русски расписано:
https://antichat.com/threads/463395/#post-4254681
А если серьёзно, то почему нет? Передавать можно всё, что поддерживается языком: целых питухов, плавающих питухов, булевых питухов, строки, ассоциативные массивы, объекты, ресурсы, NULL и даже замыкания (колбек-функции). Причём язык принципиально динамический и даже существуют функции, которые могут принять аргумент любого типа, а на входе узнать тип и решить, что с ним делать.
Что же касается самого «PHP», то system, exec, popen, proc_open принимают строку, а pcntl_exec принимает массив аргументов.
https://en.wikipedia.org/wiki/UW_IMAP
Одна из трёх самых популярных (другие две –— Cyrus IMAP и Courier IMAP).
В 2008-м году её перестали разрабатывать и Debian её задепрекейтил.
Однако, один из авторов злополучной библиотеки UW IMAP выпустил форк под названием Panda IMAP.
>> Я так понимаю, что большинство ее не пользует?
Ага, обычно используют другие функции, которые тупо принимают строку. Но из пэхапэшных скриптов вообще редко вызывают внешние программы. Хотя sendmail, например, вызывают, чтобы отправить письмо со ссылкой для активации профиля на форуме.
https://www.google.com/search?q=UW+IMAP+vulnerability
>> Пробелы обходим с помощью $IFS$(), а слеши с помощью echo base64decodedstring==|base64 -d| bash
Это как раз, чтобы обмануть самодельный парсинг внутри imap-2007f.
Открываем произвольный makefile, а там:
Верните мне мой 1987-й!
https://tools.ietf.org/html/rfc1730
IMAP2 –— в 1988:
https://tools.ietf.org/html/rfc1064
Именно поэтому я за 1987.
Только кокококонкретно в этом примере пэхапэшные функции вообще никак не используются. Всё говно полностью в сишной библиотеке imap. Если ты её подключишь из другого ЯП, то получишь точно такой же багор.
https://en.wikipedia.org/wiki/UW_IMAP
As of 2003, UW IMAP was among the three most popular free software IMAP server packages, the other two being Cyrus IMAP and Courier IMAP.[11][12][13] As of 2005, by which point its codebase had undergone extensive rewriting,[6] it was among the top two, the other being Cyrus IMAP.[14][15]
In May 2008, the University of Washington terminated development of UW IMAP.[2]
On 4 August 2008, staff at the University of Washington who had been involved in developing UW IMAP, Pine, and Alpine,[citation needed] announced that they would "shift our effort from direct development into more of a consultation and coordination role to help integrate contributions from the community,"[16] in the wake of layoffs at the University of Washington's technology division.[17]
c. January - August 2009, the maintainers of Debian GNU/Linux, a major downstream distributor of UW IMAP, began to retire their UW IMAP packages.[18][19]
In September 2009,[citation needed] Mark Crispin, the principal author of UW IMAP, announced a fork called Panda IMAP.[2] Crispin passed away in late 2012.[20]
At least one UW IMAP enthusiast maintains a public source code repository containing the UW IMAP and Panda IMAP commit history from the start of the project until Crispin's final release.[21]
Угадайте, что делает код:
IMAP4(host) устанавливает соединение через сокет, а IMAP4_stream(stream_command) –— через запуск внешней программы.
The shell argument (which defaults to False) specifies whether to use the shell as the program to execute. If shell is True, it is recommended to pass args as a string rather than as a sequence.
On Unix with shell=True, the shell defaults to /bin/sh. If args is a string, the string specifies the command to execute through the shell. This means that the string must be formatted exactly as it would be when typed at the shell prompt. This includes, for example, quoting or backslash escaping filenames with spaces in them. If args is a sequence, the first item specifies the command string, and any additional items will be treated as additional arguments to the shell itself. That is to say, Popen does the equivalent of:
Popen(['/bin/sh', '-c', args[0], args[1], ...])
On Windows with shell=True, the COMSPEC environment variable specifies the default shell. The only time you need to specify shell=True on Windows is when the command you wish to execute is built into the shell (e.g. dir or copy). You do not need shell=True to run a batch file or console-based executable.
Warning
Passing shell=True can be a security hazard if combined with untrusted input.
https://docs.python.org/2/library/subprocess.html#subprocess.Popen
https://docs.python.org/3/library/subprocess.html#subprocess.Popen
https://ru.wikipedia.org/wiki/4DOS
Ну и на всякий случай, чтобы путь узнать, вдруг у тебя мастдайка на диск D: установлена.
https://www.google.com/search?tbm=isch&q="светозар+разбойников"
Специальный тухлый сыр,
Прошлогодний вялый лук,
Всё на булочке с кунжутом.
1. С моей зарплатой (а точнее с ее полным отсутствием!) я никогда не накоплю на билет;
2. В медшараге учатся камерунцы - живут в общаге, но я с ними не буду, ибо в общагу посторонних не пускают;
3. мне не нравятся чернокожие (скорее даже отвращение вызывают). Я конечно не ку-клукс-клан, но бля. Зачем ебаться с теми, кто тебе не по душе, когда можно выбрать любого другого? Что за принуждение?
Говно в том, что библиотека imap для установления соединения вызывает внешнюю программу, а у неё есть ключик -oProxyCommand, который в свою очередь может запустить произвольную внешнюю программу.
Чтобы запудрить мозги библиотеке imap (чтобы она сразу не смогла разделить параметры по пробелам), вместо пробела воткнули $IFS$(). Оболочка (sh/bash) эту конструкцию заменит на пробел и цель злоумышленника будет достигнута.
Кстати, нужно искать, в каком ещё ПО используется эта самая библиотека imap-2007. Может ещё где-то бомбануть.
В чём тогда разница?
А если серьёзно, то как нубу объяснить разницу между системами? Или вообще как объяснить, зачем нужна ОС?
заебал!