<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>Rory.Blog</title>
    <link rel="alternate" type="text/html" href="http://www.mccune.org.uk/blog/" />
    <link rel="self" type="application/atom+xml" href="http://www.mccune.org.uk/blog/atom.xml" />
    <id>tag:www.mccune.org.uk,2009-02-22:/blog//1</id>
    <updated>2011-06-01T09:16:07Z</updated>
    <subtitle>A weblog about things that Interest me, mostly Security with a little Networking a dash of IT and the odd Cat.</subtitle>
    <generator uri="http://www.sixapart.com/movabletype/">Movable Type 4.37</generator>

<entry>
    <title>All change (Again) and a new Blog</title>
    <link rel="alternate" type="text/html" href="http://www.mccune.org.uk/blog/2011/06/all-change-agai.html" />
    <id>tag:www.mccune.org.uk,2011:/blog//1.547</id>

    <published>2011-06-01T09:13:37Z</published>
    <updated>2011-06-01T09:16:07Z</updated>

    <summary>So I&apos;ve just started (another) new company, and I&apos;m moving on from 7 Elements. The new company is ScotSTS. I&apos;m taking the opportunity to refresh my blogging software, and I&apos;ll be moving new posts over to the ScotSTS blog, and...</summary>
    <author>
        <name>Rory2</name>
        <uri>http://www.mccune.org.uk</uri>
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://www.mccune.org.uk/blog/">
        <![CDATA[<p>So I've just started (another) new company, and I'm moving on from 7 Elements.  The new company is <a href="http://www.scotsts.com">ScotSTS</a>.  I'm taking the opportunity to refresh my blogging software, and I'll be moving new posts over to the <a href="http://blog.scotsts.com/">ScotSTS blog</a>, and it also has a copy of all the content from this blog.  The RSS feed for the new blog is <a href="http://blog.scotsts.com/?feed=rss2">here</a></p>]]>
        
    </content>
</entry>

<entry>
    <title>Just the Facts Ma&apos;am</title>
    <link rel="alternate" type="text/html" href="http://www.mccune.org.uk/blog/2011/01/just-the-facts.html" />
    <id>tag:www.mccune.org.uk,2011:/blog//1.546</id>

    <published>2011-01-20T20:42:47Z</published>
    <updated>2011-01-20T21:30:26Z</updated>

    <summary>Sometimes when you&apos;re testing it&apos;s good to be able to quickly get a feel for where to focus your attention or to get an overview of all the ports you&apos;ve got open, so you can be sure you investigate all...</summary>
    <author>
        <name>Rory2</name>
        <uri>http://www.mccune.org.uk</uri>
    </author>
    
        <category term="Penetration Testing" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Ruby" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="rubypenetration_testing" label="Ruby Penetration_Testing" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://www.mccune.org.uk/blog/">
        <![CDATA[<p>Sometimes when you're testing it's good to be able to quickly get a feel for where to focus your attention or to get an overview of all the ports you've got open, so you can be sure you investigate all of them.  Once you've done several scans as part of a job, you end up with a stack of nmap and nessus output files, and it can be hard to keep an eye on exactly what's been found so far, and it's good to have a way to just get the facts.</p>

<p>As a result a lot of testers will have scripts to help parse collate output from common tools like nmap.</p>

<p>They tend not to be the prettiest code in the universe or to produce lovely management friendly reports, but handy nonetheless.</p>

<p>Having set expectations about the quality of this code :)  Here's a couple of scripts which may come in useful for testers in managing some of those xml report files.</p>

<p><a href="http://www.mccune.org.uk/code/nmapautoanalyzer.rb">NMAP Auto Analyzer</a> can parse a single nmap xml file or a directory of nmap xml files and provide a concise report on ports open across them.</p>

<p><a href="http://www.mccune.org.uk/code/nessusautoanalyzer.rb">Nessus Auto Analyzer</a> somewhat unsurprisingly, does the same job for .nessus report files (v2 only at the moment)</p>

<p>Both have reasonable help files, so should be fairly straightforward to use, any questions/queries welcome either in comments or in e-mail (rorym at mccune dot org dot uk)</p>]]>
        
    </content>
</entry>

<entry>
    <title>Creating a Simple Vulnerability Database  - Part 2</title>
    <link rel="alternate" type="text/html" href="http://www.mccune.org.uk/blog/2010/10/creating-a-simp-1.html" />
    <id>tag:www.mccune.org.uk,2010:/blog//1.545</id>

    <published>2010-10-25T20:06:32Z</published>
    <updated>2010-10-27T16:25:30Z</updated>

    <summary>We left off last time having created a simple vulnerability database using Ruby on Rails. So the next piece of the puzzle is getting that data into Dradis. Luckily Dradis has a nice plugin system which is designed to ease...</summary>
    <author>
        <name>Rory2</name>
        <uri>http://www.mccune.org.uk</uri>
    </author>
    
        <category term="Penetration Testing" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Ruby On Rails" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://www.mccune.org.uk/blog/">
        <![CDATA[<p>We left off <a href="http://www.mccune.org.uk/blog/2010/10/creating-a-simp.html">last time</a> having created a simple vulnerability database using Ruby on Rails.  So the next piece of the puzzle is getting that data into Dradis.</p>

<p>Luckily Dradis has a nice plugin system which is designed to ease the process of importing and exporting data from Dradis, so this isn't too tricky.</p>

<p><u><strong><big>Creating the Plugin</big></strong></u></p>

<p>As dradis has rails generators for import plugins, we can use that to create the basic structure.  First off, obviously, we need a working Dradis installation to work from.  There are instructions on the site for the latest svn version <a href="http://dradisframework.org/subversion.html"> here</a> and following those should give you a working version of the latest code.</p>

<p>Once that's done we can enter the dradis server directory an use this command to create the our import plugin.</p>

<pre>rails generate import_plugin simple_vulndb</pre>

<p>This creates a directory simple_vulndb_import under vendor/plugins and also creates a number of files for us to modify. </p>

<p><u><strong><big>Configuring the Plugin</big></strong></u></p>

<p>Here we'll just step through the bits that are necessary to get the plugin up and working. there's a number of files that we need to modify to get everything working ok.  Most of this is just a modified version of the default vulndb_import plugin which is provided as part of Dradis.</p>

<p>First up is the configuration file in the plugin config directory.</p>

<p>Dradis uses YML config files which is a pretty easy syntax which is <i>parameter</i> : <i> value</i></p>

<p>Here we can define the hostname, port and path for Dradis to access our vulnerability database.  This also provides you the flexibility to change it (for instance if you've got a centralised version of the database as opposed to one hosted locally).  The settings below are based on what we configured for the vulnerability database in the last post.</p>

<pre>
host: localhost
port: 3003
path: /vuln_search.json
</pre>

<p>with that done we can move on.  Next up is the meta.rb file which can be found in lib/simple_vulndb_import/ .  Here we just define the name of the plugin and the version information.  So for example</p>

<pre>
  NAME = "Simple Vulnerability Database Import"
  # change this to the appropriate version
  module VERSION #:nodoc:
    MAJOR = 0
    MINOR = 1
    TINY = 0
     STRING = [MAJOR, MINOR, TINY].join('.')
</pre>

<p>would work fine.  Next up the main piece we need to change, the filters.rb file.  This is found in the same directory as the meta.rb file.</p>

<p><u><strong><big>Creating the Filters</big></strong></u></p>

<p>There's two main pieces to how I've set this up.  The first is the filters.  Essentially if we configure one of these for each of the search_types that we defined in the database (description, OWASP reference, Severity and Test Type) then we'll be able to search by those methods from within Dradis).</p>

<p>Dradis handles filters by creating a module within the filters module that you'll see pre-defined in the filters.rb template.</p>

<p>So for each of our searches we need to create a new module which looks a bit like this.</p>

<pre>
module TestTypeSearch
NAME = 'Search Database by Test Types'
  def self.run(params={})
    result = Filters::get_records('test_type',params['query'])
    records = Filters::prepare_results(result.body)
    return records
  end
end
</pre>

<p>what we're doing here is essentially setting up a NAME constant which contains (rather unsurprisingly) the filter name. then defining the behaviour when the filter is run.  this is rather short as we're just calling two class methods and then returning the result.</p>

<p>When I was writing this file I realised that I was essentially just writing variations of the same logic four times, so in good ruby practice I tried to DRY up the code and moved most of the logic into the class methods <b>get_records</b> and <b>prepare_results</b></p>

<p>get_records looks like this</p>

<pre>
def self.get_records(search_type,query)
  require 'cgi'
  conf_file = File.join(Rails.root, 'config', 'rvulndb_import.yml')
  conf = YAML::load( File.read CONF_FILE )
  http = Net::HTTP.new(conf['host'], conf['port'])      
  res = http.get(conf['path'] + '?search_type=' + search_type +'&query=' + CGI::escape(query))
end
</pre>

<p>So this method opens the configuration file that we defined earlier (you'll notice that it looks in the config directory under the rails root, so it's a good idea to put a copy in there).  Once it's opened that it uses rubys' YAML class to read the file, sets up an http connection to the database mentioned in the config file and executes the query on the database.  One thing to note here is the use of CGI::escape.  This helps manage any use of characters that aren't allowed in URLs in our query string.</p>

<p>Ok, so after that method has completed we should have an array of 0 or more records that we can setup to be returned into dradis.</p>

<p>Next method up preps the records for input into Dradis</p>

<pre>
def self.prepare_results(json_data)
  recs = []
  jrec = ActiveSupport::JSON::decode(json_data)
  if jrec.length == 0
    error = Hash.new
    error['title'] = "No records found"
    error['description'] = "The search didn't return any records!"
    recs << error
    return recs
  end
  
  jrec.each do |jr|
    newrec = Hash.new
    newrec['title'] = jr['vulnerability']['title']
    newrec['description'] = Filters::build_description(jr['vulnerability'])
    recs << newrec
  end
  return recs
end
</pre>

<p>So this code just loads up the JSON data that our query should have returned, checks to make sure that we got some records (and returns an error if we didn't) then creates a hash for each record.  There's one more bit of logic to explain in here which is the call to <b>Filters::build_description</b>.  For neatness sake I broke that bit out.  At the moment it's a pretty ugly text creation, but does the job :)</p>

<pre>
def self.build_description(note_data)
      <<-eos
Vulnerbility Title
------------------
#{note_data['title']}      
      
Vulnerability Description
------------------------
#{note_data['description']}
        
        
Vulnerability Remediation
-------------------------
#{note_data['remediation']}
        
        
Technical Notes
--------------
#{note_data['technical_notes']}
      eos
end
</pre>

<p>This just puts together the body of the note description for each finding, as one long string.</p>

<p>There's obviously a lot more that could be done with this (like better error handling and writing tests) but with those files complete, the module should work ok and you should be able to import vulns from your database directly into Dradis using the "import note" feature.</p>

<p>I've put a copy of the code for the plugin up <a href="http://www.mccune.org.uk/code/simple_vulndb_import.tar.bz2">here</a>, in case it's helpful :)<br />
</p>]]>
        
    </content>
</entry>

<entry>
    <title>Creating a Simple Vulnerability Database  - Part 1</title>
    <link rel="alternate" type="text/html" href="http://www.mccune.org.uk/blog/2010/10/creating-a-simp.html" />
    <id>tag:www.mccune.org.uk,2010:/blog//1.544</id>

    <published>2010-10-20T10:01:09Z</published>
    <updated>2010-10-20T10:07:18Z</updated>

    <summary>One of the main tools that I&apos;ve found useful in pen. testing is the Dradis Framework, it&apos;s a good way of keeping track of findings and notes during a test and I&apos;ve also found it&apos;s template feature is good for...</summary>
    <author>
        <name>Rory2</name>
        <uri>http://www.mccune.org.uk</uri>
    </author>
    
        <category term="Penetration Testing" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Ruby On Rails" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://www.mccune.org.uk/blog/">
        <![CDATA[<p>One of the main tools that I've found useful in pen. testing is the <a href="http://www.dradisframework.org">Dradis Framework</a>, it's a good way of keeping track of findings and notes during a test and I've also found it's template feature is good for keeping a list of things to remember during a test.</p>

<p>One of the features available in Dradis is import plugins.  This lets you create a link to an external information source, such as a OSVDB or a database of vulnerabilities.</p>

<p>Having a database of vulnerabilities or findings can be pretty useful in cutting down the time required for reporting on a test as you can keep standard wordings in place (who really wants to write the same section about preventing XSS more than once!).</p>

<p>So recently I knocked up a simple vulnerability database to link in to Dradis and I thought it might be of use, so here's the process.</p>

<p><br />
<u><strong><big>Creating the App</big></strong></u></p>

<p>We're going to use <a href="http://rubyonrails.org/">Ruby on Rails</a> for this as it's nice and easy to develop for (as you'll see) and also that's what Dradis is based on, so makes sense to keep all the coding in the same underlying language.  Also rails apps are very portable, they're basically contained within a single directory structure, so it's relatively easy to move them from place to place.</p>

<p>Before starting the application, there's the usual pre-req's.  I'm using Ruby 1.9.2 and Rails 3 so having those installed is a good thing.  If you're using Linux then it's helpful to have <a href="http://rvm.beginrescueend.com/">RVM</a> working as some distros don't have ruby 1.9.2 packaged up as yet.</p>

<p>once you've got the pre-req's working, we can start by creating a rails app</p>

<pre>rails new vulnlist</pre>

<p>This creates a new application called <i>vulnlist</i> and adds all the standard rails files in.</p>

<p><br />
<u><strong><big>Creating the Scaffold</big></strong></u></p>

<p>  Once we've got the app created, we can use rails scaffolding to quickly create the basic structure for our app.  The web pages that scaffolding creates aren't the most pretty, but they'll do for now.</p>

<p>With the scaffold we can specify what fields we want to create in the database and also what data types those fields are.  </p>

<pre>rails generate scaffold Vulnerability title:string test_type:string description:text remediation:text technical_notes:text severity:string owasp_reference:string</pre>

<p>Once we've completed this we can look at the basic app by setting up the database with</p>

<pre>rake db:migrate</pre>

<p>Ensuring that all our gems are installed ok with</p>

<pre>bundle install</pre>

<p>and launching the app</p>

<pre>rails server</pre>

<p>At this point browsing to http://127.0.0.1:3000/vulnerabilities  should show a blank page with our fields in it.  From this page we can create new vulnerabilities and edit or delete existing ones.</p>

<p>Now that we've got this basic structure setup it's worth using git to keep a handle on the source code.  On Linux the procedure for this is pretty easy</p>

<p>If you've not already got it installed</p>

<pre>sudo apt-get install git-core</pre>

<p>then in the root of the application</p>

<pre>git init
git add .
git commit -m "Initial Commit with Scaffold"
</pre>

<p>Having git running on the app will make it pretty easy to revert any mistakes made along the way, as long as we've done regular commits.</p>

<p><u><strong><big>Setting up the Searches</big></strong></u></p>

<p>So far we've got a basic structure in place and can do the basic Create, Read, Update, Delete cycle on our data.  However for the dradis integration, what'd be useful is if we could search for vulnerabilities using various criteria and have the results returned to Dradis.</p>

<p>This turns out to be relatively straightforward.  First what we need is a new action in our controller.  Opening vulnlist/app/controllers/vulnerabilities_controller.rb we can see the existing actions that we've got for the application.</p>

<p>What we need to do now is add a new action to allow for vulnerability searches.</p>

<pre>def vuln_search
    case params[:search_type]
    when "description"
      @vulnerabilities = Vulnerability.where("description like ?", "%"+params[:query]+"%")
    when "owasp"
      @vulnerabilities = Vulnerability.where("owasp_reference like ?",params[:query]+"%") 
    when "severity"
      @vulnerabilities = Vulnerability.find_all_by_severity(params[:query])
    when "test_type"
      @vulnerabilities = Vulnerability.find_all_by_test_type(params[:query])
    end
    respond_to do |format|
      format.xml {render :xml => @vulnerabilities}
      format.json {render :json => @vulnerabilities}
    end
  end
</pre>

<p>This defines a new method called "vuln_search" which takes two parameters, search_type and query.  The search type parameter lets us pick from different finders.  Rails provides access into the application database via ActiveRecord and this just uses a couple of the finder types for different parameters.  Where the query is going to be one of a number of fixed values like "severity" which will be something like high, medium or low, we can just use a standard find_all_by_<field> approach, but where it's a more free text style search, we use Vulnerability.where and pass in the query parameter that way.</p>

<p>The respond_to block is a really nice feature of rails.  By adding in the two lines for :xml and :json rails wires up responses so that we can get the data out in those format, no additional code required.</p>

<p>Now that we've got the basic code in place, we just need to modify the rails routes so that the application knows how to access our new method.</p>

<p>This is done by modifying the vulnlist/config/routes.rb file, and adding the following code</p>

<pre>controller :vulnerabilities do
  get 'vuln_search' => :vuln_search
end
</pre>

<p>At this point, we've got the application basically working.  If you put in a couple of test findings, then you should be able to go to http://127.0.0.1:3000/vuln_search.xml?search_type=Severity&Query=High for example and get some XML data back.</p>

<p><u><strong><big>Tidying up</big></strong></u></p>

<p>Now that we've got the basics working, there's a couple of additional steps that it's worth looking at to tidy some things up.  </p>

<p><strong><big>Selectors</big></strong></p>

<p>First off, we'd like some of our fields (OWASP Reference, Severity and test type) to be one of a number of defined values. The "proper" way to do this would be to create additional models for these and link them in to the main vulnerabilities controller, but there's a quicker way which is probably going to work well enough for our purposes.</p>

<p>Opening up vulnlist/app/models/vulnerability.rb we can specify some Constant values for these settings</p>

<pre>
TEST_TYPES = ["Web Application","Windows Server","Unix Server","Wireless","Web Server","Oracle","MS SQL","MySQL","DB2"]
SEVERITY_LEVELS = ["Critical","High","Medium","Low","No Impact"]
OWASP_TOP_10 = ["A1 - Injection","A2 - Cross Site Scripting (XSS)","A3 - Broken Authentication and Session Management","A4 - Insecure Direct Object Reference","A5 - Cross-Site Request Forgery (CSRF)","A6 - Security Misconfiguration","A7 - Insecure Cryptographic Storage","A8 - Failure to Restrict URL Access","A9 - Insufficient Transport Layer Protection","A10 - Unvalidated Redirects and Forwards"]
</pre>

<p>Then we can modify the form that the scaffolding process created to use these arrays as a select list.  The form is found in vulnlist/app/views/vulnerabilities/_form.html.erb.  In that file we just need to replace the "text_field" lines for those three fields with the following select lines</p>

<pre>
<%= f.select :test_type, Vulnerability::TEST_TYPES, :prompt => "Select the test type" %>
<%= f.select :severity, Vulnerability::SEVERITY_LEVELS, :prompt => "Select the severity level" %>
<%= f.select :owasp_reference, Vulnerability::OWASP_TOP_10, :prompt => "Select the appropriate OWASP top 10 reference" %>
</pre>

<p>This picks up the Constants from our model and helps keep the data consistent.  </p>

<p><strong><big>Localhost Only</big></strong></p>

<p>As you'll have noticed with this application, there's pretty much no security whatsoever.  At the moment it's setup as a personal database only and isn't suitable to be on any kind of network. Adding that security isn't too difficult with rails, however it's not really a problem for the basic use case that we have here.  Both the vulnerability list and the dradis installation only need to listen on the localhost.  </p>

<p>Configuring rails to only listen on the localhost (as opposed to specifying it on the command line) is a bit hacky, but here's a way to do it based on <a href="http://www.nearinfinity.com/blogs/chris_rohr/configuring_webrick_to_use_ssl.html">this post</a> and <a href="http://dradis.svn.sourceforge.net/viewvc/dradis/server/trunk/script/rails?revision=2057&view=markup">this dradis change</a> .  We need to modify the vulnlist/script/rails file and add the following lines</p>

<pre>
require 'rubygems'
require 'rails/commands/server'
require 'rack'
require 'webrick'

<p>module Rails<br />
  class Server < ::Rack::Server<br />
    def default_options<br />
      super.merge({<br />
        :Port => 3003,<br />
        :Host => "127.0.0.1",<br />
        :environment => (ENV['RAILS_ENV'] || "development").dup,<br />
        :daemonize => false,<br />
        :debugger => false,<br />
        :pid => File.expand_path("tmp/pids/server.pid"),<br />
        :config => File.expand_path("config.ru")<br />
      })<br />
    end<br />
  end<br />
end</p>

</pre>

<p>This also moves the application off the default port of 3000, to a new one of 3003 which hopefully shouldn't clash with other services.</p>

<p><big><strong>Default Routes</strong></big></p>

<p>At the moment if we visit the root page of our application, now at http://127.0.0.1:3003 we get the default rails welcome page.  What'd be nicer is if we were re-directed to the vulnerability listing automatically.  </p>

<p>That's easily done with two steps.  First edit the vulnlist/config/routes.rb file and add the line</p>

<pre>
  root :to => "vulnerabilities#index"
</pre>

<p>then delete the file vulnlist/public/index.html file.  </p>

<p><u><strong><big>Summary</big></strong></u></p>

<p>So at the end of this first part we've created a basic vulnerability database which we can search easily on a number of parameters.</p>

<p>The next step is to create the dradis plugin to hook the two together, which as I'll cover next time is a reasonably easy thing to do.</p>]]>
        
    </content>
</entry>

<entry>
    <title>New Role, New Blog</title>
    <link rel="alternate" type="text/html" href="http://www.mccune.org.uk/blog/2010/09/new-role-new-bl.html" />
    <id>tag:www.mccune.org.uk,2010:/blog//1.543</id>

    <published>2010-09-21T11:06:00Z</published>
    <updated>2010-09-21T11:10:45Z</updated>

    <summary>I&apos;ve just started a new role as a director at 7 Elements. We&apos;re providing technical security consultancy and penetration testing services, focusing on the scottish market. As part of that we&apos;ve started up a blog here to talk through some...</summary>
    <author>
        <name>Rory2</name>
        <uri>http://www.mccune.org.uk</uri>
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://www.mccune.org.uk/blog/">
        <![CDATA[<p>I've just started a new role as a director at <a href="http:///www.7elements.co.uk"> 7 Elements</a>.  We're providing technical security consultancy and penetration testing services, focusing on the scottish market.</p>

<p>As part of that we've started up a blog <a href="http://blog.7elements.co.uk">here</a> to talk through some of the ideas we've got for approaching security and testing in a pragmatic way.</p>

<p>I'm planning to keep this blog running for now (not that you could tell from the level of posts!), but more of my security/testing stuff will probably pop up on the 7 Elements blog...</p>]]>
        
    </content>
</entry>

<entry>
    <title>Wireless Scanning and a new tool</title>
    <link rel="alternate" type="text/html" href="http://www.mccune.org.uk/blog/2010/07/wireless-scanni.html" />
    <id>tag:www.mccune.org.uk,2010:/blog//1.542</id>

    <published>2010-07-17T16:36:12Z</published>
    <updated>2010-07-17T16:50:39Z</updated>

    <summary>I had some cause to do some wireless work recently, which got me interested in doing some more war-walking (and hey, the weathers actually been nice enough to make it pleasant recently). It was interesting to see the density of...</summary>
    <author>
        <name>Rory2</name>
        <uri>http://www.mccune.org.uk</uri>
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://www.mccune.org.uk/blog/">
        <![CDATA[<p>I had some cause to do some wireless work recently, which got me interested in doing some more war-walking (and hey, the weathers actually been nice enough to make it pleasant recently).</p>

<p>It was interesting to see the density of wireless networks in the suburban area near where I live, a quick 30 minute walk can easily pick up several hundred APs.  Also some of the stats on encryption were interesting with about 25% of networks either using WEP or having no encryption at all, so still rich pickings there for anyone who wants free access or to attack some home networks directly.</p>

<p>I also did a bit of scanning with my N900 in Glasgow, near the apple store and noticed they've got an awful lot of clients connected to their unencrypted wireless networks there (~ 260 client spread over 3 APs), hope everyone is using VPNs or SSL only sites ;op</p>

<p>Also couldn't find something to do the analysis the way I was looking for it, so I knocked up a quick script in ruby to analyse the .netxml output files from kismet.</p>

<p>It's available <a href="http://www.mccune.org.uk/code/kis_analysis.rb"> here </a> .  It needs ruby, rubygems and nokogiri to work.  worth noting that on linux installs you'll need some xml parsing libraries installed before installing nokogiri (libxslt libxml2 libxml2-dev)</p>

<p><br />
Basic syntax is very straightforward.</p>

<p>./kis_analysis.rb -f [netxml file] -r [report name]</p>

<p>you can add -g if you've got GPS data to add links from each network to a google maps point and -m to draw a map of all the networks seen.</p>

<p>Any feedback/comments welcome either on the blog or to rorym@nmrconsult.net</p>]]>
        
    </content>
</entry>

<entry>
    <title>Interesting Example of Cloud Computing Risks</title>
    <link rel="alternate" type="text/html" href="http://www.mccune.org.uk/blog/2010/05/interesting-exa.html" />
    <id>tag:www.mccune.org.uk,2010:/blog//1.540</id>

    <published>2010-05-19T20:01:56Z</published>
    <updated>2010-05-19T20:18:17Z</updated>

    <summary>One of the aspects of the move to cloud computing I find most interesting is the new and emergent risks that come with the move of services from a traditional networked IT environment, to being hosted &quot;out in the open&quot;...</summary>
    <author>
        <name>Rory2</name>
        <uri>http://www.mccune.org.uk</uri>
    </author>
    
    <category term="cloudcomputing" label="Cloud computing" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://www.mccune.org.uk/blog/">
        <![CDATA[<p>One of the aspects of the move to cloud computing I find most interesting is the new and emergent risks that come with the move of services from a traditional networked IT environment, to being hosted "out in the open" of the cloud.  </p>

<p>Whilst attention gets paid to some of the technical risks, I don't think there's been a lot of focus on some of the more procedural/human aspects of it.</p>

<p>One example is the visibility/effect of configuration mistakes.  In a traditional IT environment, mistakes can be partially contained by the network perimeter (albeit that containment is usually weaker than it used to be).</p>

<p>If someone makes an access control change which allows anonymous access to data, that mistake is likely only to be exploitable and visible to a limited group of people.</p>

<p>With the move to Cloud computing though, that same mistake could be instantly visible to the whole world and all it's attacker communities.  </p>

<p>A really good example of this comes up in a vulnerability found by Jonathan Siegel (background story <a href="http://www.readwriteweb.com/cloud/2010/03/user-ignorance-causes-cloud-security-leak-accounts-passwords-revealed.php">here</a> and <a href="http://www.itworldcanada.com/news/cloud-consultant-wants-amazon-web-services-revamp/140391">here</a>).</p>

<p>In essence the problem seems to be that users of Amazon Web Services have made access control errors which set disk snapshots to be publicly available to everyone in a given region, and in the examples Jonathan gives this has included a database of user accounts for a web service and a full copy of a news services' web site.</p>

<p>So what would have likely been a relatively minor access control issue in an Internal network setup, becomes a situation where all the data in question should be considered compromised.<br />
</p>]]>
        
    </content>
</entry>

<entry>
    <title>Scottish Ruby Conference follow-up - 2 - Securing your app.</title>
    <link rel="alternate" type="text/html" href="http://www.mccune.org.uk/blog/2010/04/scottish-ruby-c-2.html" />
    <id>tag:www.mccune.org.uk,2010:/blog//1.539</id>

    <published>2010-04-01T19:05:02Z</published>
    <updated>2010-04-01T19:19:12Z</updated>

    <summary>Most of the questions I got after my talk were around how people can look to secure their application. I mentioned a couple of sites and it&apos;s probably worth expanding on the points made. Web Application Security For people looking...</summary>
    <author>
        <name>Rory2</name>
        <uri>http://www.mccune.org.uk</uri>
    </author>
    
        <category term="Ruby On Rails" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Software Security" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://www.mccune.org.uk/blog/">
        <![CDATA[<p>Most of the questions I got after my talk were around how people can look to secure their application.  I mentioned a couple of sites and it's probably worth expanding on the points made.</p>

<p><b> Web Application Security</b></p>

<p>For people looking to understand how to secure their web applications, in my opinion the best source of free information is the <a href="http://www.owasp.org">OWASP project</a> .  It's an umbrella for a number of web application security efforts.  </p>

<p>They've got a wide variety of projects which target management, security testers and developers, but some of the best places to start for developers are the <a href="http://www.owasp.org/index.php/Guide_Table_of_Contents">Owasp developers Guide</a> which covers a wide range of topics about secure development in a fairly generic way, and there's also the Ruby on Rails Security Guide <a href="http://www.owasp.org/index.php/Category:OWASP_Ruby_on_Rails_Security_Guide_V2"> here </a> or <a href="http://guides.rubyonrails.org/security.html">here</a> which covers rails specific topics.</p>

<p>Both of those documents are relatively large but well worth delving into.  For a quick few of the "most serious" web application security issues, OWASP also has the <a href="http://www.owasp.org/index.php/Category:OWASP_Top_Ten_Project">Top Ten project</a>.  The latest version, current in <a href="http://www.owasp.org/index.php/File:OWASP_T10_-_2010_rc1.pdf">RC1</a> has some good summaries of the top risks, and is a good place to start getting an idea of the areas to be addressed...</p>

<p><br />
  There's also a newish book dedicated to the topic of <a href="http://www.pragprog.com/titles/fr_secure/security-on-rails">security on rails</a>.  I picked up a copy at the conference (I'm a sucker for the O'Reilly stand!), so I've not had time to get all the way through it, but first impressions are that it'll be very good, with concrete examples of broken rails applications and how to fix them.</p>]]>
        
    </content>
</entry>

<entry>
    <title>Scottish Ruby Conference &amp; Breaking things with Ruby</title>
    <link rel="alternate" type="text/html" href="http://www.mccune.org.uk/blog/2010/03/scottish-ruby-c-1.html" />
    <id>tag:www.mccune.org.uk,2010:/blog//1.538</id>

    <published>2010-03-26T20:39:59Z</published>
    <updated>2010-03-26T21:10:00Z</updated>

    <summary>Just had the first day of the Scottish Ruby Conference. The venue was awesome, there&apos;ll doubtless be lots of good pictures up on places like flickr in due course, but here&apos;s a couple I snapped with my Nokia n900. The...</summary>
    <author>
        <name>Rory2</name>
        <uri>http://www.mccune.org.uk</uri>
    </author>
    
        <category term="Metasploit" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://www.mccune.org.uk/blog/">
        <![CDATA[<p>Just had the first day of the <a href="http://www.scottishrubyconference.com">Scottish Ruby Conference</a>.  The venue was awesome, there'll doubtless be lots of good pictures up on places like flickr in due course, but here's a couple I snapped with my Nokia n900. The three track rooms were the <a href="http://www.mccune.org.uk/presentations/src_conference_hall.png">Conference Hall</a>, the <a href="http://www.mccune.org.uk/presentations/src_great_hall.png">Great Hall</a> and my personal favourite <a href="http://www.mccune.org.uk/presentations/src_new_library"> the "new" library</a>.</p>

<p>The talks were interesting as always, personal highlight for me had to be Jim Weirich managing to go from particle physics to functional programming seamlessly in a single talk!</p>

<p>my talk was on breaking things with ruby and was a pretty quick look at the world of penetration testing and some of the cool projects (primarily Metasploit) which use ruby in this area. My slides can be found <a href="http://www.mccune.org.uk/presentations/breaking-things-with-ruby.pdf">here</a> and if people are interested in more information on the topics I covered here's some good linkage to start with.</p>

<p><strong><big>Metasploit</big></strong></p>

<p><a href="http://www.metasploit.com">The Main Metasploit Website</a> . This is the best place to start.  There's also a wiki and source code repository on their redmine site <a href="http://www.metasploit.com/redmine/projects/framework/">here</a></p>

<p><a href="http://www.offensive-security.com/metasploit-unleashed/">Metasploit Unleashed</a>. This is a free training course from Offensive Security which offers a good place to start with Metasploit, and covers a lot more ground than I could today.</p>

<p>Blog-wise there's a couple of places I consistently find good information on Metasploit.  <a href="http://carnal0wnage.attackresearch.com/">Carnal0wnage's blog</a> and the <a href="http://www.darkoperator.com/">Dark Operator</a> blogs have lots of posts on what can be done with Metasploit, as well as the <a href="http://blog.metasploit.com/">Official Metasploit Blog</a> of course.  </p>

<p>Also on twitter following <a href="http://twitter.com/hdmoore">@hdmoore</a>, <a href="http://twitter.com/carnal0wnage">@carnal0wnage</a> and <a href="http://twitter.com/egyp7">@egyp7</a> is a good place to start.</p>

<p>Lastly if anyone's looking for videos demonstrating Metasploit, there's quite a few on <a href="http://www.securitytube.net">Security Tube</a> amongst other places.</p>

<p><br />
</p>]]>
        
    </content>
</entry>

<entry>
    <title>Scottish Ruby Conference</title>
    <link rel="alternate" type="text/html" href="http://www.mccune.org.uk/blog/2010/02/scottish-ruby-c.html" />
    <id>tag:www.mccune.org.uk,2010:/blog//1.537</id>

    <published>2010-02-15T18:20:23Z</published>
    <updated>2010-02-15T18:24:59Z</updated>

    <summary>If you&apos;ve not already heard about it, the Scottish Ruby Conference is coming up in March in Edinburgh. There&apos;s a really interesting set of presentations lined up for this years conference, and the hardest thing, I reckon, will be picking...</summary>
    <author>
        <name>Rory2</name>
        <uri>http://www.mccune.org.uk</uri>
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://www.mccune.org.uk/blog/">
        <![CDATA[<p>If you've not already heard about it, the <a href="http://scottishrubyconference.com/posts"> Scottish Ruby Conference </a> is coming up in March in Edinburgh.  There's a really interesting set of presentations lined up for this years conference, and the hardest thing, I reckon, will be picking between the three tracks!  </p>

<p>I've been very lucky to get my talk accepted for this years conference, so I'll be talking about "Breaking things with ruby".  It sits very nicely for me at the corner of two of my main computing interests.  Using ruby and ... well breaking stuff!</p>]]>
        
    </content>
</entry>

<entry>
    <title>Ruby SSL Checker</title>
    <link rel="alternate" type="text/html" href="http://www.mccune.org.uk/blog/2010/01/ruby-ssl-checke.html" />
    <id>tag:www.mccune.org.uk,2010:/blog//1.536</id>

    <published>2010-01-04T20:43:45Z</published>
    <updated>2010-01-05T18:08:54Z</updated>

    <summary>After reading a post by Gursev Kalra here, I decided to have a shot at putting together a slightly expanded version of his ssl Cipher suite checking code in ruby. I&apos;ve got it working reasonably well in my tests and...</summary>
    <author>
        <name>Rory2</name>
        <uri>http://www.mccune.org.uk</uri>
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://www.mccune.org.uk/blog/">
        <![CDATA[<p>After reading a post by Gursev Kalra <a href="http://gursevkalra.blogspot.com/2009/09/ruby-and-openssl-based-ssl-cipher.html">here</a>, I decided to have a shot at putting together a slightly expanded version of his ssl Cipher suite checking code in ruby.</p>

<p>I've got it working reasonably well in my tests and it can chuck out reports in text and XML .  The code for the main script and a Metasploit module which does the same is <a href="http://wiki.mccune.org.uk/index.php/RubySSLChecker"> here</a>.  Any feedback/suggestions welcome :)</p>]]>
        
    </content>
</entry>

<entry>
    <title>Tools I use - Burp</title>
    <link rel="alternate" type="text/html" href="http://www.mccune.org.uk/blog/2010/01/tools-i-use---b.html" />
    <id>tag:www.mccune.org.uk,2010:/blog//1.535</id>

    <published>2010-01-04T19:14:25Z</published>
    <updated>2010-01-04T19:30:05Z</updated>

    <summary>I&apos;ve been meaning to do a post on burp for a while, and courtesy of my new years resolution to stop procrastinating, here it is :) I was thinking of a way to sum up burp, so far the best...</summary>
    <author>
        <name>Rory2</name>
        <uri>http://www.mccune.org.uk</uri>
    </author>
    
        <category term="Penetration Testing" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Web Security" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://www.mccune.org.uk/blog/">
        <![CDATA[<p>I've been meaning to do a post on <a href="http://portswigger.net/">burp</a> for a while, and courtesy of my new years resolution to stop procrastinating, here it is :)</p>

<p>I was thinking of a way to sum up burp, so far the best I've got is "If you're doing web application testing and not using Burp, you're missing out !", it is that useful...</p>

<p>Burp has been around for a while now as one of a group of handy web application proxy tools along with the likes of <a href="http://www.owasp.org/index.php/Category:OWASP_WebScarab_Project">Web Scarab</a> and <a href="http://www.parosproxy.org/download.shtml">Paros</a>.  Over time it's developed a huge range of handy features, which make web app. testing a lot more productive.</p>

<p>There's the basics, in terms of intercepting and modifying requests, which all the tools in this category tend to do quite well, but on top of that there's just loads of other things that Burp does. </p>

<p>The Web app scanner is a good targetable way to test for several types of common web app vulnerabilities.  As an add-on in the latest beta, there's a wizard which lets you reduce the number of requests that Burps going to make, by removing duplicates and similar requests.  If you've used many commercial web app. scanners you'll know that volume of requests generated can be a real problem, so anything that can help bring down the load is useful.</p>

<p>Another stand-out feature of Burp for me, is intruder which lets you pick a specific parameter or set of parameters from a request and easily modify them.  As an example pretty much every time I see a URL that looks like <b>request.asp?id=123</b> , it's going to be worth running burp Intruder over that parameter to see what pops up when you change that value.</p>

<p>One of the things I have found about burp is that it's easy to miss functions that are available and not get the best out of it.  Luckily there's a <a href="blog.portswigger.net">blog</a> which covers a lot of the new features as they come out.  Also I need to mention the Burp Tip of the Day series of posts on <a href="http://cktricky.blogspot.com/search?q=BTOD">Cktricky's blog</a> which has loads of good tips on getting more out of Burp.</p>]]>
        
    </content>
</entry>

<entry>
    <title>... And we&apos;re back</title>
    <link rel="alternate" type="text/html" href="http://www.mccune.org.uk/blog/2009/12/-and-were-back.html" />
    <id>tag:www.mccune.org.uk,2009:/blog//1.534</id>

    <published>2009-12-31T14:26:13Z</published>
    <updated>2009-12-31T14:59:55Z</updated>

    <summary>So, we&apos;re back from a bit of an unscheduled break for my web server. The hosting company had a bit of a problem with disks, so my VM has been out of action for a week or so. Luckily, my...</summary>
    <author>
        <name>Rory2</name>
        <uri>http://www.mccune.org.uk</uri>
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://www.mccune.org.uk/blog/">
        <![CDATA[<p>So, we're back from a bit of an unscheduled break for my web server.  The hosting company had a bit of a problem with disks, so my VM has been out of action for a week or so.</p>

<p>Luckily, my backups worked pretty well so minimal content lost.  I'm using the rather unorthodox backup over SMTP, which seems to work pretty well for smaller files.  I knocked up a ruby class called <a href="http://wiki.mccune.org.uk/index.php/Ruby_Backup_Class">Rbackup</a> and just have a script running in cron nightly...</p>

<p>Actually had a trio of hardware failures over the festive period (2 hard disks and a graphics card), which just goes to show that checking backups (and restores!) is very important and not to be put off...</p>]]>
        
    </content>
</entry>

<entry>
    <title>Nokia N900 - Ultimate Hackers Phone?</title>
    <link rel="alternate" type="text/html" href="http://www.mccune.org.uk/blog/2009/12/nokia-n900---ul.html" />
    <id>tag:www.mccune.org.uk,2009:/blog//1.533</id>

    <published>2009-12-20T12:30:33Z</published>
    <updated>2009-12-20T12:44:39Z</updated>

    <summary>I got a Nokia N900 the other week and I&apos;ve started playing around with the software. At heart it runs Maemo Linux which is based on debian, so in theory any software that runs on debian should run on the...</summary>
    <author>
        <name>Rory2</name>
        <uri>http://www.mccune.org.uk</uri>
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://www.mccune.org.uk/blog/">
        <![CDATA[<p>I got a <a href="http://europe.nokia.com/find-products/devices/nokia-n900#/main/landing"> Nokia N900</a> the other week and I've started playing around with the software.</p>

<p>At heart it runs <a href="http://www.maemo.org">Maemo Linux</a> which is based on debian, so in theory any software that runs on debian should run on the phone !</p>

<p>Also unlike other smart phones which can be coaxed into running linux, the N900 has a shell out of the box and getting root access just requires a package install and issuing the "sudo gainroot" command.</p>

<p>So far I've found the ssh client pretty handy, and openvpn is available in the maemo-testing repository for all your vpn needs.</p>

<p>In terms of the hardware it's got a variety of interfaces which could be pretty cool for hacking testing.  There's wifi and GPS for war-driving/walking and obviously having 3G data is pretty useful when out and about :)</p>

<p>Getting software to run on it, isn't always quite as straightforward as just apt-get, as the repositories don't have the breadth of the debian ones yet.  So if it's not already available in maemo-extras/testing/devel then cross-compiling is the way to go.</p>

<p>The Cross-compile environment is reasonably straightforward to get <a href="http://www.forum.nokia.com/info/sw.nokia.com/id/c05693a1-265c-4c7f-a389-fc227db4c465/Maemo_5_SDK.html">set-up</a> and there's instructions on the maemo wiki for <a href="http://wiki.maemo.org/Documentation/Maemo_5_Developer_Guide/Packaging,_Deploying_and_Distributing#Making_Application_Packages">packaging apps</a></p>

<p>So far I've ported nmap 5.00 across to it, and that runs just fine, kismet seems to run ok but the default console colours make it a bit unreadable, so more work there.</p>

<p>Ruby 1.8.7 is available in the repositories and I've had Metasploit running (albeit a bit slowly).</p>

<p>All in all it's definitely smarter than your average smart phone!</p>]]>
        
    </content>
</entry>

<entry>
    <title>OWASP Scotland - November Meeting</title>
    <link rel="alternate" type="text/html" href="http://www.mccune.org.uk/blog/2009/11/owasp-scotland-1.html" />
    <id>tag:www.mccune.org.uk,2009:/blog//1.532</id>

    <published>2009-11-19T20:14:19Z</published>
    <updated>2009-11-19T20:16:37Z</updated>

    <summary>OWASP Scotland November meeting is next Thursday, the 26th. We&apos;ve got something a bit different lined up with the main presentation being one on physical security and lock picking (hey if you can break into the server room and take...</summary>
    <author>
        <name>Rory2</name>
        <uri>http://www.mccune.org.uk</uri>
    </author>
    
    <category term="owaspscotland" label="OWASP Scotland" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://www.mccune.org.uk/blog/">
        <![CDATA[<p>OWASP Scotland November meeting is next Thursday, the 26th.  We've got something a bit different lined up with the main presentation being one on physical security and lock picking (hey if you can break into the server room and take the box, who needs SQL injection ;oP )</p>

<p>More information <a href="http://www.owasp.org/index.php/Scotland#Local_News">here</a></p>]]>
        
    </content>
</entry>

</feed>
