This is my submission for the Rustdesk Octernship application.
The task was to "Elevate priviledge to run ls -la /root/
with Rust, and print the result on the Flutter window".
![]() |
---|
The example image |
I made a simple Flutter app that checks for the existence of polkit
, sudo
, and su
in order to carry out the privilege escalation. It then only offers to use those that are available (though, sudo
and su
are very ubiquitous so it is unlikely for a Linux system to not have both).
The application also allows for the command to be ran without any form of escalation, in case it was launched from a privileged context (and therefore wouldn't need escalation).
![]() |
---|
The main page of the application |
![]() |
---|
The authentication dialog |
![]() |
---|
The output after authenticating |
-
Clone the repository and change directories
-
Ensure you have the dependencies:
-
Run
just
to ensure the generated bindings are up to date -
Run
flutter run
to run the application