<?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>unixwiz &#187; Security</title>
	<atom:link href="http://blogs.sungeek.net/unixwiz/tag/security/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.sungeek.net/unixwiz</link>
	<description>anything dealing with *NIX or what ever I want to write about</description>
	<lastBuildDate>Fri, 02 Jul 2010 02:28:16 +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>Who&#8217;s knocking on your door?</title>
		<link>http://blogs.sungeek.net/unixwiz/2009/11/24/whos-knocking-on-your-door/</link>
		<comments>http://blogs.sungeek.net/unixwiz/2009/11/24/whos-knocking-on-your-door/#comments</comments>
		<pubDate>Tue, 24 Nov 2009 04:10:52 +0000</pubDate>
		<dc:creator>unixwiz</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[port scan]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://blogs.sungeek.net/unixwiz/?p=1238</guid>
		<description><![CDATA[It seems that the new &#8220;thing&#8221; on the internet these days is port scanning for port 22 (aka SSH).  I was going through my firewall logs on my home router and over the last week or so, it is broken down as follows: country cnt China 2123 Germany 1827 Italy 1460 United States 1115 Russian [...]]]></description>
			<content:encoded><![CDATA[<p>It seems that the new &#8220;thing&#8221; on the internet these days is port scanning for port 22 (aka SSH).  I was going through my firewall logs on my home router and over the last week or so, it is broken down as follows:</p>
<table border=1>
<tr>
<th> country              </th>
<th> cnt  </th>
</tr>
<tr>
<td> China                </td>
<td> 2123 </td>
</tr>
<tr>
<td> Germany              </td>
<td> 1827 </td>
</tr>
<tr>
<td> Italy                </td>
<td> 1460 </td>
</tr>
<tr>
<td> United States        </td>
<td> 1115 </td>
</tr>
<tr>
<td> Russian Federation   </td>
<td>  838 </td>
</tr>
<tr>
<td> Korea, Republic of   </td>
<td>  738 </td>
</tr>
<tr>
<td> Austria              </td>
<td>  692 </td>
</tr>
<tr>
<td> Poland               </td>
<td>  618 </td>
</tr>
<tr>
<td> Spain                </td>
<td>  502 </td>
</tr>
<tr>
<td> Colombia             </td>
<td>  453 </td>
</tr>
<tr>
<td> India                </td>
<td>  441 </td>
</tr>
<tr>
<td> Czech Republic       </td>
<td>  323 </td>
</tr>
<tr>
<td> Ecuador              </td>
<td>  286 </td>
</tr>
<tr>
<td> Romania              </td>
<td>  282 </td>
</tr>
<tr>
<td> Belgium              </td>
<td>  256 </td>
</tr>
<tr>
<td> Chile                </td>
<td>  228 </td>
</tr>
<tr>
<td> Panama               </td>
<td>  201 </td>
</tr>
<tr>
<td> Pakistan             </td>
<td>  199 </td>
</tr>
<tr>
<td> France               </td>
<td>  198 </td>
</tr>
<tr>
<td> Argentina            </td>
<td>  170 </td>
</tr>
<tr>
<td> Canada               </td>
<td>  148 </td>
</tr>
<tr>
<td> Switzerland          </td>
<td>  138 </td>
</tr>
<tr>
<td> Ukraine              </td>
<td>  129 </td>
</tr>
<tr>
<td> Taiwan               </td>
<td>  128 </td>
</tr>
<tr>
<td> Venezuela            </td>
<td>  111 </td>
</tr>
<tr>
<td> Mexico               </td>
<td>  111 </td>
</tr>
<tr>
<td> Denmark              </td>
<td>  105 </td>
</tr>
<tr>
<td> Hungary              </td>
<td>  101 </td>
</tr>
<tr>
<td> Slovenia             </td>
<td>   87 </td>
</tr>
<tr>
<td> Brazil               </td>
<td>   77 </td>
</tr>
<tr>
<td> Guatemala            </td>
<td>   59 </td>
</tr>
<tr>
<td> Uruguay              </td>
<td>   53 </td>
</tr>
<tr>
<td> Estonia              </td>
<td>   50 </td>
</tr>
<tr>
<td> Croatia              </td>
<td>   48 </td>
</tr>
<tr>
<td> Singapore            </td>
<td>   36 </td>
</tr>
<tr>
<td> Australia            </td>
<td>   32 </td>
</tr>
<tr>
<td> Portugal             </td>
<td>   32 </td>
</tr>
<tr>
<td> Hong Kong            </td>
<td>   29 </td>
</tr>
<tr>
<td> Greece               </td>
<td>   25 </td>
</tr>
<tr>
<td> New Zealand          </td>
<td>   24 </td>
</tr>
<tr>
<td> Ireland              </td>
<td>   18 </td>
</tr>
<tr>
<td> Netherlands          </td>
<td>   17 </td>
</tr>
<tr>
<td> Serbia               </td>
<td>   15 </td>
</tr>
<tr>
<td> United Kingdom       </td>
<td>   13 </td>
</tr>
<tr>
<td> South Africa         </td>
<td>   12 </td>
</tr>
<tr>
<td> Malaysia             </td>
<td>    9 </td>
</tr>
<tr>
<td> Thailand             </td>
<td>    8 </td>
</tr>
<tr>
<td> Peru                 </td>
<td>    7 </td>
</tr>
<tr>
<td> Moldova, Republic of </td>
<td>    6 </td>
</tr>
<tr>
<td> Azerbaijan           </td>
<td>    3 </td>
</tr>
<tr>
<td> Turkey               </td>
<td>    2 </td>
</tr>
<tr>
<td> Malta                </td>
<td>    1 </td>
</tr>
<tr>
<td>Total</td>
<td>14585</td>
</tr>
</table>
<p>As a comparison, attempts that were blocked that weren&#8217;t ssh only totaled 1430. So are these bot&#8217;s or people looking for rogue iPhone&#8217;s  or just trying to find new vulnerabilities in SSH? The interesting thing is it appears that each source IP tries 3 times. The second try is 3 seconds after the first and the third is 6 seconds after the second.</p>
<p>An interesting IP is 217.70.139.42, which has tried 303 times since the 14th. The IP is from Germany and also appears on several SSH dictionary attacks. So is it time to start running services on non-standard ports?</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.sungeek.net/unixwiz/2009/11/24/whos-knocking-on-your-door/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Another Internet Explorer exploit</title>
		<link>http://blogs.sungeek.net/unixwiz/2009/11/22/another-internet-explorer-exploit/</link>
		<comments>http://blogs.sungeek.net/unixwiz/2009/11/22/another-internet-explorer-exploit/#comments</comments>
		<pubDate>Sun, 22 Nov 2009 16:10:54 +0000</pubDate>
		<dc:creator>unixwiz</dc:creator>
				<category><![CDATA[M$ Winders]]></category>
		<category><![CDATA[MacOSX]]></category>
		<category><![CDATA[Random Stuff]]></category>
		<category><![CDATA[Rant]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[IE]]></category>
		<category><![CDATA[WIndows]]></category>

		<guid isPermaLink="false">http://blogs.sungeek.net/unixwiz/?p=1236</guid>
		<description><![CDATA[Just released, another exploit to Internet Explorer 6 &#38; 7, that allows &#8220;hackers&#8221; to install software on your machine&#8230; What do the major Antivirus people say: &#8220;To minimize the chances of being affected by this issue, Internet Explorer users should ensure their antivirus definitions are up to date, disable JavaScript and only visit Web sites [...]]]></description>
			<content:encoded><![CDATA[<p>Just released, another exploit to Internet Explorer 6 &amp; 7, that allows &#8220;hackers&#8221; to install software on your machine&#8230; What do the major Antivirus people say:</p>
<p>&#8220;To minimize the chances of being affected by this issue, Internet Explorer users should ensure their antivirus definitions    are up to date, disable JavaScript and only visit Web sites they trust until fixes are available from Microsoft,&#8221; Symantec    said.</p>
<p>How many mom and pop&#8217;s out there even know how to disable java script, and only visit sites they trust? Let alone make sure their antivirus definitions are updated. I have seen some virus trick Symantec&#8217;s AV in to thinking the definitions were up to date, and then I go to find hundreds of virus&#8217; on my parents computer. This is just another reason why building the web browser in to the OS is a bad thing and why it should be sandbox&#8217;d off in to its own little area.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.sungeek.net/unixwiz/2009/11/22/another-internet-explorer-exploit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPhone security patch</title>
		<link>http://blogs.sungeek.net/unixwiz/2009/09/16/iphone-security-patch/</link>
		<comments>http://blogs.sungeek.net/unixwiz/2009/09/16/iphone-security-patch/#comments</comments>
		<pubDate>Thu, 17 Sep 2009 01:11:20 +0000</pubDate>
		<dc:creator>unixwiz</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[CERT-US]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://blogs.sungeek.net/unixwiz/?p=1214</guid>
		<description><![CDATA[It seems that Apple finally released a patch for the iPhone about the security issue I wrote about back on May 1st (More Security Stuff) From Apple&#8217;s Web Site: WebKit CVE-ID: CVE-2009-2797 Available for: iPhone OS 1.0 through 3.0.1, iPhone OS for iPod touch 1.1 through 3.0 Impact: User names and passwords in URLs may [...]]]></description>
			<content:encoded><![CDATA[<p>It seems that Apple finally released a patch for the iPhone about the security issue I wrote about back on May 1st (<a href="http://blogs.sungeek.net/unixwiz/2009/05/01/more-security-stuff/">More Security Stuff</a>) </p>
<p>From Apple&#8217;s Web Site:</p>
<blockquote><p>WebKit</p>
<p>CVE-ID: CVE-2009-2797</p>
<p>Available for: iPhone OS 1.0 through 3.0.1, iPhone OS for iPod touch 1.1 through 3.0</p>
<p>Impact: User names and passwords in URLs may be disclosed to linked sites</p>
<p>Description: Safari includes the user name and password from the original URL in the referer header. This may lead to the disclosure of sensitive information. This update addresses the issue by not including user names and passwords in referer headers. Credit to James A. T. Rice of Jump Networks Ltd for reporting this issue.</p></blockquote>
<p>Not sure when James reported it though. So I don&#8217;t know if I found it before him or not. <strong>Anyways, here is my suggestion, if you use an iPhone and have EVER logged in to a web site with a username and password, you need to change that password immediately and then apply the patch from Apple to your iPhone. I know there are some people who view my site that use an iPhone and are clicking on links from other websites, therefore sending your username and password to me as well. </strong></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.sungeek.net/unixwiz/2009/09/16/iphone-security-patch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>More nambu security issues</title>
		<link>http://blogs.sungeek.net/unixwiz/2009/05/04/more-nambu-security-issues/</link>
		<comments>http://blogs.sungeek.net/unixwiz/2009/05/04/more-nambu-security-issues/#comments</comments>
		<pubDate>Tue, 05 May 2009 00:13:22 +0000</pubDate>
		<dc:creator>unixwiz</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[MacOS]]></category>
		<category><![CDATA[Nambu]]></category>

		<guid isPermaLink="false">http://blogs.sungeek.net/unixwiz/?p=1112</guid>
		<description><![CDATA[So as if it weren&#8217;t bad enough that every message you send is logged with your username and password in the system.log&#8230; They decided to log the userid and password in clear text in the sqllite database that it stores information in. Funny all you have to do is a: strings ~/Application Support/Nambu/Nambu.db and the [...]]]></description>
			<content:encoded><![CDATA[<p>So as if it weren&#8217;t bad enough that every message you send is logged with your username and password in the system.log&#8230; They decided to log the userid and password in clear text in the sqllite database that it stores information in. Funny all you have to do is a:</p>
<p>strings ~/Application Support/Nambu/Nambu.db</p>
<p>and the second line will contain your userid and password. They keep saying that it is because they are in beta, and when they move to production, it will go to the encrypted keychain, yadda yadda yadda. But these little things should have been done from the begining&#8230; Just wondering why people do stupid security stuff like this&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.sungeek.net/unixwiz/2009/05/04/more-nambu-security-issues/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>More security stuff</title>
		<link>http://blogs.sungeek.net/unixwiz/2009/05/01/more-security-stuff/</link>
		<comments>http://blogs.sungeek.net/unixwiz/2009/05/01/more-security-stuff/#comments</comments>
		<pubDate>Sat, 02 May 2009 02:10:50 +0000</pubDate>
		<dc:creator>unixwiz</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://blogs.sungeek.net/unixwiz/?p=1109</guid>
		<description><![CDATA[Because I am in that sort of mood tonight I started looking at other log files to see what kinda crap I could find. So it appears that the iPhone has a bug where it seems to like to send the Userid and Password for Websites that you log in to as a referring link [...]]]></description>
			<content:encoded><![CDATA[<p>Because I am in that sort of mood tonight I started looking at other log files to see what kinda crap I could find.</p>
<p>So it appears that the iPhone has a bug where it seems to like to send the Userid and Password for Websites that you log in to as a referring link if you click on an outside link from inside an protected place.  Say what?  Well let me explain some more:</p>
<p>Say I set up a password protected web site that uses an htaccess style password protection. I then go to that web site, say http://somecoolsite.com/protected. If the userid and password is stored or used in the URL, say I had the user id of unixwiz and my password was IamCool, and I went to the web site with http://unixwiz:IamCool@somecoolsite.com/protected&#8230; Once inside the protected site, I then click on a link to some external site, for example http://mycoolsite.com, the iPhone is sending the refering URL as http://unixwiz:IamCool@somecoolsite.com/protected/ .. Which you guessed it, shows up on mycoolsite.com&#8217;s access log if they have referrer logging set up, or are doing anything that captures referr data. I would be interested in seeing if it still does it if you are prompted to enter your username and password and not save it.  How cool is that, with the amount of people using iPhone&#8217;s now, wonder how many people are looking at the logs to see this sort of data&#8230;.</p>
<p>FWIW</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.sungeek.net/unixwiz/2009/05/01/more-security-stuff/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nambu problems</title>
		<link>http://blogs.sungeek.net/unixwiz/2009/05/01/nambu-problems/</link>
		<comments>http://blogs.sungeek.net/unixwiz/2009/05/01/nambu-problems/#comments</comments>
		<pubDate>Sat, 02 May 2009 00:56:19 +0000</pubDate>
		<dc:creator>unixwiz</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[MacOS X]]></category>
		<category><![CDATA[Nambu]]></category>

		<guid isPermaLink="false">http://blogs.sungeek.net/unixwiz/?p=1105</guid>
		<description><![CDATA[I had been playing with Nambu until I was working in blender tonight and had the OSX console up and running.. What did I see it logs the user and password in the clear in the system.log file&#8230; BAD BAD BAD!!!!! Their response, &#8220;it is beta software so it does extensive logging&#8230;&#8221; Well you don&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p>I had been playing with Nambu until I was working in blender tonight and had the OSX console up and running.. What did I see it logs the user and password in the clear in the system.log file&#8230; BAD BAD BAD!!!!! Their response, &#8220;it is beta software so it does extensive logging&#8230;&#8221; Well you don&#8217;t need to log the freaking password and username in the CLEAR. Needless to say no more nambu till they fix that..</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.sungeek.net/unixwiz/2009/05/01/nambu-problems/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ultra Restricted Shell in Solaris</title>
		<link>http://blogs.sungeek.net/unixwiz/2009/02/19/ultra-restricted-shell-in-solaris/</link>
		<comments>http://blogs.sungeek.net/unixwiz/2009/02/19/ultra-restricted-shell-in-solaris/#comments</comments>
		<pubDate>Fri, 20 Feb 2009 03:18:06 +0000</pubDate>
		<dc:creator>unixwiz</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[rbash]]></category>
		<category><![CDATA[readonly shell]]></category>

		<guid isPermaLink="false">http://blogs.sungeek.net/unixwiz/?p=1068</guid>
		<description><![CDATA[How to setup a readonly environment on Solaris: If you want to give a specific user readonly access to your solaris machine via ssh, and want to log everything they do, it is sort of easy to setup. Here is a quick step-by-step guide to setting it up. 1. First you will need to chose [...]]]></description>
			<content:encoded><![CDATA[<p>How to setup a readonly environment on Solaris:</p>
<p>If you want to give a specific user readonly access to your solaris machine via ssh, and want to log everything they do, it is sort of easy to setup. Here is a quick step-by-step guide to setting it up.</p>
<p>1. First you will need to chose what restricted shell you want to use. In this case I used bash as I wanted the .bash_history file to contain the exact time every command was run on the system. Since Solaris does not come with the rbash command, the only thing you need to do is make a copy of /usr/bin/bash to /usr/bin/rbash. </p>
<p>2. Make the user&#8217;s shell be /usr/bin/rbash, this will make them use the restricted bash shell. </p>
<p>3. Make their home directory owned by root. </p>
<p>4. Make their .profile owned by root</p>
<p>5. Create a .bash_history file and make it owned by that user. This should be the only file in their directory that is owned by the user. </p>
<p>6. Pick a location for your &#8220;restricted&#8221; binaries to reside. If this user will be logging in to multiple machines and you have a shared file system (say /home) I would suggest making the directory in /home; say /home/rbin.. This way you only have to put /home/rbin in their PATH.</p>
<p>7. Make symbolic links in your restricted binary directory to the binaries you want to run. I.e. ls, ps, more, prstat,passwd and hostname :</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;">lrwxrwxrwx &nbsp; <span class="nu0">1</span> root &nbsp; &nbsp; root &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="nu0">17</span> Feb <span class="nu0">19</span> <span class="nu0">20</span>:<span class="nu0">47</span> <span class="kw2">hostname</span> -&gt; /usr/bin/<span class="kw2">hostname</span>*<br />
lrwxrwxrwx &nbsp; <span class="nu0">1</span> root &nbsp; &nbsp; root &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="nu0">11</span> Feb <span class="nu0">19</span> <span class="nu0">19</span>:<span class="nu0">56</span> <span class="kw2">ls</span> -&gt; /usr/bin/<span class="kw2">ls</span>*<br />
lrwxrwxrwx &nbsp; <span class="nu0">1</span> root &nbsp; &nbsp; root &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="nu0">13</span> Feb <span class="nu0">19</span> <span class="nu0">19</span>:<span class="nu0">57</span> <span class="kw2">more</span> -&gt; /usr/bin/<span class="kw2">more</span>*<br />
lrwxrwxrwx &nbsp; <span class="nu0">1</span> root &nbsp; &nbsp; root &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="nu0">15</span> Feb <span class="nu0">19</span> <span class="nu0">19</span>:<span class="nu0">56</span> prstat -&gt; /usr/bin/prstat*<br />
lrwxrwxrwx &nbsp; <span class="nu0">1</span> root &nbsp; &nbsp; root &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="nu0">11</span> Feb <span class="nu0">19</span> <span class="nu0">19</span>:<span class="nu0">56</span> <span class="kw2">ps</span> -&gt; /usr/bin/<span class="kw2">ps</span>*<br />
lrwxrwxrwx &nbsp; <span class="nu0">1</span> root &nbsp; &nbsp; root &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="nu0">11</span> Feb <span class="nu0">19</span> <span class="nu0">19</span>:<span class="nu0">56</span> <span class="kw2">passwd</span> -&gt; /usr/bin/<span class="kw2">passwd</span>*</div>
</div>
<p>By making these sym links instead of the actual binaries, you do not have to worry if you have multiple platforms that you are going between (i.e. Sparc, x86) and doing custom logic to use the right binary.</p>
<p>8. Create the users .profile with the following in it:</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;"><span class="kw3">readonly</span> <span class="re2">PATH=</span>/home/rbin<br />
<span class="kw3">readonly</span> <span class="re2">TMOUT=</span><span class="nu0">900</span><br />
<span class="kw3">readonly</span> <span class="re2">EXTENDED_HISTORY=</span>ON<br />
<span class="kw3">readonly</span> <span class="re2">HOSTNAME=</span><span class="st0">&quot;`hostname`&quot;</span><br />
<span class="kw3">readonly</span> <span class="kw3">export</span> <span class="re2">HISTTIMEFORMAT=</span><span class="st0">&quot;%F %T &quot;</span><br />
<span class="kw3">readonly</span> <span class="kw3">export</span> <span class="re2">PS1=</span><span class="st0">&#8216;${HOSTNAME}:${PWD}&gt; &#8216;</span></div>
</div>
<p>This will make it so they can not change any of the Environment variables. It sets their path to /home/rbin. Sets a inactivity time out to be 15 minutes. Sets the extended history to be on (this logs the time each command was executed in their .bash_history file). And finally sets their prompt and makes it readonly as well.</p>
<p>9. The last thing you need to do is change the permissions on the scp and sftp-server binaries so that the user can not execute them. Otherwise, they would be able to download files and go any where on the server they want. (Restricted shell will prevent them from cd&#8217;ing out of their home directory) To do this, I created a group and put my user in it as their primary group. Say the group was called rdonly. Now I do the following:</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;">setfacl -m group:rdonly:&#8212; /usr/lib/<span class="kw2">ssh</span>/sftp-server<br />
setfacl -m group:rdonly:&#8212; /usr/bin/<span class="kw2">scp</span></div>
</div>
<p>So the files should show up like this now:</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;">bash<span class="nu0">-3.00</span><span class="re3"># <span class="kw2">ls</span> -la /usr/lib/<span class="kw2">ssh</span>/sftp-server /usr/bin/scp</span><br />
-r-xr-xr-x+ &nbsp;<span class="nu0">1</span> root &nbsp; &nbsp; bin &nbsp; &nbsp; &nbsp; &nbsp;<span class="nu0">40484</span> Jan <span class="nu0">22</span> &nbsp;<span class="nu0">2005</span> /usr/bin/<span class="kw2">scp</span><br />
-r-xr-xr-x+ &nbsp;<span class="nu0">1</span> root &nbsp; &nbsp; bin &nbsp; &nbsp; &nbsp; &nbsp;<span class="nu0">35376</span> Jan <span class="nu0">22</span> &nbsp;<span class="nu0">2005</span> /usr/lib/<span class="kw2">ssh</span>/sftp-server</div>
</div>
<p>And the getfacl will look like this:</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;">bash<span class="nu0">-3.00</span><span class="re3"># getfacl /usr/bin/scp</span></p>
<p><span class="re3"># <span class="kw2">file</span>: /usr/bin/scp</span><br />
<span class="re3"># owner: root</span><br />
<span class="re3"># group: bin</span><br />
user::r-x<br />
group::r-x &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="re3">#effective:r-x</span><br />
group:rdonly:&#8212; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re3">#effective:&#8212;</span><br />
mask:r-x<br />
other:r-x</div>
</div>
<p>This makes it so when the user tries to sftp or scp in to the machine, it will immediately disconnect them as they don&#8217;t have permissions to run those 2 executables.</p>
<p>That is about it. Don&#8217;t forget to set their password, make sure it has a policy set on it to be changed often and require a combination of letters, numbers and special characters and that it is at least 8 characters in length.</p>
<p>So now when the user logs in they will see something similar to this:</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;"><span class="br0">&#91;</span>laptop:~<span class="br0">&#93;</span> unixwiz% <span class="kw2">ssh</span> unixwiz@fozzy<br />
Password: <br />
Last <span class="kw2">login</span>: Thu Feb <span class="nu0">19</span> <span class="nu0">22</span>:<span class="nu0">10</span>:<span class="nu0">15</span> <span class="nu0">2009</span> from laptop<br />
fozzy:/home/unixwiz&gt; <span class="kw3">cd</span> /<br />
-<span class="kw2">rbash</span>: <span class="kw3">cd</span>: restricted<br />
fozzy:/home/unixwiz&gt; vi /tmp/<span class="kw3">test</span><br />
-<span class="kw2">rbash</span>: vi: <span class="kw3">command</span> not found<br />
fozzy:/home/unixwiz&gt; <span class="re2">PATH=</span><span class="re1">$PATH</span>:/usr/bin<br />
-<span class="kw2">rbash</span>: PATH: <span class="kw3">readonly</span> variable<br />
fozzy:/home/unixwiz&gt; timed out waiting <span class="kw1">for</span> input: auto-<span class="kw3">logout</span></div>
</div>
<p>As you can see, it will give you errors if you try to do something that you are not allowed to do. The last line shows the time out message where it closes the connection due to inactivity.</p>
<p>Now if the administrator goes and looks at the users .bash_history file they would see this:</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;"><span class="re3">#<span class="nu0">1235099570</span></span><br />
<span class="kw3">cd</span> /<br />
<span class="re3">#<span class="nu0">1235099577</span></span><br />
vi /tmp/<span class="kw3">test</span><br />
<span class="re3">#<span class="nu0">1235099587</span></span><br />
<span class="re2">PATH=</span><span class="re1">$PATH</span>:/usr/bin</div>
</div>
<p>The #number is the exact time that the user ran the command below it. The item is the seconds since the epoch&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.sungeek.net/unixwiz/2009/02/19/ultra-restricted-shell-in-solaris/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AIX Most secure OS? Think not.</title>
		<link>http://blogs.sungeek.net/unixwiz/2009/02/15/aix-most-secure-os-think-not/</link>
		<comments>http://blogs.sungeek.net/unixwiz/2009/02/15/aix-most-secure-os-think-not/#comments</comments>
		<pubDate>Sun, 15 Feb 2009 22:44:48 +0000</pubDate>
		<dc:creator>unixwiz</dc:creator>
				<category><![CDATA[AIX]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Interesting]]></category>
		<category><![CDATA[MacOSX]]></category>
		<category><![CDATA[Random Stuff]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[Rant]]></category>

		<guid isPermaLink="false">http://blogs.sungeek.net/unixwiz/?p=1061</guid>
		<description><![CDATA[IBM&#8217;s Xforce published their new 2008 annual report. In it they had this chart: Surprising is that IBM put&#8217;s one of their own OS&#8217;s near the bottom of the list. Some of my opinions are : 1. No one uses AIX that much, so no one looks for holes in the code. 2. Any one [...]]]></description>
			<content:encoded><![CDATA[<p>IBM&#8217;s Xforce published their new 2008 annual report.  In it they had this chart:<br />
<img src="http://blogs.sungeek.net/unixwiz/wp-content/uploads/2009/02/xforce2008.png" alt="xforce2008" title="xforce2008" width="515" height="690" class="alignnone size-full wp-image-1062" /></p>
<p>Surprising is that IBM put&#8217;s one of their own OS&#8217;s near the bottom of the list. Some of my opinions are :</p>
<p>1. No one uses AIX that much, so no one looks for holes in the code.<br />
2. Any one who uses AIX, doesn&#8217;t have it directly connected to the Internet.<br />
3. It is so cost prohibitive to use, that people are looking at Solaris/Linux or Windows to run their business on.</p>
<p>But the funniest thing about this is the last I used AIX the following were still done on install by IBM:<br />
1. telnet enabled<br />
2. root logins allowed remotely<br />
3. no ssh comes with the OS, you have to install a crappy &#8220;linux toolkit&#8221;, and then install another 10 different packages to get SSH enabled.<br />
4. No RBAC<br />
5. Syslog configuration does not exist<br />
6. Root does not even have a password on install</p>
<p>Seems to me that IBM needs to fix some fundamental issues with their OWN OS before they can say it is not one of the &#8220;Most Vulnerable Operating Systems&#8221;.</p>
<p>The funniest issue with this is for MacOSX to be listed at the top, all most all of those require some one to actually run something on the machine with administrative privileges.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.sungeek.net/unixwiz/2009/02/15/aix-most-secure-os-think-not/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>MySQL root password recovery</title>
		<link>http://blogs.sungeek.net/unixwiz/2009/02/05/mysql-root-password-recovery/</link>
		<comments>http://blogs.sungeek.net/unixwiz/2009/02/05/mysql-root-password-recovery/#comments</comments>
		<pubDate>Fri, 06 Feb 2009 02:50:43 +0000</pubDate>
		<dc:creator>unixwiz</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Random Stuff]]></category>
		<category><![CDATA[Password Recovery]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://blogs.sungeek.net/unixwiz/?p=1053</guid>
		<description><![CDATA[Quick steps to recovering (aka resetting) the root password on MySQL: 1. Find the PID of the mysql process ps -aef &#124; grep mysqld root 11889 11090 &#160; 0 &#160; Jun 10 ? &#160; &#160; &#160; &#160; &#160; 0:00 /bin/sh bin/safe_mysqld mysql 11909 11889 &#160; 0 &#160; Jun 10 ? &#160; &#160; &#160; &#160; 525:44 [...]]]></description>
			<content:encoded><![CDATA[<p>Quick steps to recovering (aka resetting) the root password on MySQL:</p>
<p>1. Find the PID of the mysql process </p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;"><span class="kw2">ps</span> -aef | <span class="kw2">grep</span> mysqld<br />
root <span class="nu0">11889</span> <span class="nu0">11090</span> &nbsp; <span class="nu0">0</span> &nbsp; Jun <span class="nu0">10</span> ? &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">0</span>:<span class="nu0">00</span> /bin/<span class="kw2">sh</span> bin/safe_mysqld<br />
mysql <span class="nu0">11909</span> <span class="nu0">11889</span> &nbsp; <span class="nu0">0</span> &nbsp; Jun <span class="nu0">10</span> ? &nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">525</span>:<span class="nu0">44</span> /<span class="kw3">local</span>/mysql<span class="nu0">-5.0</span><span class="nu0">.45</span>-solaris10-i386/bin/mysqld &#8211;<span class="re2">basedir=</span>/<span class="kw3">local</span>/mysql<span class="nu0">-5.0</span><span class="nu0">.45</span>-sol</div>
</div>
<p>2. Kill the mysql process;
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;"><span class="kw2">kill</span> <span class="nu0">11909</span></div>
</div>
<p> Make sure not to use a -9&#8230;<br />
3. Create a file that the user that runs mysql can access; and place in it the following:</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;"><span class="kw1">UPDATE</span> mysql.user <span class="kw1">SET</span> Password=PASSWORD<span class="br0">&#40;</span><span class="st0">&#8216;FozzyBear&#8217;</span><span class="br0">&#41;</span> <span class="kw1">WHERE</span> User=<span class="st0">&#8216;root&#8217;</span>;<br />
<span class="kw1">FLUSH</span> PRIVILEGES;</div>
</div>
<p>4. Start mysql:
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;">mysqld_safe &#8211;init-<span class="re2">file=</span>/path/to/<span class="kw2">file</span> &amp;</div>
</div>
<p>5. Try to connect as root now, if it works, delete the temp file; stop and restart mysql.</p>
<p>Granted, the above can be done by any one who knows the password for the account that MySQL runs under, or has root access to the machine. I usually leave the mysql UNIX account in a locked state, so no one can su to it, so you have to have access to root, to be able to su to it.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.sungeek.net/unixwiz/2009/02/05/mysql-root-password-recovery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Monster hacked again</title>
		<link>http://blogs.sungeek.net/unixwiz/2009/01/23/monster-hacked-again/</link>
		<comments>http://blogs.sungeek.net/unixwiz/2009/01/23/monster-hacked-again/#comments</comments>
		<pubDate>Sat, 24 Jan 2009 03:27:52 +0000</pubDate>
		<dc:creator>unixwiz</dc:creator>
				<category><![CDATA[Funny]]></category>
		<category><![CDATA[Random Stuff]]></category>
		<category><![CDATA[Rant]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://blogs.sungeek.net/unixwiz/?p=1039</guid>
		<description><![CDATA[Couldn&#8217;t believe that monster.com was hacked again. So I went to change my password on there, and this is what it showed me when I tried to use a 30 character password: needless to say, I had to settle with a 14 character password before I just deleted the account all together. Hopefully their delete [...]]]></description>
			<content:encoded><![CDATA[<p>Couldn&#8217;t believe that monster.com was hacked again. So I went to change my password on there, and this is what it showed me when I tried to use a 30 character password:</p>
<p><img src="http://blogs.sungeek.net/unixwiz/wp-content/uploads/2009/01/picture-3.png" alt="picture-3" title="picture-3" width="749" height="180" class="alignnone size-full wp-image-1040" /></p>
<p>needless to say, I had to settle with a 14 character password before I just deleted the account all together. Hopefully their delete is really a delete. Kinda funny when the 30 character password I used was : TMG5IRWX4_hP5_Oi7Zh_N5oLXkeWP_</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.sungeek.net/unixwiz/2009/01/23/monster-hacked-again/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
