Skip to main content

Version Coverage

What is ending?

ending is a flexible SQL injection framework and CLI that works just as well for simple injections as it does for very complex ones.

Like sqlmap, it can be used out of the box for common SQL injection scenarios. However, ending is designed so that when the target stops being simple, you don’t need to abandon the tool and write custom scripts — you write python code instead.

Documentation and tutorials are available here.

Installation

$ pip install cfreal-ending

Documentation

Documentation is available at cfreal.github.io/ending.

A different approach to SQL injection

Most tools work fine for straightforward SQL injections over HTTP. However, when dealing with a complex case, a WAF, or other limitations, you often end up writing a custom script to inject your payloads. This is why ending was built.

Python-based target definitions

In ending, targets are defined using Python design files.

Instead of only configuring a URL and parameters through CLI arguments, you write a small Python method that sends an SQL payload to the target.

This function can be as simple as a single HTTP request — or as complex as needed.

Because it’s Python, you can naturally handle:

  • authentication and sessions
  • custom headers and encodings
  • non-HTTP protocols
  • WAF bypass logic
  • complex request flows

For simple targets, this is often only a few lines of code. For complex targets, it removes the need to switch tools entirely.

AST-based SQL generation

ending operates on the SQL Abstract Syntax Tree (AST) level, rather than building payloads as raw strings.

  • Injection techniques (UNION, error-based, blind, time-based, etc.) are implemented in a generic and reusable way
  • Each DBMS translates the AST into its own SQL dialect

Most of the time, you don't need to get that deep into the tool, as ending does everything itself. But if you face a complex injection, you can change the way AST nodes are converted into SQL syntax, and thus build advanced bypasses, such as:

  • To get rid of badchars (for instance, a<b can be written as a BETWEEN 0 AND b)
  • To make function calls less easy to spot for the WAF: SUBSTR(a, b) becomes SUBSTR# comment\n(a,b)

And it only takes a few lines of code!

First steps

It takes three steps: import, configure, and query.

Import an HTTP request

Configure a design

Get results

Check the documentation to see all available commands, and many tutorials.

Screenshots

A few screenshots of the tool's output.

Dumping some fields from a users table

Dumping columns whose name contains user

Supported databases

Currently, 5 databases are supported:

  • MySQL
  • PostgreSQL
  • SQLite
  • Oracle
  • Microsoft SQL Server (MSSQL)

Implementing a new database is a matter of a few hours. Contribute!

Metadata

Release files for cfreal-ending 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cfreal-ending 0.3.0
File Size Uploaded
cfreal_ending-0.3.0.tar.gz 131.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cfreal-ending 0.3.0
File Interpreter ABI Platform
cfreal_ending-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 286.9 kB

Release files / cfreal_ending-0.3.0.tar.gz

Download URL cfreal_ending-0.3.0.tar.gz
Size 131.8 kB
Tags Source
SHA-256 checksum
How to use checksums
b4d0827deba4294df03454cbb563252b428025497ef23f3a083a4f5b36cc8d5b
BLAKE2b-256 checksum
How to use checksums
5cb4310afd2b5da89e6b446d6e869f9e03a508814bc3347c4eb4960c58273dd1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.2.1 CPython/3.10.9 Linux/5.15.0-190-generic

Release files / cfreal_ending-0.3.0-py3-none-any.whl

Download URL cfreal_ending-0.3.0-py3-none-any.whl
Size 155.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a5812ba911b85d9f3621b090c220f37440c2f8169256003b8686a0f3e2e2bc31
BLAKE2b-256 checksum
How to use checksums
c796457ee8f8c03a2682ec12487d5ee9c94a0030c5eaa0d43fa719a710892103
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.2.1 CPython/3.10.9 Linux/5.15.0-190-generic

Release history Release notifications | RSS feed

0.4.0

2 release files

This release

0.3.0 This release

2 release files

0.2.2

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page