Skip to content

Instantly share code, notes, and snippets.

View postmodern's full-sized avatar
🚧
working on Phase 2 (of Ronin)

Postmodern postmodern

🚧
working on Phase 2 (of Ronin)
View GitHub Profile
#!/usr/bin/env ruby
#
# Name: reval.rb
# License: MIT
# Author: postmodern (postmodern.mod3 at gmail.com)
# Description:
#
# Re-evaluates a specified Ruby file whenever the file changes.
# Reval was inspired by Giles Bowkett's kickass talk on Archaeopteryx at
# RubyFringe 2008, where Giles used some mad Ruby to re-evaluate his
@postmodern
postmodern / framed.rb
Created December 3, 2008 23:29
Generates infinite iframes, also demonstrates why C fails
#!/usr/bin/env ruby
require 'rack'
class FrameD
CHARS = ('a'..'z').to_a
def random_path
(0..10).map { |i|
CHARS[rand(CHARS.length)]
@postmodern
postmodern / build_ruby19.sh
Created February 6, 2009 00:30
Simple shell script that downloads and installs Ruby 1.9.1 alongside 1.8
#!/bin/sh
PATCH=376
mkdir -p /usr/local/src && cd /usr/local/src
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.1-p$PATCH.tar.bz2
tar -xjvf ruby-1.9.1-p$PATCH.tar.bz2
cd ruby-1.9.1-p$PATCH
./configure --prefix=/usr --program-suffix=19 --enable-shared
make && make install
@postmodern
postmodern / yosup.rb
Created February 23, 2009 01:08
A Yo-based communication system
module SophSec
module YoSup
WORDS = %w{dawg sup hi yo}
def YoSup.encode(message)
encoded = []
message = message.to_s
message.each_byte do |b|
encoded << WORDS[(b & 0x03)]
@postmodern
postmodern / middler_keylogger.rb
Created March 23, 2009 09:17
A Keylogger receiver for The Middler using Ronin::Web::Server or Sinatra
gem 'ronin-web'
require 'ronin/web/server'
require 'uri'
include Ronin
Web::Server.start do
paths_like(/^\/(.|%[0-9a-fA-F]{1,2})$/) do |env|
char = URI.decode(env['PATH_INFO'][1..-1])
puts "got char: #{char.dump}"
@postmodern
postmodern / spidr_words.rb
Created March 24, 2009 02:11
A small script which will spider a website and build a word-list
#!/usr/bin/env ruby
gem 'spidr'
require 'spidr'
require 'set'
unless ARGV.length == 2
STDERR.puts "usage: #{$0} HOST FILE"
exit -1
end
@postmodern
postmodern / text_and_links.rb
Created May 3, 2009 22:23
Grabs all the text and <a> tags from a web-page
@postmodern
postmodern / benchmark.rb
Created May 12, 2009 21:33
A simple example showing that it's not hard to write fuzzers in Ruby.
require 'benchmark'
require 'block_fuzzer'
fuzz = SophSec::BlockFuzzer.new('_' * 86, 'EVIL', 4)
puts Benchmark.measure { fuzz.each { |mutant| } }
@postmodern
postmodern / dm_auto_migration_bug.rb
Created June 1, 2009 04:47
Recreation of a DataMapper STI/auto_upgrade bug
gem 'dm-core', '0.10.0'
require 'dm-core'
module ModelMixin
include DataMapper::Types
def self.included(base)
base.module_eval do
include DataMapper::Resource
include DataMapper::Migrations
@postmodern
postmodern / bang_on.rb
Created June 20, 2009 22:52
A web-app profiling and DoS tool.
require 'spidr'
require 'curb'
module Ronin
module Web
#
# "Bang on the bars of the cage which imprisons you. Together, our
# actions can reduce the mightiest of prisons to ruins."
#
# --Anonymous