sqlmap Command-Line Cheat Sheet

This cheat sheet references some of the most commonly used sqlmap commands. Whether you’re a seasoned professional looking to brush up on your command-line skills or a newcomer eager to explore the possibilities of networking through sqlmap, you’ll find valuable insights and shortcuts here.

Installation

DistributionCommand
Debian/Ubuntusudo apt-get install sqlmap
CentOS/Fedora/Red Hatsudo yum install sqlmap
NixOSnix-env -iA nixos.sqlmap

Usage

TaskCommand
Basic SQL injection testsqlmap -u http://example.com

sqlmap Command Switches

SwitchDescription
--url or -uTarget URL to scan for SQL injection vulnerabilities.
--dataRetrieve the DBMS banner (version and other details).
--cookieUse specified HTTP Cookie header value for the requests.
--dbsEnumerate DBMS databases on the target.
--tablesEnumerate DBMS database tables from a specific database.
--dumpDump the contents of a database table.
--os-shellPrompt for an interactive operating system shell.
--batchNever ask for user input, use default behavior.
--bannerUse the Tor anonymity network to make all HTTP requests.
--torRetrieve DBMS’s current user.
--proxyUse a proxy to connect to the target URL.
--random-agentUse a randomly selected HTTP User-Agent header value.
--is-dbaDetect whether the DBMS current user is DBA (Database Admin).
--techniqueSQL injection techniques to use (e.g., B for Boolean-based).
--threadsNumber of concurrent HTTP(s) requests.
--levelLevel of tests to perform (1-5, default 1).
--riskRisk of tests to perform (1-3, default 1).
--current-userRetrieve DBMS’s current database.
--current-dbDump all databases’ table entries.
--countRetrieve the number of entries for tables.
--dump-allUse the given script(s) for tampering injection data.
--sql-shellPrompt for an interactive SQL shell.
--sql-queryExecute the given SQL statement against the database.
--tamperUse given script(s) for tampering injection data.

Wrapping Up

This sqlmap cheat sheet has highlighted the tool’s flexibility and power for everything from simple tasks to advanced operations. Mastering sqlmap can significantly boost your networking skills. Keep practising, exploring further resources, and share your findings to deepen your understanding and contribute to the community’s collective knowledge.

You May Also Be Interested In

References

This table lists some of the most frequently used switches in sqlmap. For a comprehensive list and detailed explanations, refer to the official sqlmap documentation.

About Anto Online

Anto, a seasoned technologist with over two decades of experience, has traversed the tech landscape from Desktop Support Engineer to enterprise application consultant, specializing in AWS serverless technologies. He guides clients in leveraging serverless solutions while passionately exploring cutting-edge cloud concepts beyond his daily work. Anto's dedication to continuous learning, experimentation, and collaboration makes him a true inspiration, igniting others' interest in the transformative power of cloud computing.

View all posts by Anto Online

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.