<?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>Jtanium's Notebook &#187; Security</title>
	<atom:link href="http://www.jtanium.com/category/security/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jtanium.com</link>
	<description>I jot things down, in hopes of finding them later...</description>
	<lastBuildDate>Wed, 21 Dec 2011 23:21:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Limit Access to WordPress Admin</title>
		<link>http://www.jtanium.com/2009/11/30/limit-access-to-wordpress-admin/</link>
		<comments>http://www.jtanium.com/2009/11/30/limit-access-to-wordpress-admin/#comments</comments>
		<pubDate>Mon, 30 Nov 2009 16:31:47 +0000</pubDate>
		<dc:creator>jtanium</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[brute force]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.jtanium.com/2009/11/30/limit-access-to-wordpress-admin/</guid>
		<description><![CDATA[This entry on the Internet Storm Center&#8217;s Handler&#8217;s Diary was about &#8220;Distributed WordPress admin account cracking&#8221; &#8212; scary stuff. In the the article they suggest limiting the addresses from which the admin can be accessed. If you&#8217;re using Apache, here&#8217;s one way using the &#60;Location&#62; directive: &#60;Location /wp-admin&#62; Order Deny,Allow Deny from all Allow from [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://isc.sans.org/diary.html?n&#038;storyid=7663">This entry</a> on the Internet Storm Center&#8217;s Handler&#8217;s Diary was about &#8220;Distributed WordPress admin account cracking&#8221; &#8212; scary stuff.</p>
<p>In the the article they suggest limiting the addresses from which the admin can be accessed.  If you&#8217;re using Apache, here&#8217;s one way using the <a href="http://httpd.apache.org/docs/2.2/mod/core.html#location">&lt;Location&gt; directive</a>:</p>
<pre>
&lt;Location /wp-admin&gt;
   Order Deny,Allow
   Deny from all
   Allow from example.com 10.211.34.83
&lt;/Location&gt;
&lt;Location /wp-login.php&gt;
   Order Deny,Allow
   Deny from all
   Allow from example.com 10.211.34.83
&lt;/Location&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.jtanium.com/2009/11/30/limit-access-to-wordpress-admin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Your Baby Is Dead!</title>
		<link>http://www.jtanium.com/2009/04/10/your-baby-is-dead/</link>
		<comments>http://www.jtanium.com/2009/04/10/your-baby-is-dead/#comments</comments>
		<pubDate>Fri, 10 Apr 2009 19:18:54 +0000</pubDate>
		<dc:creator>jtanium</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[Rant]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[antivirus]]></category>
		<category><![CDATA[dss]]></category>
		<category><![CDATA[pci]]></category>

		<guid isPermaLink="false">http://www.jtanium.com/?p=125</guid>
		<description><![CDATA[That&#8217;s what you&#8217;d hear if your Linux server fell victim to the thousands of malware attacks lurking in the average network. That is, according to the PCI DSS. I read the PCI DSS Summary of Changes. It&#8217;s pretty much business as usual until you get to 5.1. That&#8217;s where you find this little gem: Clarified [...]]]></description>
			<content:encoded><![CDATA[<p>That&#8217;s what you&#8217;d hear if your Linux server fell victim to the <em>thousands</em> of malware attacks lurking in the average network.</p>
<p>That is, according to the PCI DSS.  I read the <a href="https://www.pcisecuritystandards.org/pdfs/pci_dss_summary_of_changes_v1-2.pdf">PCI DSS Summary of Changes</a>.  It&#8217;s pretty much business as usual until you get to 5.1.  That&#8217;s where you find this little gem:</p>
<blockquote><p>Clarified requirement applies to all operating systems types commonly affected by malicious software, if applicable anti-virus technology exists.</p></blockquote>
<p>Okay, sounds good.</p>
<blockquote><p>Besides use of the term “anti-virus software,” changed the term “virus” to “malicious software.”</p></blockquote>
<p>Good call, no doubt someone has tried to wriggle out of compliance using that excuse.</p>
<blockquote><p>Deleted note stating “Systems commonly affected by viruses typically do not include UNIX-based operating systems or mainframes.”
</p></blockquote>
<p>WTF?!?!?!?  Is this some kind of twisted April Fool&#8217;s prank.<br />
::Channelling Brian Regan::</p>
<blockquote><p>&#8220;Hey, come here; look what I put for Section Five. Did you see? I just did it as a joke but it&#8217;s going out like that. It&#8217;s already on the website. I don&#8217;t know what to do.&#8221;<br />
&#8220;Just let it go I guess.  There&#8217;s nothing you can do now.&#8221;</p></blockquote>
<p>Raise your hand if you&#8217;ve ever seen a Unix box infected with a virus.  Yeah, me neither.</p>
<p>It doesn&#8217;t take much imagination to figure out where this comes from.  There&#8217;s a lot of big money that doesn&#8217;t like Unix boxes getting a free pass for pretty much all of Section 5 of the DSS.</p>
<p>To unravel this &#8220;mystery&#8221; let&#8217;s start by figuring out who <strong>*loses*</strong> money by Unix not needing anti-malware&#8230; Yeah it&#8217;s Microsoft.  You have to think they&#8217;ve been shoving money in the pocket&#8217;s of PCI over this.  After all, if businesses realize that they can save money by switching to Linux, especially in the current economic climate, they&#8217;re gonna do it.  And what business wouldn&#8217;t, switching to Linux saves you the outrageous anti-malware fees and the exorbitant Windows license fees.</p>
<p>Now, besides Microsoft, who stands to benefit from this?  Of course the answer is the anti-malware venders: Symantec, McAfee, TrendMicro, Sophos, AVG (formerly Grisoft), Kaspersky (I&#8217;m not going to dignify them with links).  If you want some good laughs go read what these guys have to say about Unix viruses.</p>
<p>McAfee, <a href="http://www.mcafee.com/us/about/press/corporate/2006/20060505_12524_u.html">circa 2006</a>:</p>
<blockquote><p>Macintosh platform vulnerability discovery rates have increased by 228 percent in the past three years alone&#8230;</p></blockquote>
<p><strong>Translation:</strong> <em>Your baby is dead!</em><br />
To their credit, they did follow that up with:</p>
<blockquote><p>&#8230;from 45 found in 2003 to 143 in 2005</p></blockquote>
<p>Holy hell!  Please McAfee, take my money, just protect me!</p>
<p>Sophos, <a href="http://www.sophos.com/pressoffice/news/articles/2008/02/rstbtool.html">February 13th, 2008</a>, says of the Linux/Rst-B virus:</p>
<blockquote><p>Analysis of malware in Sophos&#8217;s Linux honeypots have shown almost 70 percent of the infections are due to this six-year-old malicious program.</p></blockquote>
<p><strong>Translation:</strong> <em>Your baby is dead!</em><br />
Holy hell!  Nooooo! Not the honeypots! Those things highly secure!  It takes mad 733t skillz to pwn a honeypot! Lots of critical thinking going on there.<br />
In that same press release, I liked this:</p>
<blockquote><p>&#8220;&#8230;we hope that Linux users who aren&#8217;t running security will at least run this tool to find out if they are infected with this granny virus.&#8221;</p></blockquote>
<p>Ha ha, &#8220;granny virus,&#8221; awesome.  And are you &#8220;running security&#8221; on your Linux box?  What exactly does that mean?  No matter, I wrote my own Linux/Rst-B scanner, check it:</p>
<pre>#!/usr/local/bin/bash
echo "Scanning for Linux/Rst-B virus..."
sleep(5)
echo "No virus detected!"</pre>
<p>To Sophos&#8217; credit the did put this in:</p>
<blockquote><p>Hackers typically gain control via weak SSH password or some other vulnerability.</p></blockquote>
<p>But that&#8217;s it.  The rest of the time it&#8217;s &#8220;Linux viruses are taking over! Give us lots of money, and we&#8217;ll protect you!&#8221;</p>
<p>Here&#8217;s the only place where you can argue Unix anti-malware makes sense: email and file servers. Let those servers be good Samaritans and catch the Windows viruses before they are spread around.  It&#8217;s a waste anywhere else.</p>
<p>That being said, one could argue running anti-malware on a Unix box does more harm than good.  It&#8217;s more than the obvious sucking up resources.  My biggest problem is running anti-malware on a box adds one more attack vector an attacker has.  Historically, there have been many instances where anti-malware software has made people more vulnerable, my favorite being <a href="http://secunia.com/advisories/18131/">this one</a>.</p>
<p>Finally, I want to add that viruses are already becoming passe.  Okay maybe not for Windows, but certainly Unix.  Just look at the pwn2own contest. Yeah, the Mac fell in like two minutes, but it had <strong>*nothing*</strong> to do with a virus, or any kind of malware that&#8217;s going to be detected.  And that&#8217;s the point. Linux, OS X, and other Unix OSes are not going to be taken by traditional malware.  Any attacker worth his salt is gonna do it through the web browser.  Email: lame.  Open ports: too much work.  SSH: maybe.  Web browser: booyah!</p>
<p>The web browser is the ultimate vector, because you as a user, are giving some portion of control of your computer to a remote machine. Just look at the recent OS X viruses, they change your system network settings so your traffic goes to the bad guys site.  Oh snap!</p>
<p>At any rate, PCI removing the statement that Unix systems are not commonly affected by malware has no basis in reality and exists <strong>*soley*</strong> to make big, slow, outdated, technology companies more money.</p>
<p>That&#8217;s bad enough in and of itself.  But what makes it worse is the fact that PCI auditors are just an army of box ticking robots.  Seriously.  Trying to reason with one is an exercise in futility.</p>
<p>Now the worst part:  There&#8217;s nothing we can do about it.  PCI can come up with any bull shit, cockamamie rule they feel like, and you have comply or you&#8217;re out of business.  Rant off.</p>
<p>P.S. &#8211; To any box ticking robots that read this, get off your Huffy and write to me.  I&#8217;m not an auditor, what&#8217;s your side of the story.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jtanium.com/2009/04/10/your-baby-is-dead/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Compile OPIE on OS X</title>
		<link>http://www.jtanium.com/2007/04/12/compile-opie-on-os-x/</link>
		<comments>http://www.jtanium.com/2007/04/12/compile-opie-on-os-x/#comments</comments>
		<pubDate>Thu, 12 Apr 2007 16:43:06 +0000</pubDate>
		<dc:creator>jtanium</dc:creator>
				<category><![CDATA[OS X]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://jtanium.dsl.xmission.com/blog/?p=30</guid>
		<description><![CDATA[So I needed to get the One-time Passwords In Everything (OPIE) client running on my Mac. The last message in the README dates 1998, but the client, at least, isn&#8217;t too difficult to get working on a Mac. Out of the box, compilation fails with this: login.c:79: error: 'struct utmpx' has no member named 'ut_name' [...]]]></description>
			<content:encoded><![CDATA[<p>So I needed to get the <a href="http://www.inner.net/~cmetz/opie">One-time Passwords In Everything</a> (OPIE) client running on my Mac.  The last message in the README dates 1998, but the client, at least, isn&#8217;t too difficult to get working on a Mac.  Out of the box, compilation fails with this:
<pre>
login.c:79: error: 'struct utmpx' has no member named 'ut_name'
</pre>
<p>To fix this, open <code>opie-2.4/libopie/login.c</code> and change line 79 from:
<pre>
  strncpy(u.ut_name, name, sizeof(u.ut_name));
</pre>
<p>to
<pre>
  strncpy(u.ut_user, name, sizeof(u.ut_user));
</pre>
<p>I&#8217;m not anywhere near smart enough to figure that out on my own, but <a href="http://www.google.com/search?q=%27struct+utmpx%27+has+no+member+named+%27ut_name%27">this Google search</a> lead me to <a href="http://mirrors.usc.edu/pub/gnu/Manuals/glibc-2.2.3/html_chapter/libc_29.html">this page</a>, which gave the clue to do this.  After you make this change, opie will compile, but won&#8217;t install because it looks for <code>chown</code> in <code>/bin</code>, so after monkeying with the make files and what not, I gave up and just created symlink, like so: <code>sudo ln -s /usr/sbin/chown /bin/chown</code>.</p>
<p>To save time, I created a new archive with the change I made, it&#8217;s available <a href='/blog/wp-content/uploads/2007/08/opie-24_jtaniumtar.gz' title='opie-2.4_jtanium.tar.gz'>here</a>.  The code was released under the Naval Research Laboratory (NRL) license which appears to be a derivative of the UC Berkley license.  As far as I can tell, this is not the &#8216;BSD&#8217; license, but is similar, so I don&#8217;t think I&#8217;m in violation of the license by redistributing this.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jtanium.com/2007/04/12/compile-opie-on-os-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adware on OS X</title>
		<link>http://www.jtanium.com/2006/12/01/24/</link>
		<comments>http://www.jtanium.com/2006/12/01/24/#comments</comments>
		<pubDate>Fri, 01 Dec 2006 16:17:28 +0000</pubDate>
		<dc:creator>jtanium</dc:creator>
				<category><![CDATA[OS X]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://jtanium.dsl.xmission.com/blog/?p=24</guid>
		<description><![CDATA[I came across this post about the cnet article on some adware for OS X. Since I don&#8217;t like to create accounts on every site I visit, and Rom&#8217;s blog requires you to be logged in to comment, I&#8217;ll write the comment on my site. Rom wrote &#8220;I am curious as to how this is [...]]]></description>
			<content:encoded><![CDATA[<p>I came across <a title="Adware on Mac" href="http://rom.feria.name/blog/2006/11/29/adware-on-mac/">this post</a> about the <a title="Adware sample targets Mac OS X" target="_blank" href="http://news.com.com/Adware+sample+targets+Mac+OS+X/2100-7349_3-6138772.html?tag=nefd.top">cnet article</a> on some adware for OS X.</p>
<p>Since I don&#8217;t like to create accounts on every site I visit, and Rom&#8217;s blog requires you to be logged in to comment, I&#8217;ll write the comment on my site.</p>
<p>Rom wrote &#8220;I am curious as to how this is achieved specially when you are not running as administrator and all applications that you use are saved at the default /Applications, which require admin privileges for write access.&#8221;</p>
<p>So how does this happen?  To find the answer, go to your Mac, bust out a terminal, and do a long listing on the /Applications directory (<code>ls -l /Applications</code>).  You&#8217;ll see something like this:</p>
<pre>drwxrwxr-x    3 root      admin       102 Sep 28 23:41 Address Book.app
drwxrwxr-x    5 jtanium  admin       170 Nov 11 22:00 Adobe Reader 7.0.8
drwxrwxr-x    6 root      admin       204 Nov  9 19:57 AppleScript
drwxrwxr-x    3 root      admin       102 Sep 28 23:45 Automator.app
drwxrwxr-x    3 root      admin       102 Aug 20 04:56 Calculator.app
drwxr-xr-x    3 jtanium  admin       102 Sep 11 05:30 Camino.app
drwxrwxr-x    3 root      admin       102 Aug 20 03:52 Chess.app
drwxr-xr-x    3 jtanium jtanium    102 Nov  1 21:30 CocoaMySQL_0.7b5.app
drwxr-xr-x    3 jtanium  admin       102 Sep 28 15:16 CrossOver.app
drwxrwxr-x    3 root      admin       102 Sep 28 23:37 DVD Player.app
drwxrwxr-x    3 root      admin       102 Sep 11 20:37 Dashboard.app
drwxr-xr-x    3 jtanium  admin       102 Nov 10 07:18 DbVisualizer.app
drwxr-xr-x    3 jtanium  admin       102 Nov  9 16:24 Delicious Library.app
drwxrwxr-x    3 root      admin       102 Apr 21  2005 Dictionary.app
drwxr-xr-x    4 jtanium  admin       136 Nov 10 07:09 Firefox.app
drwxrwxr-x    7 root      admin       238 Nov 12 11:48 Flip4Mac
drwxrwxr-x    3 root      admin       102 May 27  2005 Font Book.app
drwxrwxr-x    3 root      admin       102 Nov  9 20:37 GarageBand.app
drwxr-xr-x    3 jtanium  admin       102 Jul 27 01:11 Google Notifier.app
drwxrwxrwx   15 root      admin       510 Nov 12 15:42 Hewlett-Packard
drwxrwxr-x    3 root      admin       102 Aug 20 00:36 Image Capture.app
drwxr-xr-x   13 jtanium  admin       442 Jun 15 04:45 IntelliJ IDEA 5.1.2.app
drwxrwxr-x    3 root      admin       102 Sep 28 22:11 Internet Connect.app
drwxrwxr-x    3 root      admin       102 Mar  3  2005 Mail.app
drwxrwxr-x    3 jtanium  admin       102 Nov 10 07:30 Microsoft AutoUpdate.app
drwxrwxr-x   16 jtanium  admin       544 Nov 10 07:41 Microsoft Office 2004
drwxr-xr-x    3 jtanium  admin       102 Aug  2 13:41 OmniGraffle Professional.app
drwxrwxr-x    3 root      admin       102 Mar 14  2006 OmniOutliner.app
drwxrwxr-x    3 jtanium  admin       102 Sep 19 02:49 Opera.app
drwxrwxr-x    3 root      admin       102 Aug  4 12:31 Photo Booth.app
drwxrwxr-x    3 root      admin       102 Sep 11 20:44 Preview.app
drwxrwxr-x    3 root      admin       102 Nov 10 06:48 QuickTime Player.app
drwxrwxr-x    3 root      admin       102 Feb 10  2005 Safari.app
drwxrwxr-x    3 root      admin       102 Sep 28 23:42 Sherlock.app
drwxr-xr-x    3 jtanium  admin       102 Aug  5 15:34 Shiira.app
drwxrwxr-x    3 root      admin       102 Aug 20 06:36 Stickies.app
drwxr-xr-x    4 jtanium  admin       136 Sep 21 06:37 StuffIt 11
drwxrwxr-x    3 root      wheel       102 Aug 20 05:06 System Preferences.app
drwxrwxr-x    3 root      admin       102 Aug 20 06:31 TextEdit.app
drwxr-xr-x    3 jtanium  admin       102 Nov  1 21:22 TextMate.app
drwxrwxr-x   30 root      admin      1020 Nov 12 15:41 Utilities
drwxr-xr-x    3 jtanium  admin       102 May  6  2006 VLC.app
drwxr-xr-x    3 root      wheel       102 Nov 10 07:20 VPNClient.app
drwxrwxr-x    3 root      admin       102 Aug 22 18:48 iCal.app
drwxrwxr-x    3 root      admin       102 Aug 20 14:20 iChat.app
drwxrwxr-x    3 root      admin       102 Nov  9 20:37 iDVD.app
drwxrwxr-x    3 root      admin       102 Nov  9 20:37 iMovie HD.app
drwxrwxr-x    3 root      admin       102 Nov  9 20:37 iPhoto.app
drwxrwxr-x    3 root      admin       102 Aug 20 06:57 iSync.app
drwxr-xr-x    3 jtanium  wheel       102 Nov  9 13:56 iTerm.app
drwxrwxr-x    3 root      admin       102 Nov 10 06:56 iTunes.app</pre>
<p>See what&#8217;s happening? When you install applications by copying the .app folder to /Applications, OS X, as I understand it, uses sudo to do the copy, hence it prompts you for your password.  However you only need sudo to *create* the directory in /Applications, which is owned by root:admin. sudo will maintain the ownership of the files it&#8217;s copying.  And I&#8217;m sure the vast majority of Mac users are in this situation.</p>
<p>Now here&#8217;s the fun part: what do you do to fix the situation?  Well, everytime you install an app you just need to open a terminal, and execute <code>sudo chown -Rf root:admin /Application/AppYouJustInstalled.app</code>.  Unfortunately I can&#8217;t recommend this practice wholeheartedly.  If you&#8217;ve ever tried to run OS X on a case sensitive file system, you&#8217;ve probably found third party apps (notably, MS Office and Photoshop), have a lot of issues &#8212; I&#8217;m worried changing ownership to root:admin would cause similar problems.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jtanium.com/2006/12/01/24/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

