Ghauri Documentation

repository·main·Indexed 26 days ago

https://github.com/r0oth3x49/ghauri

An advanced cross-platform tool for automating the detection and exploitation of SQL injection vulnerabilities across various DBMS, including MySQL, MSSQL, Postgres, and Oracle.

Tokens
2.2K
Snippets
4
Records
4
Agent score
38%

What's inside Ghauri

  1. Install Ghauri

    main

    To install Ghauri, ensure you have Python 3 and pip3 installed. Follow these steps:

    1. Clone the repository:
      git clone https://github.com/r0oth3x49/ghauri.git
    2. Navigate to the directory:
      cd ghauri
    3. Install requirements:
      python3 -m pip install --upgrade -r requirements.txt
    4. Install the tool:
      python3 setup.py install
      Alternatively, use: python3 -m pip install -e .

    Once installed, you can run the tool using the ghauri command.

    git clone https://github.com/r0oth3x49/ghauri.git
    cd ghauri
    python3 -m pip install --upgrade -r requirements.txt
    python3 setup.py install
  2. Update Ghauri

    main

    If you installed Ghauri by cloning the GitHub repository, you can update it using the built-in --update flag.

    Note: For older versions that were not installed via GitHub, you must use git pull to get the latest version.

    ghauri --update
  3. Reference: Ghauri CLI Options

    main

    Ghauri is a tool for detecting and exploiting SQL injection flaws. The command structure is ghauri -u URL [OPTIONS].

    General:
      -h, --help          Shows the help.
      --version           Shows the version.
      --update            update ghauri
      -v VERBOSE          Verbosity level: 1-5 (default 1).
      --batch             Never ask for user input, use the default behavior
      --flush-session     Flush session files for current target
      --fresh-queries     Ignore query results stored in session file
      --test-filter       Select test payloads by titles (experimental)
    
    Target:
      -u URL, --url URL   Target URL (e.g. 'http://www.site.com/vuln.php?id=1).
      -m BULKFILE         Scan multiple targets given in a textual file
      -r REQUESTFILE      Load HTTP request from a file
    
    Request:
      -A , --user-agent   HTTP User-Agent header value
      -H , --header       Extra header (e.g "X-Forwarded-For: 127.0.0.1")
      --mobile            Imitate smartphone through HTTP User-Agent header
      --random-agent      Use randomly selected HTTP User-Agent header value
      --host              HTTP Host header value
      --data              Data string to be sent through POST (e.g "id=1")
      --cookie            HTTP Cookie header value (e.g "PHPSESSID=a8d127e..")
      --referer           HTTP Referer header value
      --headers           Extra headers (e.g "Accept-Language: fr\nETag: 123")
      --proxy             Use a proxy to connect to the target URL
      --delay             Delay in seconds between each HTTP request
      --timeout           Seconds to wait before timeout connection (default 30)
      --retries           Retries when the connection related error occurs (default 3)
      --confirm           Confirm the injected payloads.
      --ignore-code       Ignore (problematic) HTTP error code(s) (e.g 401)
      --skip-urlencode    Skip URL encoding of payload data
      --force-ssl         Force usage of SSL/HTTPS
    
    Optimization:
      --threads THREADS   Max number of concurrent HTTP(s) requests (default 1)
    
    Injection:
      -p TESTPARAMETER    Testable parameter(s)
      --dbms DBMS         Force back-end DBMS to provided value
      --prefix            Injection payload prefix string
      --suffix            Injection payload suffix string
      --safe-chars        Skip URL encoding of specific character(s) (e.g: --safe-chars="[]")
      --fetch-using       Fetch data using different operator(s) (e.g: --fetch-using=between/in)
    
    Detection:
      --level LEVEL       Level of tests to perform (1-3, default 1)
      --code CODE         HTTP code to match when query is evaluated to True
      --string            String to match when query is evaluated to True
      --not-string        String to match when query is evaluated to False
      --text-only         Compare pages based only on the textual content
    
    Techniques:
      --technique TECH    SQL injection techniques to use (default "BEST")
      --time-sec TIMESEC   Seconds to delay the DBMS response (default 5)
    
    Enumeration:
      -b, --banner        Retrieve DBMS banner
      --current-user      Retrieve DBMS current user
      --current-db        Retrieve DBMS current database
      --hostname          Retrieve DBMS server hostname
      --dbs               Enumerate DBMS databases
      --tables            Enumerate DBMS database tables
      --columns           Enumerate DBMS database table columns
      --count             Retrieve number of entries for table(s)
      --dump              Dump DBMS database table entries
      -D DB               DBMS database to enumerate
      -T TBL              DBMS database tables(s) to enumerate
      -C COLS             DBMS database table column(s) to enumerate
      --start             Retrieve entries from offset for dbs/tables/columns/dump
      --stop              Retrieve entries till offset for dbs/tables/columns/dump
      --sql-shell         Prompt for an interactive SQL shell (experimental)