Commit 47150852 authored by Jona Löffler's avatar Jona Löffler
Browse files


parent 64e5db36
<p align="center"><a href="" target="_blank"><img src="" width="400"></a></p>
<p align="center">
<a href=""><img src="" alt="Build Status"></a>
<a href=""><img src="" alt="Total Downloads"></a>
<a href=""><img src="" alt="Latest Stable Version"></a>
<a href=""><img src="" alt="License"></a>
## About Laravel
Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as:
- [Simple, fast routing engine](
- [Powerful dependency injection container](
- Multiple back-ends for [session]( and [cache]( storage.
- Expressive, intuitive [database ORM](
- Database agnostic [schema migrations](
- [Robust background job processing](
- [Real-time event broadcasting](
Laravel is accessible, powerful, and provides tools required for large, robust applications.
## Learning Laravel
Laravel has the most extensive and thorough [documentation]( and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework.
If you don't feel like reading, [Laracasts]( can help. Laracasts contains over 1500 video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library.
## Laravel Sponsors
We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the Laravel [Patreon page](
### Premium Partners
- **[Vehikl](**
- **[Tighten Co.](**
- **[Kirschbaum Development Group](**
- **[64 Robots](**
- **[Cubet Techno Labs](**
- **[Cyber-Duck](**
- **[Many](**
- **[Webdock, Fast VPS Hosting](**
- **[DevSquad](**
- **[Curotec](**
- **[OP.GG](**
- **[CMS Max](**
- **[WebReinvent](**
- **[Lendio](**
## Contributing
Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](
## Code of Conduct
In order to ensure that the Laravel community is welcoming to all, please review and abide by the [Code of Conduct](
## Security Vulnerabilities
If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via []( All security vulnerabilities will be promptly addressed.
## License
The Laravel framework is open-sourced software licensed under the [MIT license](
# SSRF Demo Code for AdvSec 21/22
This repository contains the code for demonstrating a SSRF vulnerability in a close-to real-world scenario.
The demonstration is written in PHP and makes use of the [Laravel framework](
To get started, set up the project on a web server (e.g. NGINX, Apache).
There are many options that aim to simplify this process, for example:
- [DDEV](
- [Laravel Homestead](
- [Laravel Sail](
- [Laradock](
With the project running, visit `/profile`.
This page will provide a minimal input form, in to which an URI can be entered.
After clicking `Save`, the input will be persisted to the database.
When a valid URI pointing to an image was provided, that image will now be diplayed on the page.
Other valid URIs will be rendered as broken `<img>` tags, but the content corresponding content is visible in the Browser's Dev Tools.
Possible inputs
* an actual image
* Malicious examples
* http://localhost/admin
* /var/www/html/.env
* /usr/passwd
\ No newline at end of file
......@@ -16,10 +16,10 @@
<form method="POST" action="/">
<form method="POST" action="/profile">
<input type="string" name="url">
<button type="submit">Speichern</button>
<button type="submit">Save</button>
......@@ -4,46 +4,28 @@ use Illuminate\Support\Facades\Route;
use Illuminate\Http\Request;
use App\Models\Avatar;
Route::get('/', function () {
return view('avatars', ['avatars' => Avatar::all()]);
* Actual image
* -
* Malicious examples for url parameter
* -
* - http://localhost/admin
* - /var/www/html/.env
* - /usr/passwd
Route::post('/', function (Request $request) {
Route::post('/profile', function (Request $request) {
$request->validate(['url' => 'required']);
(new Avatar(['url' => $request->input('url')]))->save();
return redirect("/");
return redirect('profile');
# Variant 1
Route::get('avatars/{avatar}', function(Avatar $avatar) {
$img = fopen($avatar->url, "rb");
return response()->stream(fn() => fpassthru($img));
Route::get('/profile', function () {
return view('avatars', ['avatars' => Avatar::all()]);
# Variant 2
Route::get('avatars/{avatar}', function(Avatar $avatar) {
$img = file_get_contents($avatar->url);
return response($img)->header('Content-Type', 'img/png');
// Route::get('avatars/{avatar}', function(Avatar $avatar) {
// $img = fopen($avatar->url, "rb");
// return response()->stream(fn() => fpassthru($img));
// });
Route::get('admin', function() {
return [
'info' => 'Super sensitive business information only for admins',
'info' => 'Sensitive admin dashboard.',
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment