<?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>HauntedShell &#187; radius</title>
	<atom:link href="http://hauntedshell.com/tag/radius/feed/" rel="self" type="application/rss+xml" />
	<link>http://hauntedshell.com</link>
	<description>Just another Hauntedshell.com weblog</description>
	<lastBuildDate>Sat, 01 May 2010 20:05:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Does your RADIUS server think &quot;user&quot; = &quot;USER&quot;?</title>
		<link>http://hauntedshell.com/2009/10/20/does-your-radius-server-think-user-user/</link>
		<comments>http://hauntedshell.com/2009/10/20/does-your-radius-server-think-user-user/#comments</comments>
		<pubDate>Tue, 20 Oct 2009 12:45:23 +0000</pubDate>
		<dc:creator>Kwame</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[freeradius]]></category>
		<category><![CDATA[radius]]></category>
		<category><![CDATA[wireless]]></category>

		<guid isPermaLink="false">http://www.hauntedshell.com/uncategorized/does-your-radius-server-think-user-user/</guid>
		<description><![CDATA[If you happen to manage a hotspot that uses Freeradius with the sql module for authentication, you might want to pay attention. The default queries used by Freeradius sql module are case-insensitive. So if user &#8220;kwame&#8221; is successfully authenticated, another user &#8220;Kwame&#8221; can also successfully autheticate. And so can &#8220;KWAME&#8221;, &#8220;kwamE&#8221;, &#8220;KwaMe&#8221; and so on [...]]]></description>
			<content:encoded><![CDATA[<p>If you happen to manage a hotspot that uses Freeradius with the sql module for authentication, you might want to pay attention. The default queries used by Freeradius sql module are case-insensitive. So if user &#8220;kwame&#8221; is successfully authenticated, another user &#8220;Kwame&#8221; can also successfully autheticate. And so can<span id="more-157"></span> &#8220;KWAME&#8221;, &#8220;kwamE&#8221;, &#8220;KwaMe&#8221; and so on for that matter. I guess you can see where I&#8217;m going with this: if any of your users should catch on to this&#8230; And to think, this hadn&#8217;t crossed my mind till a friend who runs a wireless isp pointed out some strange activity he had noticed in his logs.</p>
<p>You shouldn&#8217;t forget to make a small change to the <em>/etc/freeradius/sql/mysql/dialup.conf(or </em><em>/etc/freeradius/sql.conf</em>) file. Somewhere around line 82 lies the following:</p>
<pre>#######################################################################
        # Use these for case sensitive usernames.
#        authorize_check_query = "SELECT id, username, attribute, value, op \
#         FROM ${authcheck_table} \
#         WHERE username = BINARY '%{SQL-User-Name}' \
#         ORDER BY id"
#        authorize_reply_query = "SELECT id, username, attribute, value, op \
#         FROM ${authreply_table} \
#         WHERE username = BINARY '%{SQL-User-Name}' \
#         ORDER BY id"

        # The default queries are case insensitive. (for compatibility with
        # older versions of FreeRADIUS)
       authorize_check_query = "SELECT id, username, attribute, value, op \
          FROM ${authcheck_table} \
          WHERE username = '%{SQL-User-Name}' \
          ORDER BY id"
       authorize_reply_query = "SELECT id, username, attribute, value, op \
          FROM ${authreply_table} \
          WHERE username = '%{SQL-User-Name}' \
          ORDER BY id"
</pre>
<p>This should be:</p>
<pre>#######################################################################
        # Use these for case sensitive usernames.
        authorize_check_query = "SELECT id, username, attribute, value, op \
         FROM ${authcheck_table} \
         WHERE username = BINARY '%{SQL-User-Name}' \
         ORDER BY id"
        authorize_reply_query = "SELECT id, username, attribute, value, op \
         FROM ${authreply_table} \
         WHERE username = BINARY '%{SQL-User-Name}' \
         ORDER BY id"

        # The default queries are case insensitive. (for compatibility with
        # older versions of FreeRADIUS)
#       authorize_check_query = "SELECT id, username, attribute, value, op \
#          FROM ${authcheck_table} \
#          WHERE username = '%{SQL-User-Name}' \
#          ORDER BY id"
#       authorize_reply_query = "SELECT id, username, attribute, value, op \
#          FROM ${authreply_table} \
#          WHERE username = '%{SQL-User-Name}' \
#          ORDER BY id"
</pre>
<p>And if you apply your attributes per group instead of per user, like I do, then this:</p>
<pre>
        # Use these for case sensitive usernames.
#        group_membership_query = "SELECT groupname \
#        FROM ${usergroup_table} \
#         WHERE username = BINARY '%{SQL-User-Name}' \
#        ORDER BY priority"

       group_membership_query = "SELECT groupname \
          FROM ${usergroup_table} \
          WHERE username = '%{SQL-User-Name}' \
          ORDER BY priority"
</pre>
<p>should become:</p>
<pre>
        # Use these for case sensitive usernames.
        group_membership_query = "SELECT groupname \
        FROM ${usergroup_table} \
         WHERE username = BINARY '%{SQL-User-Name}' \
        ORDER BY priority"

#       group_membership_query = "SELECT groupname \
#          FROM ${usergroup_table} \
#          WHERE username = '%{SQL-User-Name}' \
#          ORDER BY priority"
</pre>
<p>Reload the freeradius server and your usernames should be case sensitive. Now, go and buy yourself a beer in celebration of your valiant victory against the dark forces of computer insecurity.</p>
]]></content:encoded>
			<wfw:commentRss>http://hauntedshell.com/2009/10/20/does-your-radius-server-think-user-user/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
