Phpsandbox

Mon, Jan 1, 0001 1-minute read

السلام عليكم ورحمة الله تعالى و بركاته

المهم حل تحدي phpsandbox & phpsandbox2

نبدا التحدي https://phpsandbox.eagle-jump.org/

عند الذهاب الى

https://phpsandbox.eagle-jump.org/?eval=print(%27strlen%20should%20be%20lesser%20than%2050%27);

Images

كما نرى انه يجيب ان يكون طول السلسلة النصية اقل من 50

يعني طول ما سوف نكتب اقل من 50

https://www.php.net/manual/en/function.strlen.php

للقراءة

https://www.exploit-db.com/papers/13694

https://xerosecurity.com/wordpress/exploiting-php-eval-functions/

https://hydrasky.com/network-security/php-code-injection/

ايضا

https://www.programmersought.com/article/7881105401/

https://securityonline.info/bypass-waf-php-webshell-without-numbers-letters/

المهم

عملت سكربت صغير كالتالي

https://www.php.net/manual/en/language.operators.bitwise.php

bitwise operator

Images

الان نقوم بالتالي

Images

تمام قام باضهار لنا phpinfo

الان نرى disable function

اذا يمكننا استعمال

system scandir …. etc

Images

اذا يمكننا استعمال system

نجرب التالي

<?php
echo "~".urlencode(~"system").";";
echo "\n";
?>

$a=~%8C%86%8C%8B%9A%92;$a(‘ls’);

Images

تمام انهينا التحدي

الان ناتي للتحدي الثاني

https://phpsandbox2.eagle-jump.org/

Images

الان نرى انه strlen يحب ان يكون اقل من 0x20

0x20 وهي 32 ديسيمال

Images

بعد تجربة بعض الاشياء جربت التالي

Images

https://www.php.net/manual/en/function.scandir.php

Images

نرى الان مع التحدي

Images

نغير الرقم

Images Images

تمام طلع لنا flag_ff6e7db44fc58cb71109551bac71669d.php index.php

يبدو ان الفلاق موجود في

flag_ff6e7db44fc58cb71109551bac71669d.php

نحاول نرى الطول Images

بعد عدة محاولات لقراءة الملف جربت التالي

Images

هنا استعملت

https://www.php.net/manual/en/function.assert.php

https://www.php.net/manual/en/function.var-dump.php

Images

يبدو ان كل شيء على ما يرام نجرب نقرا الفلاق الان

https://www.php.net/manual/en/function.readfile.php

Images

نرى السورس الخاص كود

Images

الى هنا انتهينا