Skip to content

Instantly share code, notes, and snippets.

View limhoff-r7's full-sized avatar

Luke Imhoff limhoff-r7

  • Rapid7, Inc.
  • Austin, TX
View GitHub Profile
@limhoff-r7
limhoff-r7 / authenticate.ex
Created June 3, 2015 19:09
Authenticate user using session or params (uses session keys stuff from Authlogic in Rails). **NOTE: this is does no authorization, another plug needs to be written to require conn.assigns[:authorized_user] is set or that they have permissions to read records**
defmodule Metasploit.Pro.Plugs.Authenticate do
import Ecto.Query, only: [from: 2]
import Plug.Conn
def init(configuration) do
configuration
|> Keyword.put_new(:single_access_token_parm, "single_access_token")
|> valid_configuration!
end
@limhoff-r7
limhoff-r7 / config.exs
Created May 8, 2015 21:07
nginx + phoenix configuration to server phoenix behind nginx at path 'phoenix'. nginx rewrites incoming URLs to strip the /phoenix, while the config.exs for phoenix ensures URLs are prefixed with /phoenix using the config.url.path
# This file is responsible for configuring your application
# and its dependencies with the aid of the Mix.Config module.
#
# This configuration file is loaded before any dependency and
# is restricted to this project.
use Mix.Config
# Configures the namespace used by Phoenix generators
config :my_app,
app_namespace: MyApp

Keybase proof

I hereby claim:

  • I am limhoff-r7 on github.
  • I am kronicdeth (https://keybase.io/kronicdeth) on keybase.
  • I have a public key whose fingerprint is 9C10 5D2E 8AD8 8D65 6A39 E682 5B1F B01F B333 56F8

To claim this, I am signing this object:

# 1. Run `msfconsole`
# 2. Select an module `use payload/windows/patchupdllinject/bind_tcp_rc4`
# 2. Enter `irb` mode
# active_module is the module selected with `use`
module_ancestors = active_module.class.ancestors.select { |ancestor|
ancestor.name.try(:start_with?, 'Msf::Modules::')
}
hex_unpacked_module_ancestor_full_names = module_ancestors.map(&:name).map { |name|
name.sub(/^Msf::Modules::Mod/, '')
@limhoff-r7
limhoff-r7 / .coveralls.yml
Created September 12, 2014 17:48
Open source .coveralls.yml
service_name: travis-ci
@limhoff-r7
limhoff-r7 / spec_helper.rb
Created September 12, 2014 17:45
CodeClimate simplecov formatter
# ...
require 'codeclimate-test-reporter'
if ENV['TRAVIS'] == 'true'
formatters = []
# don't use `CodeClimate::TestReporter.start` as it will overwrite some .simplecov settings
if CodeClimate::TestReporter.run?
formatters << CodeClimate::TestReporter::Formatter
@limhoff-r7
limhoff-r7 / spec_helper.rb
Created September 12, 2014 17:43
Coveralls and CodeClimate formatters for simplecov
# ...
require 'codeclimate-test-reporter'
require 'coveralls'
if ENV['TRAVIS'] == 'true'
formatters = []
# don't use `CodeClimate::TestReporter.start` as it will overwrite some .simplecov settings
if CodeClimate::TestReporter.run?
@limhoff-r7
limhoff-r7 / .travis.yml
Created September 12, 2014 16:48
Adding encrypted CODECLIMATE_REPO_TOKEN to .travis.yml
env:
global:
secure: "G0LDGrupZ+RAFzoPwd6bjfrWfwoU/V9RTswQXIUNmi640rW/CP86a8F9hQcAXdUwy7Ag1cwmlEEv2JDDbLopQdNvkh8B7M3PSIpmJWlBsj+UPMMcCz04oYiQB3G6xgYb4xeuY6cNqxiY2rTJMHlfUfTlSJf1Z0dh6hAS3alHpGw="
@limhoff-r7
limhoff-r7 / .travis.yml
Created September 12, 2014 15:23
Metasploit .travis.yml for all rubies with specs and metasploit-yard's yard task that exits non-zero when there is undocumented code
env:
matrix:
- RAKE_TASK=spec
language: ruby
matrix:
# documentation coverage is not influenced by ruby implementation, so only run once
include:
- rvm: 2.1
env: RAKE_TASK=yard
rvm:
@limhoff-r7
limhoff-r7 / .simplecov
Created September 12, 2014 15:02
Metasploit .simplecov
# RM_INFO is set when using Rubymine. In Rubymine, starting SimpleCov is
# controlled by running with coverage, so don't explicitly start coverage (and
# therefore generate a report) when in Rubymine. This _will_ generate a report
# whenever `rake spec` is run.
unless ENV['RM_INFO']
SimpleCov.start
end
SimpleCov.configure do
# ignore this file