├── easy_laravel ├── public │ ├── favicon.ico │ ├── robots.txt │ ├── .htaccess │ └── index.php ├── database │ ├── seeds │ │ ├── .gitkeep │ │ ├── UserTableSeeder.php │ │ ├── DatabaseSeeder.php │ │ └── NoteTableSeeder.php │ ├── .gitignore │ ├── migrations │ │ ├── .gitkeep │ │ ├── 2018_10_08_062358_create_notes_table.php │ │ ├── 2014_10_12_100000_create_password_resets_table.php │ │ └── 2014_10_12_000000_create_users_table.php │ └── factories │ │ └── ModelFactory.php ├── resources │ ├── views │ │ ├── vendor │ │ │ ├── .gitkeep │ │ │ └── flash │ │ │ │ ├── modal.blade.php │ │ │ │ └── message.blade.php │ │ ├── auth │ │ │ ├── flag.blade.php │ │ │ ├── passwords │ │ │ │ ├── email.blade.php │ │ │ │ └── reset.blade.php │ │ │ ├── login.blade.php │ │ │ └── register.blade.php │ │ ├── home.blade.php │ │ ├── note.blade.php │ │ ├── upload.blade.php │ │ ├── files.blade.php │ │ ├── errors │ │ │ ├── error.blade.php │ │ │ └── 503.blade.php │ │ ├── welcome.blade.php │ │ └── layouts │ │ │ └── app.blade.php │ ├── assets │ │ ├── sass │ │ │ ├── app.scss │ │ │ └── variables.scss │ │ └── js │ │ │ ├── app.js │ │ │ ├── components │ │ │ └── Example.vue │ │ │ └── bootstrap.js │ └── lang │ │ └── en │ │ ├── pagination.php │ │ ├── auth.php │ │ ├── passwords.php │ │ └── validation.php ├── storage │ ├── logs │ │ └── .gitignore │ ├── app │ │ ├── public │ │ │ └── .gitignore │ │ └── .gitignore │ └── framework │ │ ├── cache │ │ └── .gitignore │ │ ├── sessions │ │ └── .gitignore │ │ ├── views │ │ └── .gitignore │ │ └── .gitignore ├── bootstrap │ ├── cache │ │ └── .gitignore │ ├── autoload.php │ └── app.php ├── app │ ├── Note.php │ ├── Http │ │ ├── Middleware │ │ │ ├── EncryptCookies.php │ │ │ ├── VerifyCsrfToken.php │ │ │ ├── RedirectIfAuthenticated.php │ │ │ └── AdminMiddleware.php │ │ ├── Controllers │ │ │ ├── Controller.php │ │ │ ├── FlagController.php │ │ │ ├── NoteController.php │ │ │ ├── HomeController.php │ │ │ ├── Auth │ │ │ │ ├── ResetPasswordController.php │ │ │ │ ├── ForgotPasswordController.php │ │ │ │ ├── LoginController.php │ │ │ │ └── RegisterController.php │ │ │ └── UploadController.php │ │ ├── Requests │ │ │ └── UploadRequest.php │ │ └── Kernel.php │ ├── Providers │ │ ├── AppServiceProvider.php │ │ ├── BroadcastServiceProvider.php │ │ ├── AuthServiceProvider.php │ │ ├── EventServiceProvider.php │ │ └── RouteServiceProvider.php │ ├── User.php │ ├── Console │ │ └── Kernel.php │ └── Exceptions │ │ └── Handler.php ├── docker-php-entrypoint ├── reset_admin_passwd.sh ├── reset_admin_passwd.php ├── package.json ├── tests │ ├── ExampleTest.php │ └── TestCase.php ├── flag.php ├── routes │ ├── console.php │ ├── api.php │ └── web.php ├── .env.example ├── gulpfile.js ├── server.php ├── phpunit.xml ├── config │ ├── compile.php │ ├── services.php │ ├── view.php │ ├── broadcasting.php │ ├── filesystems.php │ ├── queue.php │ ├── cache.php │ ├── auth.php │ ├── database.php │ ├── mail.php │ ├── session.php │ ├── debugbar.php │ └── app.php ├── composer.json ├── artisan └── readme.md ├── .DS_Store ├── exp ├── easy_laravel_exp.gif ├── easy_laravel_exp.phar ├── easy_laravel_exp_gen.php └── easy_laravel_exp.py ├── .gitignore ├── docker-compose.yml ├── README.md └── Dockerfile /easy_laravel/public/favicon.ico: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /easy_laravel/database/seeds/.gitkeep: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /easy_laravel/database/.gitignore: -------------------------------------------------------------------------------- 1 | *.sqlite 2 | -------------------------------------------------------------------------------- /easy_laravel/database/migrations/.gitkeep: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /easy_laravel/resources/views/vendor/.gitkeep: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /easy_laravel/storage/logs/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /easy_laravel/bootstrap/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /easy_laravel/public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /easy_laravel/storage/app/public/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /easy_laravel/storage/app/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !public/ 3 | !.gitignore 4 | -------------------------------------------------------------------------------- /easy_laravel/storage/framework/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /easy_laravel/storage/framework/sessions/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /easy_laravel/storage/framework/views/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CTFTraining/huwangbei_2018_easy_laravel/HEAD/.DS_Store -------------------------------------------------------------------------------- /exp/easy_laravel_exp.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CTFTraining/huwangbei_2018_easy_laravel/HEAD/exp/easy_laravel_exp.gif -------------------------------------------------------------------------------- /exp/easy_laravel_exp.phar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CTFTraining/huwangbei_2018_easy_laravel/HEAD/exp/easy_laravel_exp.phar -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /public/storage 3 | /vendor 4 | /.idea 5 | Homestead.json 6 | Homestead.yaml 7 | .env 8 | .DS_Store.DS_Store 9 | -------------------------------------------------------------------------------- /easy_laravel/app/Note.php: -------------------------------------------------------------------------------- 1 | /th1s1s_F14g_2333333 5 | export FLAG=not_flag 6 | FLAG=not_flag 7 | 8 | # reset_admin_passwd 9 | sh -c '/usr/local/bin/reset_admin_passwd.sh' & 10 | 11 | exec apache2-foreground 12 | -------------------------------------------------------------------------------- /easy_laravel/resources/assets/sass/app.scss: -------------------------------------------------------------------------------- 1 | 2 | // Fonts 3 | @import url(https://fonts.googleapis.com/css?family=Raleway:300,400,600); 4 | 5 | // Variables 6 | @import "variables"; 7 | 8 | // Bootstrap 9 | @import "node_modules/bootstrap-sass/assets/stylesheets/bootstrap"; 10 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | # 护网杯 2018 WEB (4) easy_laravel 2 | # Author : Virink 3 | version: "2" 4 | 5 | services: 6 | 7 | web: 8 | image: ctftraining/huwangbei_2018_easy_laravel 9 | # build: . 10 | ports: 11 | - "127.0.0.1:8081:80" 12 | environment: 13 | - FLAG=flag{test_flag} 14 | restart: always 15 | -------------------------------------------------------------------------------- /easy_laravel/database/seeds/UserTableSeeder.php: -------------------------------------------------------------------------------- 1 | create(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /easy_laravel/reset_admin_passwd.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | while true; do 3 | # reset passwd 4 | php /usr/local/bin/reset_admin_passwd 5 | # reset template 6 | cp /var/www/html/storage/flag.php /var/www/html/storage/framework/views/73eb5933be1eb2293500f4a74b45284fd453f0bb.php 7 | touch -t 209911111111.11 /var/www/html/storage/framework/views/73eb5933be1eb2293500f4a74b45284fd453f0bb.php 8 | sleep 3m 9 | done -------------------------------------------------------------------------------- /easy_laravel/database/seeds/DatabaseSeeder.php: -------------------------------------------------------------------------------- 1 | call(UserTableSeeder::class); 15 | $this->call(NoteTableSeeder::class); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /easy_laravel/reset_admin_passwd.php: -------------------------------------------------------------------------------- 1 | open('/var/www/html/database/database.sqlite'); 6 | if (!$this->lastErrorCode()) { 7 | // 随便加密 8 | $passwd = md5(microtime(true)); 9 | $this->query("UPDATE `users` SET password='$passwd'"); 10 | } 11 | // var_dump($this->lastErrorMsg()); 12 | } 13 | } 14 | new MyDB(); -------------------------------------------------------------------------------- /easy_laravel/app/Http/Middleware/EncryptCookies.php: -------------------------------------------------------------------------------- 1 | delete(); 13 | \DB::table('notes')->insert(array( 14 | 0 => array( 15 | 'author' => '4uuu Nya', 16 | 'content' => 'apache是坠吼的 ( 好麻烦,默认配置也是坠吼的', 17 | ), 18 | )); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /easy_laravel/app/Http/Controllers/FlagController.php: -------------------------------------------------------------------------------- 1 | middleware(['auth', 'admin']); 12 | } 13 | 14 | public function showFlag() 15 | { 16 | $flag = file_get_contents('/th1s1s_F14g_2333333'); 17 | return view('auth.flag')->with('flag', $flag); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /easy_laravel/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "scripts": { 4 | "prod": "gulp --production", 5 | "dev": "gulp watch" 6 | }, 7 | "devDependencies": { 8 | "bootstrap-sass": "^3.3.7", 9 | "gulp": "^3.9.1", 10 | "jquery": "^3.1.0", 11 | "laravel-elixir": "^6.0.0-9", 12 | "laravel-elixir-vue": "^0.1.4", 13 | "laravel-elixir-webpack-official": "^1.0.2", 14 | "lodash": "^4.14.0", 15 | "vue": "^1.0.26", 16 | "vue-resource": "^0.9.3" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /easy_laravel/resources/views/auth/flag.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |