<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Burad&#039;s Blog &#187; security</title>
	<atom:link href="http://www.aburad.com/blog/tag/security/feed" rel="self" type="application/rss+xml" />
	<link>http://www.aburad.com/blog</link>
	<description>A computer nerd who would soon be an MBA</description>
	<lastBuildDate>Thu, 28 Oct 2010 15:53:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2</generator>
		<item>
		<title>View contents of Zip/Jar files using firefox</title>
		<link>http://www.aburad.com/blog/2008/05/view-contents-of-zipjar-files-using-firefox.html</link>
		<comments>http://www.aburad.com/blog/2008/05/view-contents-of-zipjar-files-using-firefox.html#comments</comments>
		<pubDate>Tue, 13 May 2008 20:19:02 +0000</pubDate>
		<dc:creator>burad</dc:creator>
				<category><![CDATA[firefox]]></category>
		<category><![CDATA[hacks]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://aburad.com/blog/?p=231</guid>
		<description><![CDATA[With Firefox 3, you can use firefox browser to view contents of zip/jar files. For viewing contents of filename.zip type following at location bar: jar:file://&#60; full path to filename.zip &#62;!/ Example: jar:file:///home/user/Desktop/filename.zip!/ Also: jar:file:///home/user/Desktop/filename.zip!/dir/file1.js This is specially very useful when you want to see contents (.js, .css, .html files) included in firefox extension&#8217;s jar file. [...]]]></description>
			<content:encoded><![CDATA[<p>With Firefox 3, you can use firefox browser to view contents of zip/jar files.<br />
For viewing contents of filename.zip type following at location bar:</p>
<blockquote><p><strong>jar:file://&lt; full path to filename.zip &gt;!/</strong><br />
<span style="text-decoration: underline;">Example</span>:   jar:file:///home/user/Desktop/filename.zip!/<br />
<span style="text-decoration: underline;">Also:</span> jar:file:///home/user/Desktop/filename.zip!/dir/file1.js</p></blockquote>
<p>This is specially very useful when you want to see contents (.js, .css, .html files) included in firefox extension&#8217;s jar file. After it list the contents, you can easily browse through the directory, sorting files etc.</p>
<p><strong>Update: </strong><span style="text-decoration: underline;"><strong>Security problems that come with jar: protocol</strong></span><br />
While serching for pages related to jar protocol in firefox, I <a href="http://www.gnucitizen.org/blog/web-mayhem-firefoxs-jar-protocol-issues/">found an interesting article</a> at www.gnucitizen.org</p>
<blockquote><p>In simple terms, it means that any application which allows upload of JAR/ZIP files is potentially vulnerable to a persistent <a href="http://aburad.com/blog/2008/04/cross-site-scripting-xss.html">Cross-site Scripting.</a> Potential targets for this attack include applications such as web mail clients, collaboration systems, document sharing systems, almost everything that smells like Web2.0, etc, etc, etc.</p></blockquote>
<p><a href="http://www.gnucitizen.org/blog/bugs-in-the-browser-firefoxs-data-url-scheme-vulnerability">Similar security concerns</a> also arise in data: protocol in firefox. So one need to be careful to filter files you want to allow for upload. Actually, once I had similar situation with a website which allowed you to host image files, but the problem was they were not checking for file types. Thats means you are allowed to upload a php file too. So now you can do anything you want with that server (don&#8217;t ask me what I did <img src='http://www.aburad.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ). So beware of such issues.</p>
<p>Related Post:<br />
<a href="http://aburad.com/blog/2008/05/perfect-password-according-to-firefox.html">Perfect password according to firefox </a><br />
<a href="http://aburad.com/blog/2008/04/view-page-source-trick-in-firefox-flock.html">View Page Source trick in firefox/flock </a><br />
<a href="http://aburad.com/blog/2007/01/firefox-about-pages.html">Firefox about pages</a><br />
<a href="http://aburad.com/blog/2008/04/cross-site-scripting-xss.html">Cross Site Scripting</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.aburad.com/blog/2008/05/view-contents-of-zipjar-files-using-firefox.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Perfect password according to firefox</title>
		<link>http://www.aburad.com/blog/2008/05/perfect-password-according-to-firefox.html</link>
		<comments>http://www.aburad.com/blog/2008/05/perfect-password-according-to-firefox.html#comments</comments>
		<pubDate>Sat, 03 May 2008 21:03:02 +0000</pubDate>
		<dc:creator>burad</dc:creator>
				<category><![CDATA[firefox]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://aburad.com/blog/?p=223</guid>
		<description><![CDATA[I was going through bits of firefox code, and I found the algorithm used by firefox to measure password strength. You can find it in function setPasswordStrength() in this file : chrome://mozapps/content/preferences/changemp.js. So point schema for password strength: For length :       password-length*10 &#8211; 20   (Max 30) For Numbers:    no-of-numerics * 10       [...]]]></description>
			<content:encoded><![CDATA[<p>I was going through bits of firefox code, and I found the algorithm used by firefox to measure password strength. You can find it in function <em>setPasswordStrength()</em> in this file : <a href="chrome://mozapps/content/preferences/changemp.js">chrome://mozapps/content/preferences/changemp.js</a>.<br />
So point schema for password strength:</p>
<blockquote><p><strong>For length :               password-length*10 &#8211; 20   (Max 30)<br />
For Numbers:         no-of-numerics * 10          (Max 30)<br />
For Symbols:           no-of-symbols * 15           (Max 45)<br />
For UpperCase:   no-of-Uppercase * 10        (Max 30)</strong></p></blockquote>
<p>Your password strength is sum of all these points. So smallest password that would get 100 on password meter can be : AAA@@@  or something similar. But there should also be some criterion for the <strong>uniqueness of the characters. </strong></p>
<p>Interesting read-on <a href="http://www.cs.cmu.edu/~help/security/choosing_passwords.html">how to choose good passwords.</a> that are also easy to remember. Please share your tips on choosing passwords [but yeah dont share passwords <img src='http://www.aburad.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ]</p>
<p><em>Extra Cookie</em>:<br />
Type <a href="resource:">resource:</a> in your location bar to directly go to firefox installation directory.</p>
<p>Related:<br />
<a href="http://aburad.com/blog/2006/07/choose-and-remember-great-passwords.html">Choose and remember great passwords.</a><br />
<a href="http://aburad.com/blog/2007/01/firefox-about-pages.html">Firefox about pages</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.aburad.com/blog/2008/05/perfect-password-according-to-firefox.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Cross-site Scripting (XSS)</title>
		<link>http://www.aburad.com/blog/2008/04/cross-site-scripting-xss.html</link>
		<comments>http://www.aburad.com/blog/2008/04/cross-site-scripting-xss.html#comments</comments>
		<pubDate>Tue, 15 Apr 2008 17:58:39 +0000</pubDate>
		<dc:creator>burad</dc:creator>
				<category><![CDATA[hacks]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[Cross-site]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://aburad.com/blog/2008/04/15/cross-site-scripting-xss/</guid>
		<description><![CDATA[Two days back, my shoutbox was hacked . I was not aware that people are actually visiting this, which I made long back to have similar thing for Ethos in june, 2005. After that i haven&#8217;t updated the code and many things were left in between. What actually happened: Cross Site Scripting, when we want [...]]]></description>
			<content:encoded><![CDATA[<p>Two days back, my <a href="http://aburad.com/shoutbox/">shoutbox</a> was hacked <img src='http://www.aburad.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . I was not aware that people are actually visiting this, which I made<a href="http://aburad.com/blog/2005/06/shout-box-2.html"> long back to have similar thing for Ethos</a> in june, 2005. After that i haven&#8217;t updated the code and many things were left in between.</p>
<p><span style="font-style: italic; font-weight: bold;">What actually happened</span>:  Cross Site Scripting, when we want user to input some data (which may be html/javascript) and displays it back. So if html/script tags are not properly checked it can cause trouble. Earlier I hadn&#8217;t checked for javascript, iframe inputs. So somebody just inserted an iframe as message input in my shout box. And the source of iframe contained redirection to another website. So when shouts were displayed on the page the iframe code was displayed as it is and page got redirected to other page.</p>
<p>Luckily I checked the page just after the day this happened, So that way i actually got chance to update this orphaned code and made some fixes.</p>
<p><span style="font-weight: bold; font-style: italic;">Solution :</span> Idea is to filter meta characters such as (&lt; , &gt;, &#8216; , &#8221; etc) Which will prevent browser from processing them as part of some script, they will be processed as plain text only.<br />
So while doing in php you can do:</p>
<p><code>$shout=str_replace("&lt;","&lt;",$_GET["shout"]);</code></p>
<p>And to be on safer side we should also replace following characters:<br />
<code><br />
replace   (       with    (<br />
replace   )       with    )<br />
replace &amp;  with    &amp;<br />
replace   '        with    '<br />
replace   "        with    "<br />
</code><br />
Or If you are not expecting user to input these characters then you can simply replace these with null string;</p>
<p>Update: (25-apr-2008)<br />
You can also use php functions <a href="http://ch2.php.net/manual/en/function.htmlspecialchars.php">htmlspecialchars</a>, <a href="http://ch2.php.net/htmlentities">htmlentities</a>, <a href="http://ch2.php.net/manual/en/function.strip-tags.php">strip_tags</a>.</p>
<p>The replacements which I have mentioned above can be easily done using <a href="http://ch2.php.net/manual/en/function.htmlspecialchars.php">htmlspecialchars</a> but if you want to extend it to all html tags then you can use <a href="http://ch2.php.net/htmlentities">htmlentities</a>. And to strip both html and php tags from string you can use <a href="http://ch2.php.net/manual/en/function.strip-tags.php">strip_tags</a>. The disadvantage with strip_tags is that it doesn&#8217;t validate html so can cause trouble in case of broken html tags. It also provide you option to exclude list of tags from being stripped.</p>
<p>So now you can enjoy <a href="http://aburad.com/shoutbox/">Shout Box</a> until some new bug is found or its hacked again [;)]</p>
<p>Related post:<br />
<a href="http://aburad.com/blog/2006/03/sql-attacks-hacking.html">SQL Attacks: Hacking</a> (SQL injection)</p>
<p>Update(14th May 2008): <a href="http://ha.ckers.org/xss.html">XSS cheatsheet by ha.ckers.org</a> lists possible cross site scripting methods on various browsers.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aburad.com/blog/2008/04/cross-site-scripting-xss.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Choose (and remember) great passwords</title>
		<link>http://www.aburad.com/blog/2006/07/choose-and-remember-great-passwords.html</link>
		<comments>http://www.aburad.com/blog/2006/07/choose-and-remember-great-passwords.html#comments</comments>
		<pubDate>Thu, 06 Jul 2006 04:51:00 +0000</pubDate>
		<dc:creator>burad</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://aburad.com/blog/?p=96</guid>
		<description><![CDATA[Great tips on how to choose password from lifehacker A secure, memorable password is easy for you to remember, and hard for others to guess. Everywhere you turn you&#8217;ve got to come up with a password to register for something or another. Whether it&#8217;s the dozens of web sites that require you log in to [...]]]></description>
			<content:encoded><![CDATA[<p>Great tips on how to choose password from <a href="http://lifehacker.com/software/passwords/geek-to-live-choose-and-remember-great-passwords-184773.php">lifehacker</a></p>
<blockquote><p>A secure, memorable password is easy for you to remember, and hard for others to guess.</p>
<p>Everywhere you turn you&#8217;ve got to come up with a password to register for something or another. Whether it&#8217;s the dozens of web sites that require you log in to use them, or your ATM card PIN, or your wireless network login, how do you decide on a new password? More importantly, how do you remember it?</p>
</blockquote>
<p><a href="http://lifehacker.com/software/passwords/geek-to-live-choose-and-remember-great-passwords-184773.php">Read More &gt;&gt;</a><br />Also <a href="http://en.wikipedia.org/wiki/Diceware">http://en.wikipedia.org/wiki/Diceware</a>&nbsp;&nbsp;  <u><i>Interesting</i></u></p>
]]></content:encoded>
			<wfw:commentRss>http://www.aburad.com/blog/2006/07/choose-and-remember-great-passwords.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Some SSH tips</title>
		<link>http://www.aburad.com/blog/2006/03/some-ssh-tips.html</link>
		<comments>http://www.aburad.com/blog/2006/03/some-ssh-tips.html#comments</comments>
		<pubDate>Sun, 05 Mar 2006 22:11:00 +0000</pubDate>
		<dc:creator>burad</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://aburad.com/blog/?p=51</guid>
		<description><![CDATA[First connecting to a remote host : (althoug trivial) ssh username@remote_host_ipThe first time around it will ask you if you wish to add the remote host to a list of known_hosts, for that you have to say yes . But if case is that it asks such think again than remote server&#8217;s host key is [...]]]></description>
			<content:encoded><![CDATA[<p><span style="font-weight: bold;">First connecting to a remote host : (althoug trivial)</span><br /><span style="font-style: italic;">                 ssh username@remote_host_ip<br /></span>The first time around it will ask you if you wish to add the remote host to a list of known_hosts, for that you have to say yes . But if case is that it asks such think again than remote server&#8217;s host key is changed (such as if SSH was upgraded or the server itself was upgraded). But if there is no upgrade n server side than this may be to trick you into logging into their machine instead so that they can sniff your SSH session.</p>
<p><span style="font-weight: bold;">Now Generating   Key  </span>:<span style="font-weight: bold;"><br /></span>ssh-keygen -t dsa                              // here -t specifies type of key</p>
<p>Generating public/private dsa key pair.<br />Enter file in which to save the key (/home/localuser/.ssh/id_dsa):<br />Enter passphrase (empty for no passphrase):<br />Enter same passphrase again:<br />Your identification has been saved in /home/localuser/.ssh/id_dsa.<br />Your public key has been saved in /home/localuser/.ssh/id_dsa.pub.<br />The key fingerprint is:<br />93:58:20:56:72:d7:bd:14:86:9f:42:aa:82:3d:f8:e5 localuser@mybox.home.co</p>
<p>The reason why you would generate a keyfile is so that you can increase the security of your SSH session by not using your system password. When you generate a key, you are actually generating two key files. One private key and one public key, which is different from the private key. Whenever you connect via ssh to a host that has your public key loaded in the authorized_keys file, it will use a challenge response type of authentication which uses your private key and public key to determine if you should be granted access to that computer It will ask you for your key passphrase though. Now you need to copy to remote machine as :</p>
<p><span style="font-style: italic;">scp ~/.ssh/id_dsa.pub username@remote_machine_ip:.ssh/authorized_keys</p>
<p></span>Now if ssh-agent is running on your machine (Most recent distributions will automatically start ssh-agent) then you can do<br /><span style="font-style: italic;"><br />ssh-add </span></p>
<p>Now you can try logging into that remote machine again and this time you will notice that it just logs you right in without prompting you for any password or passphrase.</p>
<p><span style="font-weight: bold;">X11 -Session Forwarding</p>
<p></span>ssh -X username@remote_machine_ip<br />now you be able to transmit window and bitmap information over a network connection. So essentially you can login to a remote desktop machine and run some X windows program like Gnumeric, Gimp or even Firefox and the program will run on the remote computer, but will display its graphical output on your local computer. If this doen&#8217;t work then you may need to change file <span style="font-style: italic;">/etc/ssh/sshd_config </span>change the following</p>
<p><span style="font-style: italic;">X11Forwarding yes</span><br /><span style="font-style: italic;">X11DisplayOffset 10</span><br /><span style="font-style: italic;">X11UseLocalhost yes</p>
<p></span><span style="font-weight: bold;">TCP Port Forwarding :</p>
<p></span>you can setup a port forward for your connection from your home machine to arvo.suso.org so that it will take connections to localhost port 3066 and forward them to the remote side mysql.suso.org port 3066. for this you can uses<br /><span style="font-style: italic;">ssh -L 3066:mysql.suso.org:3066 username@arvo.suso.org</span><br />The -L (which means Local port) takes one argument of ::, so you specify what host and port the connection will go to on the other side of the SSH connection. When you make a connection to the port, it sends the data through the SSH connection and then connects to : on the other side. From the point of view of , its as if the connection came from the SSH server that you login to. In the case above, arvo.suso.org.</p>
<p>Another useful one is for when you are away from home and can&#8217;t send mail through your home ISP&#8217;s mail server because it only allows local connections to block spam. You can create an SSH tunnel to an SSH server that is local your ISP and then have your GUI mail client like Thunderbird make a connection to localhost port 8025 to send the mail. Here is the command to create the tunnel:<br /><span style="font-style: italic;">ssh -L 8025:smtp.homeisp.net:25 username@shell.homeisp.net</p>
<p></span><span style="font-weight: bold;">Running command over ssh</p>
<p></span><span style="font-style: italic;">ssh username@remotehost_ip ls -al /</span><br />Then you can process the output however you want using the normal shell  conventions</p>
<p><span style="font-weight: bold;">Using SCP<br /></span> if you want to copy a file to a directory relative to the home directory for the  remote user specified.<br /><span style="font-style: italic;">scp filename username@remote.host.net:some_dir/new_filename</span></p>
<p>To copy the file back from the server, you just reverse the from and to<br />scp username@remote.host.net:some_dir/new_filename filename</p>
<p>for copying some director<br /><span style="font-style: italic;">scp -r dir_namel username@remote.host.net:</p>
<p>Updated : <a href="http://dag.wieers.com/howto/ssh-http-tunneling/">http://dag.wieers.com/howto/ssh-http-tunneling/</a><br /></span> for more on ssh tunneling</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aburad.com/blog/2006/03/some-ssh-tips.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>SQL Attacks : Hacking</title>
		<link>http://www.aburad.com/blog/2006/03/sql-attacks-hacking.html</link>
		<comments>http://www.aburad.com/blog/2006/03/sql-attacks-hacking.html#comments</comments>
		<pubDate>Sat, 04 Mar 2006 21:42:00 +0000</pubDate>
		<dc:creator>burad</dc:creator>
				<category><![CDATA[hacks]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[xkcd]]></category>

		<guid isPermaLink="false">http://aburad.com/blog/?p=50</guid>
		<description><![CDATA[Yesterday I was participating an hacking competetion in which at one stage I had login on a page and after that can get to next level . When at first i randomly typed any password. then it gave an sql error that &#8221; zero row selected&#8221; and incorrect password. So I thought of using SQL [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday I was participating an hacking competetion in which at one stage I had login on a page and after that can get to next level . When at first i randomly typed any password. then it gave an sql error that &#8221; zero row selected&#8221; and incorrect password. So I thought of using <span style="font-style: italic;">SQL string injection</span> . SQL is poor in security issues surrounding is the login and url strings. So idea is you give these values in login form :<br />
user : &#8216; OR 1=1&#8211;<br />
password : &#8216; OR 1=1&#8211;</p>
<p>and voila you are in. the other possible strings for password are :</p>
<ul>
<li><span style="font-style: italic;"> &#8216; OR a=a&#8211;</span></li>
<li><span style="font-style: italic;"> &#8216; or 0=0 #</span></li>
<li><span style="font-style: italic;"> &#8220;) or (&#8220;a&#8221;=&#8221;a</span></li>
<li><span style="font-style: italic;"> &#8216;) or (&#8216;a&#8217;='a</span></li>
</ul>
<p>A funny comic strip from xkcd illustrating  sql injection.<a href="http://xkcd.com/327/"><br />
<img src="http://imgs.xkcd.com/comics/exploits_of_a_mom.png" alt="xkcd" width="500" height="166" /></a></p>
<p>So whats the funda behind this :<br />
When you click &#8220;login&#8221; or &#8220;enter&#8221; on webpage the variables &#8216;userid&#8217; and &#8216;password&#8217;  are to sql. The underlying query is :</p>
<p><span style="font-style: italic;">SELECT * from auth_db where username = &#8216; $userid &#8216; AND password = &#8216;$password&#8217;</span></p>
<p>So if you have entered username = admin  and password = test123  then query executed will be :<br />
<span style="font-style: italic;">SELECT * from auth_db where username = &#8216; admin &#8216; AND password = &#8216;test123 &#8216;</span></p>
<p>So in auth_db , if userid and password are correct than corresponding row will be selected and as no of rows returned is &gt; 0 you will be granted access. But if password is incorrect than it will retun zero rows and permission won&#8217;t be granted. But if you use <span style="font-style: italic;">SQL string  injection </span>like if you put &#8216; OR 1=1&#8211; as password and username both than query executed will be :</p>
<p><span style="font-style: italic;">SELECT * from auth_db where username = &#8216; </span><span style="font-style: italic;">&#8216; OR 1=1&#8211;</span><span style="font-style: italic;"> &#8216; AND password = &#8221; OR 1=1&#8211; &#8216;</span></p>
<p>Because a pair of hyphens designate the beginning of a comment in SQL, the query becomes simply becomes :</p>
<p><span style="font-style: italic;">SELECT * from auth_db where username = &#8221; OR 1=1 </span></p>
<p>The expression 1=1 is always true for every row in the table, and a true expression or&#8217;d with another expression will always return true. So, assuming there&#8217;s at least one row in the Users table, this SQL will always return a nonzero count of records.So you are logged in now. And if in some cases But many times sql tries to parse = character in input strings and didn&#8217;t allow to do so, hence trick is using :<br />
&#8216; OR userid LIKE &#8216;%%</p>
<p>So resultant query will be</p>
<p><span style="font-style: italic;">SELECT * from auth_db where username = &#8216; </span>&#8216; OR userid LIKE &#8216;%% <span style="font-style: italic;">&#8216; AND password = &#8221; </span>OR userid LIKE &#8216;%% <span style="font-style: italic;">&#8216;</span><br />
So every string  matches &#8216;%%&#8217;  so it returns non zero number of and you are granted access.<br />
Not all SQL injection attacks involve forms authentication. All it takes is an application with some dynamically constructed SQL and untrusted user input. Most SQL-compliant databases, including SQL Server, store metadata in a series of system tables with the names sysobjects, syscolumns, sysindexes, and so on. This means that a hacker could use the system tables to ascertain schema information for a database to assist in the further compromise of the database. For example, the following text entered into the txtFilter textbox might be used to reveal the names of the user tables in the database:</p>
<pre class="clsCode" style="font-style: italic;">' UNION SELECT id, name, '', 0 FROM sysobjects WHERE xtype ='U' --</pre>
<p>The UNION statement in particular is useful to a hacker because it allows him to splice the results of one query onto another. In this case, the hacker has spliced the names of the user tables in the database to the original query of the Products table. The only trick is to match the number and datatypes of the columns to the original query. The previous query might reveal that a table named Users exists in the database. So after this with multiple queries you can get control over database.</p>
<p>Updated :<br />
Also visit <a href="http://spaces.msn.com/tamsun/Blog/cns%21549A39619D3FADA3%21488.entry">Ten hacker tricks to exploit SQL Server systems</a><br />
<a href="http://us2.php.net/mysql_real_escape_string">http://us2.php.net/mysql_real_escape_string</a><br />
<a href="http://www.unixwiz.net/techtips/sql-injection.html">http://www.unixwiz.net/techtips/sql-injection.html</a><br />
*******************************************************************************<br />
WARNING: the information provided is for educationally purposes only and not to be used for malicious use. i hold no responsibility<br />
********************************************************************************</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aburad.com/blog/2006/03/sql-attacks-hacking.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

