Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | - | - | ||||
app/com/android/google/tools/security/shell_as/ | 06-Sep-2024 | - | 29 | 9 | ||
shell-code/ | 06-Sep-2024 | - | 606 | 243 | ||
Android.bp | D | 06-Sep-2024 | 3.1 KiB | 108 | 102 | |
AndroidManifest.xml.template | D | 06-Sep-2024 | 1.1 KiB | 34 | 16 | |
OWNERS | D | 06-Sep-2024 | 72 | 5 | 3 | |
README.md | D | 06-Sep-2024 | 853 | 34 | 25 | |
command-line.cpp | D | 06-Sep-2024 | 7.9 KiB | 211 | 173 | |
command-line.h | D | 06-Sep-2024 | 1.3 KiB | 37 | 8 | |
context.cpp | D | 06-Sep-2024 | 4.3 KiB | 139 | 97 | |
context.h | D | 06-Sep-2024 | 2.3 KiB | 72 | 26 | |
elf-utils.cpp | D | 06-Sep-2024 | 2.8 KiB | 90 | 55 | |
elf-utils.h | D | 06-Sep-2024 | 1.2 KiB | 36 | 8 | |
execute.cpp | D | 06-Sep-2024 | 14.6 KiB | 383 | 234 | |
execute.h | D | 06-Sep-2024 | 1.2 KiB | 36 | 8 | |
gen-manifest.sh | D | 06-Sep-2024 | 1.4 KiB | 44 | 14 | |
registers.h | D | 06-Sep-2024 | 1.2 KiB | 45 | 18 | |
shell-as-main.cpp | D | 06-Sep-2024 | 2.8 KiB | 94 | 68 | |
shell-as-test-app-key.pk8 | D | 06-Sep-2024 | 1.2 KiB | |||
shell-as-test-app-key.x509.pem | D | 06-Sep-2024 | 1.4 KiB | 25 | 24 | |
shell-code.cpp | D | 06-Sep-2024 | 3.1 KiB | 86 | 44 | |
shell-code.h | D | 06-Sep-2024 | 1.3 KiB | 41 | 13 | |
string-utils.cpp | D | 06-Sep-2024 | 2 KiB | 73 | 43 | |
string-utils.h | D | 06-Sep-2024 | 1.7 KiB | 51 | 11 | |
test-app.cpp | D | 06-Sep-2024 | 3.9 KiB | 137 | 85 | |
test-app.h | D | 06-Sep-2024 | 1 KiB | 32 | 7 |
README.md
1# shell-as 2 3shell-as is a utility that can be used to execute a binary in a less privileged 4security context. This can be useful for verifying the capabilities of a process 5on a running device or testing PoCs with different privilege levels. 6 7## Usage 8 9The security context can either be supplied explicitly, inferred from a process 10running on the device, or set to a predefined profile. 11 12For example, the following are equivalent and execute `/system/bin/id` in the 13context of the init process. 14 15```shell 16shell-as \ 17 --uid 0 \ 18 --gid 0 \ 19 --selinux u:r:init:s0 \ 20 --seccomp system \ 21 /system/bin/id 22``` 23 24```shell 25shell-as --pid 1 /system/bin/id 26``` 27 28The "untrusted-app" profile can be used to execute a binary with all the 29possible privileges attainable by an untrusted app: 30 31```shell 32shell-as --profile untrusted-app /system/bin/id 33``` 34