Locate the Session File in the Output Directory
sqlmap automatically saves all scan results, including identified vulnerabilities, retrieved data, and session information, into a dedicated output directory. In this step, you will learn how to locate this session file.
By default, sqlmap stores its output in the ~/.sqlmap/output/ directory. Inside this directory, you will find subdirectories named after the target host.
Navigate to the sqlmap output directory:
cd ~/.sqlmap/output/localhost/
Then, list the contents of this directory to see the session files and other scan-related data:
ls -l
You should see a directory named after the specific URL or a hash of it, and inside that, files like session.sqlite, log, and potentially dump directories if data was extracted. The session.sqlite file contains the session data, which allows sqlmap to resume scans or review previous findings without re-scanning.
labex@labex-ubuntu:~/project$ cd ~/.sqlmap/output/localhost/
labex@labex-ubuntu:~/.sqlmap/output/localhost$ ls -l
total 12
drwxr-xr-x 2 labex labex 4096 Jan 1 12:35 http%3A%2F%2Flocalhost%2Findex.php%3Fid%3D1
labex@labex-ubuntu:~/.sqlmap/output/localhost$ cd http%3A%2F%2Flocalhost%2Findex.php%3Fid%3D1/
labex@labex-ubuntu:~/.sqlmap/output/localhost/http%3A%2F%2Flocalhost%2Findex.php%3Fid%3D1$ ls -l
total 12
-rw-r--r-- 1 labex labex 1234 Jan 1 12:35 log
-rw-r--r-- 1 labex labex 8192 Jan 1 12:35 session.sqlite
This step is important for understanding where sqlmap stores its persistent data, which is useful for reviewing past scans or continuing complex operations.