Ir al contenido

RED TEAM OPERATIONS REPORT: "LGE" FORENSIC ANALYSIS (WINDOWS CLI MODE)

Operators: Red Team Lead & Tactical Operator Environment: Windows 11 (using Git Bash + sqlite3.exe) Objective: Surgical data extraction without GUI.

0views

Operators: Red Team Lead & Tactical Operator Environment: Windows 11 (using Git Bash + sqlite3.exe) Objective: Surgical data extraction without GUI.

Before starting, let's ensure that the binary sqlite3.exe is in the case root directory (next to Agent Data).

We open our Git Bash terminal in the image directory and verify:

Ventana de terminal
ls -F
# Hauries de veure: Agent Data/ Live Data/ sqlite3.exe*

We will copy and paste these commands directly into our Git Bash terminal.

We will read the plain text file generated by the agent.

Ventana de terminal
cat "Live Data/device_datetime_utc.txt"
  • Expected result: A date and time (e.g., 2021-05-21 10:00:00).

We will attack the contacts database. In modern Android (contacts3.db), the key table is usually view_data, which joins names and data.

./sqlite3.exe "Agent Data/contacts3.db" "SELECT display_name, data1 FROM view_data WHERE display_name LIKE '%Zoe%';"
  • Expected result: Zoe Washburne|<email>
  • Note: If a table error occurs, we will try: SELECT data1 FROM data WHERE display_name LIKE '%Zoe%';

We will search the download DB. We need the lastmod field (last modification).

# Pas 1: Obtenir el Timestamp
./sqlite3.exe "Agent Data/downloads.db" "SELECT title, lastmod FROM downloads WHERE title LIKE '%Orbot%' OR title LIKE '%Tor%';"
  • Data obtained: A long number (e.g., 1621518345123).

  • Step 2: Conversion (From the terminal): We will copy the first 10 digits of the number (removing the milliseconds at the end) and execute:

    date -u -d @1621518345 # Substitueix el número pel que hagis trobat

We will look for patterns in the massive battery file. We will look for "RESET" and then see when it reaches 100%.

Ventana de terminal
# Busquem les línies que contenen "RESET:TIME" i mostrem les 30 següents (-A 30)
# Després filtrem per "Level: 100" o "status=full"
grep -A 30 "RESET:TIME" "Live Data/Dumpsys Data/batterystats.txt" | grep "Level: 100" -B 5
  • Interpretation: We will look at the relative (+1h 20m...) or absolute timeline that appears in the log.

We will extract plaintext from the WiFi database.

./sqlite3.exe "Agent Data/wifi.db" "SELECT SSID, preSharedKey FROM wifi_configurations;"
  • Expected result: A list of networks. The password is in the second column. We will look for the most recent one (they usually appear in order of addition or connection).

We will use grep to find the exact second in the usage logs.

Ventana de terminal
grep "14:13:27" "Live Data/usage_stats.txt"
  • If nothing comes up: We will try Live Data/Dumpsys Data/usagestats.txt.
  • Result: We will look for the line that says MOVE_TO_FOREGROUND. The package is on the right (e.g.: com.android.settings).

We must find the aggregated entry for May 20. This is difficult with a single grep, so we will do it in two steps.

  1. Locate the block for the day:

    Ventana de terminal
    grep -n "2021-05-20" "Live Data/Dumpsys Data/usagestats.txt" | head -n 1

    (We will note the line number, e.g.: 1450)

  2. Extract YouTube info: We will replace 1450 with the number we found. We will display 500 lines from there and search for YouTube.

    Ventana de terminal
    tail -n +1450 "Live Data/Dumpsys Data/usagestats.txt" | head -n 500 | grep "com.google.android.youtube" -A 5
  3. Calculation: We will take the value of totalTime (in ms), divide it by 1000 (seconds) and convert it to hours/minutes.

  • UTC obtained (cat).
  • Zoe's email obtained (sqlite3).
  • TOR time converted (date -d).
  • 100% load located (grep).
  • Wifi Password exfiltrated (sqlite3).
  • App 14:13:27 identified (grep).
  • YouTube time calculated (grep + math).

Operators, we have the green light to execute.