Phpsandbox
السلام عليكم ورحمة الله تعالى و بركاته
المهم حل تحدي phpsandbox & phpsandbox2
نبدا التحدي https://phpsandbox.eagle-jump.org/
عند الذهاب الى
https://phpsandbox.eagle-jump.org/?eval=print(%27strlen%20should%20be%20lesser%20than%2050%27);
كما نرى انه يجيب ان يكون طول السلسلة النصية اقل من 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
الان نقوم بالتالي
تمام قام باضهار لنا phpinfo
الان نرى disable function
اذا يمكننا استعمال
system scandir …. etc
اذا يمكننا استعمال system
نجرب التالي
<?php
echo "~".urlencode(~"system").";";
echo "\n";
?>
$a=~%8C%86%8C%8B%9A%92;$a(‘ls’);
تمام انهينا التحدي
الان ناتي للتحدي الثاني
https://phpsandbox2.eagle-jump.org/
الان نرى انه strlen يحب ان يكون اقل من 0x20
0x20 وهي 32 ديسيمال
بعد تجربة بعض الاشياء جربت التالي
https://www.php.net/manual/en/function.scandir.php
نرى الان مع التحدي
نغير الرقم
تمام طلع لنا flag_ff6e7db44fc58cb71109551bac71669d.php index.php
يبدو ان الفلاق موجود في
flag_ff6e7db44fc58cb71109551bac71669d.php
نحاول نرى الطول
بعد عدة محاولات لقراءة الملف جربت التالي
هنا استعملت
https://www.php.net/manual/en/function.assert.php
https://www.php.net/manual/en/function.var-dump.php
يبدو ان كل شيء على ما يرام نجرب نقرا الفلاق الان
https://www.php.net/manual/en/function.readfile.php
نرى السورس الخاص كود
الى هنا انتهينا