<?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>Blog &#187; Security</title>
	<atom:link href="http://blog.builtbyprime.com/category/security/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.builtbyprime.com</link>
	<description>Prime Studios</description>
	<lastBuildDate>Tue, 20 Dec 2011 00:02:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Send Time Limited Secure Logins with timebomb.it</title>
		<link>http://blog.builtbyprime.com/security/send-time-limited-secure-logins-with-timebomb-it</link>
		<comments>http://blog.builtbyprime.com/security/send-time-limited-secure-logins-with-timebomb-it#comments</comments>
		<pubDate>Fri, 27 Aug 2010 16:55:47 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[primestudios]]></category>

		<guid isPermaLink="false">http://blog.primestudiosllc.com/?p=903</guid>
		<description><![CDATA[Today we officially launched a new web and mobile application timebomb.it, making it easy and more secure to send confidential login information from one person to another. You can think of it as a secure URL shortener for sending logins. &#8230; <a href="http://blog.builtbyprime.com/security/send-time-limited-secure-logins-with-timebomb-it">Read more...</a>]]></description>
			<content:encoded><![CDATA[<p>Today we officially launched a new web and mobile application <a href="https://timebomb.it">timebomb.it</a>, making it easy and more secure to send confidential login information from one person to another. You can think of it as a secure URL shortener for sending logins. <strong>All it takes is one person to break into a computer or email client, or one phone to be lost for an attacker to gain access to some really confidential stuff.</strong> We bet a search for &#8220;login&#8221;, &#8220;username&#8221;, or &#8220;password&#8221; in most email boxes will come up with something useful for a hacker, and this is why we ask you to <a href="https://timebomb.it">timebomb.it</a> next time you need to send confidential information.</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-964" style="margin-top: 15px; margin-bottom: 15px;" title="timebombit-screenshots-preview" src="http://blog.primestudiosllc.com/wp-content/uploads/timebombit-screenshots-preview.jpg" alt="" width="645" height="443" /></p>
<p style="text-align: center;">1) Create a Link. 2) View it, send it, blow it up.</p>
<h3>Put Hackers Against the Clock</h3>
<p>As a development company, we either require, or maintain login information for servers, mail accounts, or applications for our clients- all of which are generally secured by a username and password. So when we need login information, we get it in an email. This confidential information remains in our sent folder, the clients inbox, and maybe on some of our mobile devices (if we choose to sync them). We decided we needed a way to send confidential information, but not have it linger inside an email client. Timebomb.it creates random URL&#8217;s for logins, with the option to blow it up in 1-hour, 1-day, or 1-week. Now we just send that link over, and know that if a hacker gets a hold of our computer in a year, our email account isn&#8217;t peppered with our clients usernames and passwords.</p>
<h3>A Simple Interface, Because it Should Be</h3>
<p>Our background in mobile webapps gave us the tools to make this thing mobile-ready out of the box. Using HTML5, CSS3, and custom jQuery scripts, we are seeing sub-500ms load times on a regular internet connection. The only images used are on the <a href="https://timebomb.it/about">timebomb.it about page</a>, which is full-width for most screens, and scales seamlessly on a mobile device. We figure with some of the odd situations you could use timebomb.it for, you want it viewable on a phone, quick to access, and easy to read:</p>
<p>- You need the alarm code for your grandmas garage door (just use the password field)<br />
- You want your mom to send you the logins to your AT&amp;T account<br />
- Your co-worker emailed you asking for the credentials to the computer in the testing lab<br />
- You reset the combination-code door lock on your office building, and want to inform your employees</p>
<p>Once you have created a link, we even have the option to &#8220;Blow it Up&#8221;; not only because it is fun to blow things up, but because you might decide you no longer want the information available. Each data field uses a mix of custom Flash and Javascript enabling a cross-browser click-to-copy feature. We set out for a professional design so users trust it, and super-transparency with the presentation of information- hopefully you agree this is a &#8220;mission accomplished&#8221;.</p>
<h3>Passwords love encryption, give them some love.</h3>
<p>We use an SSL encrypted connection, or HTTPS, to transfer all information to and from timebomb.it over the internet. This means people snooping your network can&#8217;t get a hold of anything you type in, or look at. Our databases are also completely encrypted, expired links are deleted every hour, and no link is ever used twice. Our servers have brute force detection, strict firewalls, and are behind bullet proof glass with armed guards (thanks Media Temple). We currently use a 10-character alpha-numeric random string to generate links; this means there are 3,656,158,440,062,979 (3.65 quadrillion) links available. Put it this way, the odds someone winning the lottery, getting struck by lighting, and dating a supermodel in their lifetime are better than their chance of finding a timebomb.it link (remember, links must expire within a week).</p>
<h3>CIA: Confidentiality, Integrity, Availability</h3>
<p>This acronym represents the three widely accepted components of information security. We have described how we address confidentiality and integrity using some great technology, but the most important aspect is availability. Sure, random URL&#8217;s may not be a great idea to send nuclear launch codes, but its a heck of a lot better than sending them in a plain-text email. In security we make trade-offs, and we know that if a system is too hard to use, or takes too long to access, it will get scrapped. Our mission is to provide something really secure, and to force people to think about things like security and password management, while not slowing them down.</p>
<h3>Thats a Wrap, plus an API with a Wrapper</h3>
<p>We never want to leave our automation-loving, UI-enhancing developers without something neat and exciting, and this is why we made a simple API and PHP wrapper, check it out: <a href="http://blog.primestudiosllc.com/security/timebomb-it-api-and-php-wrapper-class">timebomb.it API and PHP Wrapper Class</a>. Please make sure to leave you thoughts in the comments, we hope you all enjoy this little tool.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.builtbyprime.com/security/send-time-limited-secure-logins-with-timebomb-it/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>timebomb.it API and PHP Wrapper Class</title>
		<link>http://blog.builtbyprime.com/security/timebomb-it-api-and-php-wrapper-class</link>
		<comments>http://blog.builtbyprime.com/security/timebomb-it-api-and-php-wrapper-class#comments</comments>
		<pubDate>Fri, 27 Aug 2010 16:48:44 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://blog.primestudiosllc.com/?p=831</guid>
		<description><![CDATA[If you haven&#8217;t read anything about our newest web and mobile app timebomb.it, make sure to stop by Send Time Limited Secure Logins with timebomb.it. Lets take a look at the simple API we made so developers can use timebomb.it &#8230; <a href="http://blog.builtbyprime.com/security/timebomb-it-api-and-php-wrapper-class">Read more...</a>]]></description>
			<content:encoded><![CDATA[<p>If you haven&#8217;t read anything about our newest web and mobile app <a target="_blank" href="https://timebomb.it">timebomb.it</a>, make sure to stop by <a href="http://blog.primestudiosllc.com/security/send-time-limited-secure-logins-with-timebomb-it">Send Time Limited Secure Logins with timebomb.it</a>. Lets take a look at the simple API we made so developers can use timebomb.it for anything they please. Remember, you must have an API key to use it- just <a target="_blank" href="http://www.primestudiosllc.com">contact us</a> and we&#8217;ll shoot one right back to you.</p>
<h3>Using the API with JSON</h3>
<p>We require four pieces of information for the API to process successfully: the API key, a username, a password, and an expiration value. If you have tried out timebomb.it, this should make perfect sense. The API is accessed through the following URL structure:</p>
<p><strong>https://timebomb.it/api/json/APIKEY/USERNAME/PASSWORD/EXPIRATION</strong></p>
<p>The only somewhat non-standard entry is the EXPIRATION value. This will be set to either a 1, 2, or 3, corresponding to 1-hour, 1-day, or 1-week expiration time respectively. The output will be a JSON encoded string with the following keys:</p>
<p><strong>username</strong> : provided username<br />
<strong>password</strong> : provided password<br />
<strong>url</strong> : timebomb generated URL<br />
<strong>expiration</strong> : seconds until link expires<br />
<strong>created</strong> : unix timestamp</p>
<p>Example Input:</p>
<p><strong>https://timebomb.it/api/json/Y8dqEisNoAChS6AFmwyQ1LoJ/elvis/bluesuedeshoes/1</strong></p>
<p>Example output:</p>
<p><strong>{&#8220;username&#8221;:&#8221;elvis&#8221;,&#8221;password&#8221;:&#8221;bluesuedeshoes&#8221;,&#8221;url&#8221;:<br />
 <span style="margin-left:25px;">&#8220;https:\/\/timebomb.it\/4dewszeaoa&#8221;,&#8221;expiration&#8221;:3600,&#8221;created&#8221;:1282529729}</span></strong></p>
<p>We suggest reading the HTTP header status in order to gain details on the success or failure of the request. The following statuses are returned based on the request:</p>
<p><strong>Status = 202</strong> : Request Successful<br />
<strong>Status = 404</strong> : Request Denied, Check Data Structure<br />
<strong>Status = 500</strong> : Request Denied, Possible timebomb.it Error</p>
<h3>PHP Wrapper Class using cURL</h3>
<p>We have created a basic PHP wrapper that can be used as a standalone class, making it pretty simple to integrate timebomb.it into your application. Of course it&#8217;s not perfect, that will be subject to your application, but it will get you off the ground quickly. We are using the PHP library cURL, which you probably have if PHP is installed on your server, otherwise look at <a target="_blank" href="http://curl.haxx.se/docs/install.html">How to Install cURL for PHP</a>. Below is the standard usage for the <strong>timebomb.class.php</strong> wrapper.</p>
<pre class="brush: php; title: ;">
&lt;?php
require_once('timebomb.class.php');
$tb = new Timebomb();

$data = array(
	&quot;key&quot;=&gt;&quot;Y8dqEisNoAChS6AFmwyQ1LoJ&quot;,
	&quot;username&quot;=&gt;&quot;elvis&quot;,
	&quot;password&quot;=&gt;&quot;bluesuedeshoes&quot;,
	&quot;expiration&quot;=&gt;&quot;1&quot;
	);

$timebomb = $tb-&gt;create_link($data);

if($timebomb['success'])	{
	echo $timebomb['url'];
}	else	{
	echo $timebomb['message'];
}

/*$timebomb_data array elements
	$timebomb['success'] : TRUE or FALSE
	$timebomb['message'] : status message
	$timebomb['username'] : provided username
	$timebomb['password'] : provided password
	$timebomb['url'] : TimeBomb generated URL
	$timebomb['expiration'] : seconds until link expires
	$timebomb['created'] : unix timestamp
*/

//Use for auto-generated passwords
//$password = $tb-&gt;create_password();
</pre>
<p>We have added a simple password generator to the <strong>timebomb.class.php</strong> wrapper as well, just in case you want to produce them on the fly. The &#8220;timebomb&#8221; array returned from the class is described above in the PHP comments, and provides all the important information about the created link, or if there was an error. Below is the source for the <strong>timebomb.class.php</strong> wrapper, and we have provided both of these files in a ZIP package for convenience.</p>
<pre class="brush: php; title: ;">
&lt;?php
class Timebomb	{

	function create_link($timebomb_info)	{
		$url = implode('/',$timebomb_info);

		$ch = curl_init('https://timebomb.it/api/json/'.$url);
		curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0');
		curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
		curl_setopt($ch, CURLOPT_HEADER, 1);
		$curl_data = curl_exec($ch);
		$curl_info = curl_getinfo($ch);
		curl_close($ch);

		if($curl_data != FALSE)	{
			$timebomb_data['status'] = $curl_info['http_code'];

			switch ($timebomb_data['status']) {
				case 202:
					$json_data = substr($curl_data, $curl_info['header_size']);
					$timebomb_data = json_decode($json_data,TRUE);
					$timebomb_data['success'] = TRUE;
					$timebomb_data['message'] = 'Congrats, your TimeBomb link was created.';
					return $timebomb_data;
					break;
				case 404:
					$timebomb_data['success'] = FALSE;
					$timebomb_data['message'] = 'Please check your inputs and make sure you have a valid TimeBomb API key.';
					return $timebomb_data;
					break;
				case 500:
					$timebomb_data['success'] = FALSE;
					$timebomb_data['message'] = 'TimeBomb may have blown itself up, please try again.';
					return $timebomb_data;
					break;
				default:
					$timebomb_data['message'] = 'Houston, we have a problem with something, not sure who to pin it on right now.';
					$timebomb_data['success'] = FALSE;
					return $timebomb_data;
			}
		}
		$timebomb_data['message'] = 'The cURL process failed.';
		$timebomb_data['success'] = FALSE;
		return $timebomb_data;
	}

	function create_password($length=12) {
		$chars = array_merge(range('a', 'z'),range('A', 'Z'),range(0, 9));
		$password ='';
		for($i=0;$i &lt; $length;$i++) {
		   $password .= $chars[mt_rand(0,count($chars)-1)];
		}
		return $password;
	}
}
</pre>
<p><a href="http://blog.primestudiosllc.com/wp-content/uploads/timebomb-class-php-package.zip">Download the timebomb.class.php ZIP Package</a></p>
<h3>Final Remarks</h3>
<p>If you would like to contribute, collaborate, or provide feedback to our <a href="https://timebomb.it">timebomb.it</a> project, please be sure to visit the <a href="http://www.primestudiosllc.com/">Prime Studios Homepage</a>, or comment on this post. Happy coding everybody.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.builtbyprime.com/security/timebomb-it-api-and-php-wrapper-class/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Screencast: Using sFTP with SSH, and why FTP is Insecure</title>
		<link>http://blog.builtbyprime.com/security/using-sftp-with-ssh-and-why-ftp-is-insecure</link>
		<comments>http://blog.builtbyprime.com/security/using-sftp-with-ssh-and-why-ftp-is-insecure#comments</comments>
		<pubDate>Tue, 17 Aug 2010 16:38:48 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://blog.primestudiosllc.com/?p=813</guid>
		<description><![CDATA[As a developer, your world might crumble without using FTP (File Transfer Protocol). Oh how we love our port 21, uploading and downloading everything in plain text. However, if you are at all worried about security and integrity of your &#8230; <a href="http://blog.builtbyprime.com/security/using-sftp-with-ssh-and-why-ftp-is-insecure">Read more...</a>]]></description>
			<content:encoded><![CDATA[<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="635" height="357" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://vimeo.com/moogaloop.swf?clip_id=14213195&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=0&amp;show_portrait=0&amp;color=ffffff&amp;fullscreen=1&amp;autoplay=0&amp;loop=0" /><embed type="application/x-shockwave-flash" width="635" height="357" src="http://vimeo.com/moogaloop.swf?clip_id=14213195&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=0&amp;show_portrait=0&amp;color=ffffff&amp;fullscreen=1&amp;autoplay=0&amp;loop=0" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>As a developer, your world might crumble without using FTP (File Transfer Protocol). Oh how we love our port 21, uploading and downloading everything in plain text. However, if you are at all worried about security and integrity of your (and your clients) data and information, you would be much better suited using an encrypted file transfer method like sFTP- the &#8220;s&#8221; standing for &#8220;SSH&#8221;, or &#8220;secure&#8221;.</p>
<p>In our video we talk about the importance of data encryption across the wire, as well as over the air, and show how attackers can take advantage of non-encrypted data transfer. Our alternative to FTP is sFTP, which utilizes the SSH (Secure Shell) protocol for file transfers, providing a fully [public key] encrypted path for the data to flow. We are essentially mitigating any MITM (Man in the Middle) attacks, or network sniffing; where an attacker simply jumps onto your network and steals confidential information as it flows. By using encrypted data transfer, the data can still be sniffed and logged, but it is nearly impossible to make useful. Some of our tips for using sFTP are as follows:</p>
<h3>Consider moving your primary SSH port to non-standard location and block the use of port 22.</h3>
<h3>Never use the root account to log into sFTP (or SSH). Create users with sufficient privileges for particular needs.</h3>
<h3>Use a client like <a href="http://filezilla-project.org/" target="_blank">FileZilla</a>, <a href="http://winscp.net/eng/index.php" target="_blank">WinSCP</a>, or <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/" target="_blank">Putty</a> for all your sFTP and SSH needs.</h3>
<p>As always, security is only as strong as the weakest link, so the first step is to not allow attackers onto you network. Use strong, randomized passwords, and if your router isn&#8217;t already using WPA2 for the encryption type, either change the setting, or get a new router! If you are [still] using WEP encryption, you will get cracked faster than a whip on a horses behind. Check the links below for some more info:</p>
<p><a href="http://shapeshed.com/journal/chroot_sftp_users_on_ubuntu_intrepid/" target="_blank">Chroot SFTP user on Ubuntu Intrepid</a></p>
<p><a href="http://www.mysql-apache-php.com/ssh-attacks.htm" target="_blank">How to Secure SSH Server from Attacks</a></p>
<p><a href="http://www.openssh.org/" target="_blank">OpenSSH</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.builtbyprime.com/security/using-sftp-with-ssh-and-why-ftp-is-insecure/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSRF Protection in Code Igniter using Form Tokens</title>
		<link>http://blog.builtbyprime.com/security/csrf-protection-in-code-igniter-using-form-tokens</link>
		<comments>http://blog.builtbyprime.com/security/csrf-protection-in-code-igniter-using-form-tokens#comments</comments>
		<pubDate>Wed, 07 Jul 2010 20:12:17 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://blog.primestudiosllc.com/?p=550</guid>
		<description><![CDATA[Today we are going to talk about CSRF (or Cross Site Request Forgery), otherwise known as session riding, see-surf, and XRSF, and how to built a token system in Code Igniter to mitigate any potential attacks using CSRF. <a href="http://blog.builtbyprime.com/security/csrf-protection-in-code-igniter-using-form-tokens">Read more...</a>]]></description>
			<content:encoded><![CDATA[<div class="info">As of Jan. 2011, CodeIgniter 2.0.0 has built-in support for CSRF in the security library. View the <a href="http://codeigniter.com/user_guide/changelog.html">CI Change Log</a>.</div>
<iframe src='http://player.vimeo.com/video/13159367?title=1&amp;byline=1&amp;portrait=1' width='400' height='225' frameborder='0'></iframe>
<h3>ScreenCast Commentary</h3>
<p>Today we are going to talk about CSRF (or Cross Site Request Forgery), otherwise known as session riding, see-surf, and XRSF, and how to built a token system in <a href="http://codeigniter.com/" target="_blank">Code Igniter</a> to mitigate any potential attacks using CSRF.</p>
<p>To start, the core of CSRF lies in web browsers making requests that they are “technically” authorized to do, however the user doesn’t actually know the request is being made (otherwise known as a <a href="http://en.wikipedia.org/wiki/Confused_deputy_problem" target="_blank">confused deputy attack</a>). Consider things like image tags, or iFrames, they make calls to external URL’s all the time.. if instead of a call to an actual image, the image tag calls a URL with malacious GET variables in the URL, some damage can occur.</p>
<p>One solution to this problem is the use of form tokens, or a unique and random string put into a hidden POST variable and into a cookie every time the page is loaded. This makes it nearly impossible to make a POST request from an external source because that token must be validated on the server side based on the POSTed token value and the set cookie value. Remember the same basic principle works in any PHP application, Code Igniter just makes session management a lot simpler.</p>
<p>Remember if an application vulnerable to <a href="http://blog.primestudiosllc.com/security/simple-webapp-cross-site-scripting-xss-attack" target="_self">XSS (Cross Site Scripting)</a> it could possibly navigate through the DOM and find the token value, making it possible for an automated attack. Read up on the <a href="http://namb.la/popular/tech.html" target="_blank">“samy is my hero” MySpace attack</a> for more on that.</p>
<p>End Commentary</p>
<p>CSRF with POST variables is dangerous because an attacker can setup a false form, maybe just asking for your favorite color, and then post hidden content to a form/site that you have a session on. Below is the code we used inside the Code Igniter Auth class and the main controller to implement a form token system.</p>
<pre class="brush: php; title: ;">
&lt;?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Auth 	{
	function Auth()	{
		$this-&gt;ci =&amp; get_instance();
	}

	function token()	{
		$token = md5(uniqid(rand(),true));
		$this-&gt;ci-&gt;session-&gt;set_userdata('token',$token);
		return $token;
	}
}

/* End of file Auth.php */

&lt;?php

class Welcome extends Controller {

	function Welcome()
	{
		parent::Controller();
		$this-&gt;load-&gt;model('search_model');
	}

	function index()
	{
		if($this-&gt;input-&gt;post('login'))	{
			$this-&gt;session-&gt;set_userdata('logged_in','yes');
		}
		if($this-&gt;input-&gt;post('logout'))	{
			$this-&gt;session-&gt;set_userdata('logged_in','no');
		}

		if(strcmp($this-&gt;session-&gt;userdata('logged_in'),'yes')==0)	{
			$data['logged_in'] = true;
			if($this-&gt;input-&gt;post('search'))	{
				if($this-&gt;input-&gt;post('token') == $this-&gt;session-&gt;userdata('token'))	{
					$this-&gt;search_model-&gt;add_search($this-&gt;input-&gt;post('search'));
				}
			}

		}	else	{
			$data['logged_in'] = false;
		}

		$data['token'] = $this-&gt;auth-&gt;token();
		$data['search_amt'] = $this-&gt;search_model-&gt;post_amt();
		$this-&gt;load-&gt;view('welcome_message',$data);
	}
}

/* End of file welcome.php */
/* Location: ./system/application/controllers/welcome.php */
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.builtbyprime.com/security/csrf-protection-in-code-igniter-using-form-tokens/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>WebApp Security and Lock Picking: Things Aren&#8217;t That Different</title>
		<link>http://blog.builtbyprime.com/security/webapp-security-and-lock-picking-things-arent-that-different</link>
		<comments>http://blog.builtbyprime.com/security/webapp-security-and-lock-picking-things-arent-that-different#comments</comments>
		<pubDate>Wed, 07 Jul 2010 03:02:05 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://blog.primestudiosllc.com/?p=455</guid>
		<description><![CDATA[Woah, application security and picking locks- sounds like the topic of lunchtime conversation at DEFCON. When it comes to exploitation, attacks, vulnerabilities, and mitigation techniques, security in any field is really all the same. Sometimes explaining web application security is difficult, but it seems when we match it with something more tangible, like the hard steel of locks, some sense comes to life. Lets start with a “hypothesis”, and then look at some worthy comparisons between 1′s &#038; 0′s, and padlocks &#038; handcuffs. <a href="http://blog.builtbyprime.com/security/webapp-security-and-lock-picking-things-arent-that-different">Read more...</a>]]></description>
			<content:encoded><![CDATA[<p>Woah, application security and picking locks- sounds like the topic of lunchtime conversation at <a href="http://www.defcon.org/" target="_blank">DEFCON</a>. When it comes to exploitation, attacks, vulnerabilities, and mitigation techniques, security in any field is really all the same. Sometimes explaining web application security is difficult, but it seems when we match it with something more tangible, like the hard steel of locks, some sense comes to life. Lets start with a &#8220;hypothesis&#8221;, and then look at some worthy comparisons between 1&#8242;s &amp; 0&#8242;s, and padlocks &amp; handcuffs.</p>
<p style="text-align: center;"><img class="size-full wp-image-481 aligncenter" title="primestudios-webapp-security-hypothesis" src="http://blog.primestudiosllc.com/wp-content/uploads/primestudios-webapp-security-hypothesis.png" alt="" width="600" height="75" /></p>
<p style="text-align: left;"><img class="size-full wp-image-483 alignright" title="primestudios-lock-security-webapps" src="http://blog.primestudiosllc.com/wp-content/uploads/primestudios-lock-security-webapps.png" alt="" width="225" height="156" />Before we try to explain that, lets talk a little about how a lock works. A lock has a set number of pins inside (anywhere between 5-7 pins for a normal lock), each cut to a specific height. When a key with the correct pattern is inserted all the pins line up straight and allow the lock mechanism to rotate (see more at <a href="http://home.howstuffworks.com/home-improvement/household-safety/security/lock-picking1.htm" target="_blank">How Stuff Works</a>). The problem for someone without a key is that they need to manually manipulate each pin to the correct height in order to get the lock to rotate/open.</p>
<p style="text-align: left;">So lets start with a simple comparison, we can easily see that the more pins in a lock, the harder it is to pick. Along with this, the more random the pin-heights, the harder the lock will be to pick. Sound familiar? In web application security we use bit-length (each bit is a technically &#8220;layer&#8221; of security) and randomness <strong>all the time</strong>. Consider how we encode passwords to save in a database, the most common hash&#8217;s are MD5, and SHA1, which are as a standard are a 128-bit vs. 160-bit encryption (respectively). <em>Quick Tip: Anything encoded for the US Government must be at least as secure as the SHA1 encryption, MD5 is unacceptable</em>. Lets see an example:</p>
<p style="text-align: center;"><img class="size-full wp-image-465 aligncenter" title="primestudios-sha1-vs-md5-encoding" src="http://blog.primestudiosllc.com/wp-content/uploads/primestudios-sha1-vs-md5-encoding1.png" alt="" width="522" height="96" /></p>
<p style="text-align: left;">Well, indeed MD5 is a shorter encryption, and in turn less secure if we were to try to break it using &#8220;brute force&#8221;- having server upon server running automated scripts using good ole&#8217; trial and error. Lock pickers use brute force all the time, one method uses these nifty &#8220;jiggler keys&#8221;:</p>
<p style="text-align: left;"><img class="size-full wp-image-470 aligncenter" title="primestudios-jiggler-keys-webapp-security" src="http://blog.primestudiosllc.com/wp-content/uploads/primestudios-jiggler-keys-webapp-security1.png" alt="" width="645" height="279" />These keys are made for car door locks. As you can see there is some randomness between each key, and the idea is that when you put that into the door lock, &#8220;jiggle and twist&#8221;, but the time you give each pattern a couple minutes you find one that works- brute force at it&#8217;s finest!</p>
<p style="text-align: left;">Handcuffs are a well-known lock that display some<strong> layers of security</strong>. Instead of six or seven pins, handcuffs have one simple lever- yes, society trusts that if you are dumb enough to get arrested, you are not smart enough to bypass a single-lever mechanism. However, consider the more transparent layers of security related to handcuffs:</p>
<p style="text-align: center;"><img class="size-full wp-image-544 aligncenter" title="primestudios-handcuff-picking-rules" src="http://blog.primestudiosllc.com/wp-content/uploads/primestudios-handcuff-picking-rules1.png" alt="" width="635" height="198" /></p>
<p style="text-align: center;">
<p>Be pro-active, strip and clean anything that could damage the application. Give as little information about the way the application is built as possible; hide file extensions and handle all errors. Lastly, watch and react; if you get 100 requests from an IP address in China in 3 minutes, block it. As developers we must try our best to put the attacker at a disadvantage by using layers, remember some of these when building a web application:</p>
<p style="text-align: center;"><img class="size-full wp-image-533 aligncenter" title="primestudios-web-application-security-layers" src="http://blog.primestudiosllc.com/wp-content/uploads/primestudios-web-application-security-layers1.png" alt="" width="647" height="433" /></p>
<h3>Layers, The Future, and You.</h3>
<p style="text-align: left;">We believe one large part in the evolution of web security is summed up in agreat quote from an <a href="http://www.owasp.org/index.php/Main_Page" target="_blank">OWASP</a> Podcast we recently listened to, &#8220;If someone was throwing rocks at your house window, you wouldn&#8217;t just sit there and be happy your windows are strong, you would call the police or go after the person. We don&#8217;t do this in web application security yet.&#8221; One idea we are currently piloting at Prime Studios is a &#8220;that&#8217;s weird&#8221; database; we add a simple line to our XSS (Cross Site Scripting) filtering, our CRSF (Cross Site Request Forgery) filters, and authentication systems to monitor for anything that we would say &#8220;that&#8217;s weird&#8221; to. It doesn&#8217;t sound like much, but if we see a lot of login failures or broken form tokens over a certain time period, we can take action on a particular user, IP address, User Agent, or a mix of all of them.</p>
<p>Everyone likes elegant solutions, but unfortunately with web application security we can&#8217;t just rely on a single [Godly] plugin or framework to handle all our security needs. The first step is knowing what to look for (education), and then you can start building your own methods for a strong security policy throughout your applications (implementation). Hit up the following links for some more great web application security tips:</p>
<p><a href="http://msdn.microsoft.com/en-us/library/ff649874.aspx" target="_blank">Improving Web Application Security</a></p>
<p><a href="http://www.owasp.org/index.php/Category:OWASP_Top_Ten_Project" target="_blank">OWASP Top Ten for 2010</a></p>
<p><a href="http://www.applicure.com/solutions/web-application-firewall" target="_self">Web Application Firewalls</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.builtbyprime.com/security/webapp-security-and-lock-picking-things-arent-that-different/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple WebApp Cross Site Scripting (XSS) Attack</title>
		<link>http://blog.builtbyprime.com/security/simple-webapp-cross-site-scripting-xss-attack</link>
		<comments>http://blog.builtbyprime.com/security/simple-webapp-cross-site-scripting-xss-attack#comments</comments>
		<pubDate>Thu, 24 Jun 2010 23:10:23 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://blog.primestudiosllc.com/?p=440</guid>
		<description><![CDATA[XSS, or Cross Site Scripting, is one of the biggest security risks that any web application developer or concerned client should have a good understanding of. XSS makes use of vulnerabilities in a website to inject [malicious] code. Websites are made up of many elements, including things like header information, HTML elements, and sometimes JavaScript elements. <a href="http://blog.builtbyprime.com/security/simple-webapp-cross-site-scripting-xss-attack">Read more...</a>]]></description>
			<content:encoded><![CDATA[<iframe src='http://player.vimeo.com/video/12838411?title=1&amp;byline=1&amp;portrait=1' width='400' height='225' frameborder='0'></iframe>
<p style="margin-bottom:30px; padding-top:15px">XSS, or Cross Site Scripting, is one of the biggest security risks that any web application developer or concerned client should have a good understanding of. XSS makes use of vulnerabilities in a website to inject [malicious] code. Websites are made up of many elements, including things like header information, HTML elements, and sometimes JavaScript elements. JavaScript runs on the browser, and can modify things within a webpage dynamically, and without the user actually knowing. This video explains a vulnerability on a website that includes a search box and a login form in the same view. We show how to use JavaScript to modify a form action, resulting in a complete exploit of a users credentials.</p>
<p style="color: #999">Our privacy policy: With knowledge comes power, use it wisely and in positive ways. For more information about web application security visit <a href="http://www.owasp.org/index.php/Main_Page" target="_self"><span style="text-decoration: underline;">OWASP</span></a> (Open Web Application Security Project). </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.builtbyprime.com/security/simple-webapp-cross-site-scripting-xss-attack/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Weakest Link in the Chain of WebApp Security</title>
		<link>http://blog.builtbyprime.com/security/the-weakest-link-in-the-chain-of-webapp-security</link>
		<comments>http://blog.builtbyprime.com/security/the-weakest-link-in-the-chain-of-webapp-security#comments</comments>
		<pubDate>Tue, 22 Jun 2010 03:00:22 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://blog.primestudiosllc.com/?p=397</guid>
		<description><![CDATA[It's you. You (the human) are the weakest link. Especially when it comes to web application security. As developers, we must pay attention to application security as if our lives depend on it.. a simple 7-character MySQL injection can indeed ruin our day. <a href="http://blog.builtbyprime.com/security/the-weakest-link-in-the-chain-of-webapp-security">Read more...</a>]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s you. You (the human) are the weakest link. Especially when it comes to web application security. As developers, we must pay attention to application security as if our lives depend on it.. a simple 7-character MySQL injection can indeed ruin our day. From the client side, whether or not we know it, we expect the applications we use to be secure, use modern encryption, employ proper session management, [etc] and be a web bouncer while we are using it. Yet, while data encryption has continually evolved since times of <a href="http://en.wikipedia.org/wiki/Caesar_cipher" target="_blank">Julius Caesar</a>, computers since <a href="http://en.wikipedia.org/wiki/ENIAC" target="_blank">ENIAC</a>, humans remain gullible and void of social firewalls.</p>
<p style="text-align: center;"><a href="http://blog.primestudiosllc.com/wp-content/uploads/caesar-cipher.png"><img class="aligncenter size-full wp-image-404" title="caesar-cipher" src="http://blog.primestudiosllc.com/wp-content/uploads/caesar-cipher.png" alt="" width="640" height="270" /></a></p>
<p>This is why we call it <a href="http://www.youtube.com/watch?v=ctEUFYELOL0" target="_blank">social engineering</a>, and in the world of application security, the more human manipulation and error there is (or could be), the weaker the entire system. Let&#8217;s try breaking into someone&#8217;s bank account, both the techy way, then try exploiting the human element.</p>
<h3>Techy Way</h3>
<p>First, let&#8217;s see if the login form properly escapes and validates the inputs, maybe we can do some simple injection. Damn, they know about SQL injection. Next check if there are holes in the system to hijack cookies, or maybe we can brute force the credentials with a dictionary algorithm and a couple servers. Yikes, encrypted cookies, random hash tokens for form validation, and now they are blocking our IP&#8217;s because of so many persistent requests. Let&#8217;s go for one last thing, let&#8217;s put 3-4 thousand characters into a POST or GET request, and see if we can make any exploits from the returned error codes.. Nope, they trim all their inputs to 40 chars before ever processing them. Looks like the script kiddies (bottom of the bin) hackers are stuck.</p>
<p style="text-align: center;"><img class="size-full wp-image-414 aligncenter" title="prime-studios-exploited-server" src="http://blog.primestudiosllc.com/wp-content/uploads/prime-studios-exploited-server.png" alt="" width="578" height="304" /></p>
<h3>Human Way</h3>
<p>I know a guy down the street who is loaded, his name is John Doolittle. I search for him on Google, find that he is Director of Marketing at www.MarketingFirmABC.com. Then I search the last name in Facebook, and find his wife&#8217;s profile, which she publicly posts her email address. I buy the domain www.MarketingFirm-ABC.com, setup a redirect to www.MarketingFirmABC.com, just in case anyone checks. Then I make an email address for myself &#8220;john@marketingfirm-abc.com&#8221;, including all the headers so the name comes up pretty. You see where this is going.. I email Mrs. Doolittle &#8220;Hi Hun, could you resend me our bank acct logins? Must have thrown that sticky note out! -XO&#8221;. Give it an hour and unless she is hip to that faulty dash in your email address, you will have bank logins from her, probably with &#8220;Sent from my iPhone&#8221; at the bottom. You scrap the domain, and access the account from an offshore IP. This is otherwise known as <a href="http://www.fraud.org/tips/internet/phishing.htm" target="_blank">phishing</a>, and while an &#8220;old&#8221; technique, it still is a common exploit.</p>
<p style="text-align: center;">
<h3>Solution = Education</h3>
<p style="margin-bottom:30px">This is kind of scary, but we see that no matter how hard we try to add more layers of security to our application, the weakest link may very well be with the end-user. With this in mind, it&#8217;s our responsibility as developers to not only take care of the tech stuff, but to hold the users hand a bit, and unobtrusively educate them about the subtle security risks. Just imagine how many passwords could be retrieved if someone had access to your main email account, or how many they <em>could</em> get by doing some simple &#8220;I forgot my password&#8221; submissions. Just another day of cautiously embracing the web.</p>
<p style="color:#999;">Our privacy policy: With knowledge comes power, use it wisely and in positive ways. For more information about web application security visit <a href="http://www.owasp.org/index.php/Main_Page" target="_self">OWASP</a> (Open Web Application Security Project).</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.builtbyprime.com/security/the-weakest-link-in-the-chain-of-webapp-security/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

