[Exploit] [Shizuku Support] SMT Shell v2.0 - get a SYSTEM SHELL (UID 1000) within the app itself - and write your own system app with an API

Search This thread

BLuFeNiX

Senior Member
Jan 18, 2013
434
219

SMT Shell v2.0​

GitHub: https://github.com/BLuFeNiX/SMTShell

Hi everyone! After seeing the recent controversy over a similar tool, I have decided to maintain my own version of the Samsung system shell exploit, targeting CVE-2019-16253.

Original CVE: CVE-2019-16253

What does it do?​

This tool allows most Samsung devices to achieve a system shell (UID 1000). It was patched in OneUI 5.1, but will work on Android 13 running OneUI 5.0 or older, as well as some very early versions of OneUI 5.1 (like the S23). It should work as far back and Android 9.0 (and maybe earlier).

It has a feature set similar to Samsung Toolkit, but I've added even more stuff, and have additional plans for the future. It also has an API so you can write your own apps. You can think of it like SuperSU/Magisk for uid 1000 instead of root.

API source code and instructions: https://github.com/BLuFeNiX/SMTShell-API

Usage (with Shizuku)​

Simply run the app and grant Shizuku access.

Usage (no Shizuku)​

  1. Downgrade the TTS app to the version provided (this must be done after every reboot):
    adb install -d com.samsung.SMT_v3.0.02.2.apk
    alternatively, you can use pm install -d /data/local/tmp/com.samsung.SMT_v3.0.02.2.apk if you copy the file to your device first, via adb push
  2. Install and open the SMT Shell app.

02.png
03.png


Troubleshooting​

  1. Try clearing the Samsung SMT app data: adb shell pm clear com.samsung.SMT
  2. kill and run the SMT Shell app again
  3. If the above fails, reboot and follow the usage instructions again.

Thanks to @flanker017 !!!​

This work is based purely off of the original 2019 exploit code, authored by flanker017. Although other similar projects may exist, this uses absolutely no code from them. You can find the original work at the following links:

* https://github.com/flankerhqd/vendor-android-cves (specifically the SMT-CVE-2019-16253 folder).
* https://blog.flanker017.me/text-to-speech-speaks-pwned/

Changes from the original exploit​

I have refactored/simplified nearly all of the code, as well as implemented my own reverse shell.

Suggestion? Bug report?​

Feel free to discuss here, but I will be most responsive if you create an issue on GitHub.

Update!​

Added Shizuku support! (v1.2)
 

Attachments

  • com.samsung.SMT_v3.0.02.2.apk
    15.2 MB · Views: 236
  • SMT_Shell_v2.0.1.apk
    16.6 MB · Views: 80
Last edited:

BLuFeNiX

Senior Member
Jan 18, 2013
434
219
Another developer on xda had his thread locked by a mod since they though it was a duplicate thread. The Dev was able to get the exploit /and or the system shell working on one UI 5.1.

I am not trying to hijack the thread.
Thanks, I heard about this. I am under the impression that certain devices did not get the patch until a later update, so very early versions of 5.1 are affected on some devices, but the most up-to-date software is not affected by this exploit.
 
  • Like
Reactions: goofwear

myhanbing

New member
Jun 29, 2016
4
0
An error occurred when I executed the downgrade install command:
```
H:\Users\Administrator\Downloads>adb install -d ./com.samsung.SMT_v3.0.02.2.apk
Performing Streamed Install
adb: failed to install ./com.samsung.SMT_v3.0.02.2.apk: Failure [INSTALL_FAILED_VERSION_DOWNGRADE]
```


Device info:
```
oneUI 1.0
Android 9.0
Model: SM-G9550 (Galaxy S8+)
Original SMT Version: 3.0.03.11
Android Secure Patch Level: 2020/12/01
```



####################Resolved###################
This command only supports Android 10+, so executing it on Android 9 will result in the above error .
refs:https://blog.esper.io/adb-29-how-to-downgrade-rollback-app/
 
Last edited:
Another developer on xda had his thread locked by a mod since they though it was a duplicate thread. The Dev was able to get the exploit /and or the system shell working on one UI 5.1.

I am not trying to hijack the thread.
So what you're referring to is me, with the S23 Ultra on One UI 5.1. I did achieve system shell access on this device.
 

Attachments

  • s23.ultra-SS.jpg
    s23.ultra-SS.jpg
    127.9 KB · Views: 73
  • Like
Reactions: bigron77
How this happened....only worked on the U variant for the S23 Ultra. No other devices, so far. If you have U1,you're still in luck. As long as @BLuFeNiX is okay with it. I can share how. But with that said. This will not be support for the S23 clan. I don't want to feel like I'm hijacking the OP either but as long as @BLuFeNiX is fine with it. I'll share the details soon.
 

BLuFeNiX

Senior Member
Jan 18, 2013
434
219
How this happened....only worked on the U variant for the S23 Ultra. No other devices, so far. If you have U1,you're still in luck. As long as @BLuFeNiX is okay with it. I can share how. But with that said. This will not be support for the S23 clan. I don't want to feel like I'm hijacking the OP either but as long as @BLuFeNiX is fine with it. I'll share the details soon.
You don't need my permission to share your own research. Go for it!
 
So what you're referring to is me, with the S23 Ultra on One UI 5.1. I did achieve system shell access on this device.
For R&D purposes only
*S918U & S918U1 devices only*

Take the following info as is. Nothing too great about it. Just know, it wasn't anything hi tech or anything that required a whole lot of knowledge. I achieved system shell access on the S23 Ultra by flashing this.


This is a probably around the first known build available for the S23 Ultra. Security patch is Nov 1 2022. Samsung was in no way ever thinking about patching SMT back then. So I GOT LUCKY and figured it out by simply doing what i usually do when I get a new device. Flash this and follow the OP's instructions and you too can see system shell access. @BLuFeNiX @V0latyle
 

ketopili81

New member
Mar 9, 2023
4
0
Hi
I have the same above error unfortunately.(INSTALL_FAILED_BLOCKED_CROSS_DOWN)
Device: SM-A015M , running android 10 , one ui core.
Also i have shizuku app installed with lspatch,but i can downgrade 3rd party apps only , not system apps.
I think the problem is with one ui core. I did adb shell pm clear com.samsung.SMT , but doesn' t work.
If someone have any advice, i'm wiiling to accept the suggested.
Oh well, anyway thank you for your work.
Bye.
 
Last edited:
Hi
I have the same above error unfortunately.(INSTALL_FAILED_BLOCKED_CROSS_DOWN)
Device: SM-A015M , running android 10 , one ui core.
Also i have shizuku app installed with lspatch,but i can downgrade 3rd party apps only , not system apps.
I think the problem is with one ui core. I did adb shell pm clear com.samsung.SMT , but doesn' t work.
If someone have any advice, i'm wiiling to listen.
Oh well, anyway thank you for your work.
Bye.
That's a new one. I've never came across seeing that error. Is your device older than 2019? What version of SMT, do you have on stock?
 

BLuFeNiX

Senior Member
Jan 18, 2013
434
219
Hi
I have the same above error unfortunately.(INSTALL_FAILED_BLOCKED_CROSS_DOWN)
Device: SM-A015M , running android 10 , one ui core.
Also i have shizuku app installed with lspatch,but i can downgrade 3rd party apps only , not system apps.
I think the problem is with one ui core. I did adb shell pm clear com.samsung.SMT , but doesn' t work.
If someone have any advice, i'm wiiling to listen.
Oh well, anyway thank you for your work.
Bye.
Not sure about that error, but try the new version which does the downgrade for you via Shizuku.

Will rhe exploit work with shizuku and samsung toolkit?
Shizuku support added!
 
  • Like
Reactions: wr3cckl3ss1

dubblecup

Senior Member
Dec 19, 2011
62
6
Hey Shizuku is running. But fails to escalate with Samsung toolkit. I'm somewhat of a noob so don't know any other way to achieve system access to change csc etc. Was pretty convenient. I changed csc using samfw. But now I have have to connect to my computer.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 9

    SMT Shell v2.0​

    GitHub: https://github.com/BLuFeNiX/SMTShell

    Hi everyone! After seeing the recent controversy over a similar tool, I have decided to maintain my own version of the Samsung system shell exploit, targeting CVE-2019-16253.

    Original CVE: CVE-2019-16253

    What does it do?​

    This tool allows most Samsung devices to achieve a system shell (UID 1000). It was patched in OneUI 5.1, but will work on Android 13 running OneUI 5.0 or older, as well as some very early versions of OneUI 5.1 (like the S23). It should work as far back and Android 9.0 (and maybe earlier).

    It has a feature set similar to Samsung Toolkit, but I've added even more stuff, and have additional plans for the future. It also has an API so you can write your own apps. You can think of it like SuperSU/Magisk for uid 1000 instead of root.

    API source code and instructions: https://github.com/BLuFeNiX/SMTShell-API

    Usage (with Shizuku)​

    Simply run the app and grant Shizuku access.

    Usage (no Shizuku)​

    1. Downgrade the TTS app to the version provided (this must be done after every reboot):
      adb install -d com.samsung.SMT_v3.0.02.2.apk
      alternatively, you can use pm install -d /data/local/tmp/com.samsung.SMT_v3.0.02.2.apk if you copy the file to your device first, via adb push
    2. Install and open the SMT Shell app.

    02.png
    03.png


    Troubleshooting​

    1. Try clearing the Samsung SMT app data: adb shell pm clear com.samsung.SMT
    2. kill and run the SMT Shell app again
    3. If the above fails, reboot and follow the usage instructions again.

    Thanks to @flanker017 !!!​

    This work is based purely off of the original 2019 exploit code, authored by flanker017. Although other similar projects may exist, this uses absolutely no code from them. You can find the original work at the following links:

    * https://github.com/flankerhqd/vendor-android-cves (specifically the SMT-CVE-2019-16253 folder).
    * https://blog.flanker017.me/text-to-speech-speaks-pwned/

    Changes from the original exploit​

    I have refactored/simplified nearly all of the code, as well as implemented my own reverse shell.

    Suggestion? Bug report?​

    Feel free to discuss here, but I will be most responsive if you create an issue on GitHub.

    Update!​

    Added Shizuku support! (v1.2)
    4
    *COMMANDS FOR SYSTEM AND/OR ROOT USE ONLY*

    **WARNING**
    Do your research and find out what something does before you aimlessly execute the commands and mess something up. This is your only warning.

    IOTHiddenMenu.apk

    am start -n com.sec.hiddenmenu/.KOREA_Mode -e 7267864872 72678647376477466

    am start -n com.sec.hiddenmenu/.KoreaMode_Prevail -e 7267864872 72678647376477466

    am start -n com.sec.hiddenmenu/.SerialPort -e 7267864872 72678647376477466

    am start -n com.sec.hiddenmenu/.ItsOnMenu -e 7267864872 72678647376477466

    am start -n com.sec.hiddenmenu/.ServiceModeApp -e 7267864872 72678647376477466

    am start -n com.sec.hiddenmenu/.Test -e 7267864872 72678647376477466

    am start -n com.sec.hiddenmenu/.PhoneUtil -e 7267864872 72678647376477466

    am start -n com.sec.hiddenmenu/.OTATest -e 7267864872 72678647376477466

    am start -n com.sec.hiddenmenu/.LTE -e 7267864872 72678647376477466

    am start -n com.sec.hiddenmenu/.FIELDTESTMODE -e 7267864872 72678647376477466

    am start -n com.sec.hiddenmenu/.HiddenMenuEnable -e 7267864872 72678647376477466

    am start -n com.sec.hiddenmenu/.GlobalHiddenMenuEnable -e 7267864872 72678647376477466


    Change your CSC thru Preconfiguration. (Exclusive to primarily US devices)

    am start -n com.samsung.android.cidmanager/.modules.preconfig.PreconfigActivity -a com.samsung.android.action.SECRET_CODE -d secret_code://27262826 --ei type 2

    Option #2 for Possible CSC change on devices not from US.

    am start -n com.samsung.android.cidmanager/.preconfig.PreconfigActivity -a android.provider.Telephony.SECRET_CODE -d secret_code://272837883 --ei type 3


    Service Menu

    am broadcast -a com.samsung.android.action.SECRET_CODE -d android_secret_code://27663368378 -n com.sec.android.RilServiceModeApp/.SecKeyStringBroadcastReceiver

    Hidden Network Band Selection

    am start -n com.samsung.android.app.telephonyui/.hiddennetworksetting.MainActivity


    Use with CAUTION***

    am start -n com.wssyncmldm/com.idm.fotaagent.enabler.ui.admin.feature.AdminFeatureAndActionActivity

    am start -n com.wssyncmldm/com.samsung.android.fotaagent.common.feature.FeatureInjectionActivity

    am start -n com.sec.android.app.factorykeystring/com.sec.android.app.shutdown.ShutdownPreference

    am start -n com.samsung.android.sdm.config/.ui.DevConfigActivity

    am start -n com.sec.android.sdhms/.debugger.ui.ThermalLimitSettingActivity

    am start -n com.sec.usbsettings/.USBSettings

    am start -n com.android.settings/.development.DSULoader

    am start -n com.sec.android.app.servicemodeapp/com.sec.android.app.modemui.activities.PhoneUtil

    am start -n com.sec.android.app.myfiles/.external.ui.developer.DeveloperSettingActivity

    am start -n com.sec.android.app.factorykeystring/com.sec.android.app.phoneutil.UsbLogging

    am start -n com.samsung.sdm/com.samsung.sdm.logic.DMApp

    Have fun...
    --wr3cckl3ss1
    3
    So what you're referring to is me, with the S23 Ultra on One UI 5.1. I did achieve system shell access on this device.
    For R&D purposes only
    *S918U & S918U1 devices only*

    Take the following info as is. Nothing too great about it. Just know, it wasn't anything hi tech or anything that required a whole lot of knowledge. I achieved system shell access on the S23 Ultra by flashing this.


    This is a probably around the first known build available for the S23 Ultra. Security patch is Nov 1 2022. Samsung was in no way ever thinking about patching SMT back then. So I GOT LUCKY and figured it out by simply doing what i usually do when I get a new device. Flash this and follow the OP's instructions and you too can see system shell access. @BLuFeNiX @V0latyle
    3
    Version 2.0 released! See OP for details.
    2
    I am sorry but could you please share the names of those two apps? Or PM me the links, please?

    I have two elevated apps that do this and it's all without a system shell .
    Yeah same was trying to avoid downgrading or modifying. If you can DM apps
    I have S918B/DS, could you share those apps in DM? I need to use Service Menu, I can't downgrade to Verizon firmware. Thank you.
    I guess the days of doing research and exploring for yourself are long gone. Here you are gentlemen. As per you requests, I'll kindly point you all to ONE of those apps. What you do with it, is all on you and please refrain from asking "Why", "Where" or "How".