Name Date Size #Lines LOC

..--

app/com/android/google/tools/security/shell_as/H25-Apr-2025-299

shell-code/H25-Apr-2025-606243

Android.bpH A D25-Apr-20253.1 KiB108102

AndroidManifest.xml.templateH A D25-Apr-20251.1 KiB3416

OWNERSH A D25-Apr-202572 53

README.mdH A D25-Apr-2025853 3425

command-line.cppH A D25-Apr-20257.9 KiB211173

command-line.hH A D25-Apr-20251.3 KiB378

context.cppH A D25-Apr-20254.3 KiB13997

context.hH A D25-Apr-20252.3 KiB7226

elf-utils.cppH A D25-Apr-20252.8 KiB9055

elf-utils.hH A D25-Apr-20251.2 KiB368

execute.cppH A D25-Apr-202514.6 KiB383234

execute.hH A D25-Apr-20251.2 KiB368

gen-manifest.shH A D25-Apr-20251.4 KiB4414

registers.hH A D25-Apr-20251.2 KiB4518

shell-as-main.cppH A D25-Apr-20252.8 KiB9468

shell-as-test-app-key.pk8HD25-Apr-20251.2 KiB

shell-as-test-app-key.x509.pemH A D25-Apr-20251.4 KiB2524

shell-code.cppH A D25-Apr-20253.1 KiB8644

shell-code.hH A D25-Apr-20251.3 KiB4113

string-utils.cppH A D25-Apr-20252 KiB7343

string-utils.hH A D25-Apr-20251.7 KiB5111

test-app.cppH A D25-Apr-20253.9 KiB13785

test-app.hH A D25-Apr-20251 KiB327

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