Enhanced version of impacket's mssqlclient.py. It lets you interact with Microsoft SQL Server (MS SQL / MSSQL) servers and their linked instances, impersonating any account encountered along the way, without requiring complex T-SQL queries.
N.B. It can handle NTLM relaying 🔄
📦 Installation
To install mssqlclient-ng, you can use pip, pip3 or pipx. Either from pypi repository or from GitHub source. Prefer using pipx, since it install Python applications in isolated virtual environments.
From PyPI
pipx install mssqlclient-ng
pip install mssqlclient-ng
From GitHub
pipx install 'git+https://github.com/n3rada/mssqlclient-ng.git'
🧸 Usage
mssqlclient-ng <host> [options]
Format: server,port:user@database or any combination server:user@database,port.
server(required) - The SQL Server hostname or IP,port(optional) - Port number (default: 1433, also common: 1434, 14333, 2433):user(optional) - User to impersonate on this server@database(optional) - Database context (defaults to 'master' if not specified)
mssqlclient-ng localhost -c token
Common options:
--timeout 30- Connection timeout in seconds (default: 15)-l SERVER1:user1,SERVER2:user2@dbclients- Chain through linked servers (uses configured linked server names)
🤝 Contributing
Contributions are welcome and appreciated! Whether it's fixing bugs, adding new features, improving the documentation, or sharing feedback, your effort is valued and makes a difference. Open-source thrives on collaboration and recognition. Contributions, large or small, help improve the tool and its community. Your time and effort are truly valued.
Here, no one will be erased from Git history. No fear to have here. No one will copy-paste your code without adhering to the collaborative ethos of open-source.
🙏 Acknowledgments
- Built upon Impacket, based on the core tds.py.
- OOP design is really tied to MSSQLand.
- Terminal interface powered by prompt_toolkit.
⚠️ Disclaimer
This tool is provided strictly for defensive security research, education, and authorized penetration testing. You must have explicit written authorization before running this software against any system you do not own.
This tool is designed for educational purposes only and is intended to assist security professionals in understanding and testing the security of SQL Server environments in authorized engagements.
Acceptable environments include:
- Private lab environments you control (local VMs, isolated networks).
- Sanctioned learning platforms (CTFs, Hack The Box, OffSec exam scenarios).
- Formal penetration-test or red-team engagements with documented customer consent.
Misuse of this project may result in legal action.
Metadata
Release files for mssqlclient-ng 0.9.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mssqlclient_ng-0.9.0.tar.gz | 114.4 kB | Without provenance | Details for mssqlclient_ng-0.9.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mssqlclient_ng-0.9.0-py3-none-any.whl | Python 3 | none | any | Details for mssqlclient_ng-0.9.0-py3-none-any.whl |
Total release size: 280.5 kB
Release files / mssqlclient_ng-0.9.0.tar.gz
| Download URL | mssqlclient_ng-0.9.0.tar.gz |
|---|---|
| Size | 114.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7eee322982ef9529702e6ea7a858c79448cb9dc1ca2f51585493183377be8766
|
|
BLAKE2b-256 checksum How to use checksums |
47296a43e8b5fe7f7d87f3f1be72f5d4d5f5e88e1bd70475a26e3693f3a15ce8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.3 CPython/3.13.9 Linux/6.16.8+kali-amd64
|
Release files / mssqlclient_ng-0.9.0-py3-none-any.whl
| Download URL | mssqlclient_ng-0.9.0-py3-none-any.whl |
|---|---|
| Size | 166.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
20b67f09282e391efac8d51c2e246b6f859db518335207032077a4581c910af4
|
|
BLAKE2b-256 checksum How to use checksums |
9dec77bd2689dd99ba7c42ad05a061758c4081e10222d3a96e0ec3140f98fe8c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.3 CPython/3.13.9 Linux/6.16.8+kali-amd64
|
Security for mssqlclient-ng 0.9.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.