02.06.2013 Views

analisi e gestione della sicurezza di una complessa applicazione ...

analisi e gestione della sicurezza di una complessa applicazione ...

analisi e gestione della sicurezza di una complessa applicazione ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CAPITOLO VI - Gli attacchi e il progetto OWASP<br />

per scopi illeciti. Per accorgersi <strong>di</strong> quanto può essere rischioso, pensiamo ai seguenti messaggi,<br />

nei panni <strong>di</strong> un cyber criminale:<br />

“Microsoft OLE DB Provider for ODBC Drivers error ‘80040e14’<br />

[Microsoft][ODBC SQL Server Driver][SQL Server]<br />

All queries in an SQL statement containing a UNION operator must have an equal number of<br />

expressions in their target lists”<br />

Il messaggio precedente rivela alcune preziose informazioni: il tipo <strong>di</strong> piattaforma (Microsoft<br />

Windows), il tipo <strong>di</strong> database (SQL Server tramite ODBC) ed il particolare che la query SQL,<br />

molto probabilmente introdotta dall’utente, non combacia in numero con i parametri specificati<br />

nell’istruzione presente nel co<strong>di</strong>ce. A questo punto conosciamo il nostro target e possiamo<br />

scegliere opportune funzioni del DBMS per costruire la nostra SQL Injection. Con alta<br />

probabilità il nostro attacco andrà a buon fine.<br />

Anche il semplice File Not Found piuttosto <strong>di</strong> un Access Denied può essere un’informazione<br />

utile per un hacker, per non parlare degli stack trace, come è possibile vedere nell’esempio,<br />

dove vengono mostrate parte <strong>di</strong> co<strong>di</strong>ce:<br />

Access to the path "C:\WINNT\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET<br />

Files\root\c0c02afa\19017b74" is denied.<br />

Description: An unhandled exception occurred during the execution of the current web request.<br />

Please review the stack trace for more information about the error and where it originated in<br />

the code.<br />

Exception Details: System.UnauthorizedAccessException: Access to the path<br />

"C:\WINNT\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET<br />

Files\root\c0c02afa\19017b74" is denied.<br />

ASP.NET is not authorized to access the requested resource. Consider granting access rights<br />

to the resource to the ASP.NET request identity. ASP.NET has a base process identity<br />

(typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6) that is used if the<br />

144

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!