- Machine
- Bagel
- OS
- Linux
- Difficulty
- Medium
- Steps
- 4
- Added
- 18 Feb 2023
A Flask LFI leaks a .NET assembly; its Newtonsoft deserializer reads arbitrary files over a WebSocket, and a reused DB password plus sudo dotnet give root.
How it went
- 0nmap
nmap finds SSH, a .NET WebSocket on 5000, and a Flask app on 8000.
- 1Flask LFI
The Flask page parameter is a path-traversal LFI; it reads the app source and the backend bagel.dll.
- 2Newtonsoft deser
bagel.dll deserializes with Newtonsoft TypeNameHandling.Auto, so a nested $type File object reads phil's flag, SSH key, and a DB password.
- 3developer
phil's key logs in over SSH; the DB password is reused to su to developer.
- 4sudo dotnet
developer may sudo dotnet, so dotnet fsi runs an F# one-liner as root.