Identifier / Programs / Linux and Unix
sqlite3
Interface to SQLite 3, which is a self-contained file-based embedded SQL engine. tldr-pages
GTFOBins file-write, shell 1 Sigma rule name it 1 ATT&CK technique 3 documented commands
How sqlite3 is abused
file-write
-cmdshell T1059.004 Command and Scripting Interpreter: Unix Shell
Each abuse is GTFOBins's category and the options and words it uses; the full write-up is on GTFOBins's page for sqlite3.
3 documented commands
file-read unprivileged, with sudo, as SUID
sqlite3 <<EOF
CREATE TABLE x(x TEXT);
.import /path/to/input-file x
SELECT * FROM x;
EOFIdentifyfile-write unprivileged, with sudo, as SUID
sqlite3 /dev/null -cmd '.output /path/to/output-file' 'select "DATA";'Identifyshell unprivileged, with sudo, as SUID
sqlite3 /dev/null '.shell /bin/sh'IdentifyNone of the 3 commands the identifier reads trips a Sigma process-creation rule. These commands are from GTFOBins, at commit acd524623f9c of 2026-05-27, under the GPL-3.0, with no warranty. Changed: Markdown is shown formatted. The source is in lolbas-gtfobins-commands.json.gz, and the full entry is on GTFOBins’s page for sqlite3. The identifier reads the line of each that runs sqlite3.
What detects it
Everyday use
Start an interactive shell with a new database
sqlite3IdentifyOpen an interactive shell against an existing database
sqlite3 path/to/database.sqlite3IdentifyExecute an SQL statement against a database and then exit
sqlite3 path/to/database.sqlite3 'SELECT * FROM some_table;'IdentifyNone of the 3 examples the identifier reads matches GTFOBins abuse or trips a Sigma process-creation rule.