Skip to content

Instantly share code, notes, and snippets.

View erran-r7's full-sized avatar
:shipit:

Erran Carey erran-r7

:shipit:
View GitHub Profile
# NOTE: Grepping through ~/.vagrant.d/gems/specifications/ for installed versions isn't the way to do this
# TODO: Add Bundler/Berkshelf-like version management
# TODO: Try to use the Ruby equivalent (located in Vagrant's PluginCommand class) w/out OptParser
def plugin(name, version = nil, opts = {})
puts "Inside of the plugin method: name: #{name}, version: #{version}, opts: #{opts}"
@vagrant_home ||= opts[:home_path] || ENV['VAGRANT_HOME'] || "#{ENV['HOME']}/.vagrant.d"
plugins = JSON.parse(File.read("#@vagrant_home/plugins.json"))
if !plugins['installed'].include?(name) || (version && !version_matches(name, version))
cmd = "vagrant plugin install"
@erran-r7
erran-r7 / exploit_metadata
Last active December 19, 2015 03:09
Metasploit Exploit Metadata A hacked together script from msfcli. Drop this in your metasploit root to list metadata on exploit modules.
#!/usr/bin/env ruby
require 'json'
$:.unshift(File.expand_path(File.join(File.dirname(__FILE__), 'lib')))
require 'msf/base'
framework = Msf::Simple::Framework.create(:module_types => ['exploit'])
@mods = []
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = 'precise64'
client_vagrantfile = File.expand_path('../Vagrantfile.client', __FILE__)
eval File.read(client_vagrantfile) if File.exists?(client_vagrantfile)
config.vm.define :server do |server_config|
@erran-r7
erran-r7 / .gvimrc.after
Last active December 19, 2015 17:29 — forked from todb-r7/.vimrc
" If you're using Janus this file is automatically loaded your .vimrc files (some of which are symlinked to Janus' internal vimrc)
set nocompatible
filetype plugin indent on
set hls
" I prefer Mustang, you can pick whatever colorscheme floats your boat
colorscheme Mustang
@erran-r7
erran-r7 / bootstrap.sh
Created July 14, 2013 20:33
vagrant bootstrap script (from @fespinonza's guide)
#!/usr/bin/env bash
apt-get -y update
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev
cd /tmp
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p125.tar.gz
tar -xvzf ruby-1.9.3-p125.tar.gz
cd ruby-1.9.3-p125/
./configure --prefix=/usr/local
make
make install
[health_check] --> /opt/rapid7/metasploit-framework//embedded/metasploit-framework/data/isight.bundle
[health_check] DEPENDS ON: CoreAudioKit
[health_check] COUNT: 1
[health_check] PROVIDED BY: /System/Library/Frameworks/CoreAudioKit.framework/Versions/A/CoreAudioKit
[health_check] FAILED BECAUSE: Unsafe dependency
[health_check] --> /opt/rapid7/metasploit-framework//embedded/metasploit-framework/data/isight.bundle
[health_check] DEPENDS ON: Foundation
[health_check] COUNT: 1
[health_check] PROVIDED BY: /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation
[health_check] FAILED BECAUSE: Unsafe dependency
@erran-r7
erran-r7 / hello-world.js
Last active August 29, 2015 14:02
An example of how backbone extends object
// Javascript function as an object (class)
var Person = {
sayHello: function (otherPerson) {
console.log("Hello, "+otherPerson.name+"!");
},
name: 'Anon',
new: function (name) {
this.name = name;
return this;
}
def doAssessment
puts 'doing assessment'
true
end
# => :doAssessment
success = false
# => false
success &= doAssessment
When(/^I create a copy of the "(.*)" scan template$/) do |template_name|
scan_templates = @nexpose_client.scan_templates
ifnone = -> { raise ArgumentError, "No scan template named '#{template_name}' found." }
template_summary = scan_templates.find(ifnone) do |scan_template|
scan_template.name.eql?(template_name)
end
@scan_template = Nexpose::ScanTemplate.copy(@nexpose_client, template_summary.id)
if scan_templates.map(&:name).include?(@scan_template.name)
@scan_template.name << "via (ControlsInsight automation – #{Time.now.utc.to_i})"