Skip to content

Instantly share code, notes, and snippets.

View sroller's full-sized avatar

Steffen Roller sroller

  • Kitchener, ON
  • 11:52 (UTC -05:00)
  • X @sroller
View GitHub Profile
@sroller
sroller / chess960sp.rb
Created April 18, 2022 22:41
create Chess960 starting positions
#!/usr/bin/env ruby
# create Chess960 starting position
# algorithm from https://en.wikipedia.org/wiki/Fischer_random_chess_numbering_scheme
knight_positions = [
['N', 'N', '.', '.', '.'],
['N', '.', 'N', '.', '.'],
['N', '.', '.', 'N', '.'],
['N', '.', '.', '.', 'N'],
@sroller
sroller / gist:b108780e58fd4f1553e2c7603ee71756
Last active September 15, 2020 20:01
Ruby: Nokogiri with XML namespace
#!/usr/bin/env ruby
require 'pp'
require 'nokogiri'
require 'open-uri'
doc = Nokogiri::XML(open('http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml'))
cubes = doc.xpath("//ecb:Cube[@currency='CAD']",
'ecb' => 'http://www.ecb.int/vocabulary/2002-08-01/eurofxref')
@sroller
sroller / regexp2.rb
Created September 15, 2020 19:54
ruby regexp post #2
entry="CN=steffenr,OU=Users,OU=Accounts,DC=big-company,DC=com"
capture=entry.match(/CN=((?:(?!,).)*)/)
capture[1]="steffenr"
@sroller
sroller / regexp1.rb
Created September 15, 2020 19:52
ruby regexp post #1
entry="CN=steffenr,OU=Users,OU=Accounts,DC=big-company,DC=com"
capture=entry.match(/CN=(.*),/)
@sroller
sroller / github_bugbountyhunting.md
Created October 7, 2017 17:43 — forked from EdOverflow/github_bugbountyhunting.md
My tips for finding security issues in GitHub projects.

GitHub for Bug Bounty Hunters

GitHub repositories can disclose all sorts of potentially valuable information for bug bounty hunters. The targets do not always have to be open source for there to be issues. Organization members and their open source projects can sometimes accidentally expose information that could be used against the target company. in this article I will give you a brief overview that should help you get started targeting GitHub repositories for vulnerabilities and for general recon.

Mass Cloning

You can just do your research on github.com, but I would suggest cloning all the target's repositories so that you can run your tests locally. I would highly recommend @mazen160's GitHubCloner. Just run the script and you should be good to go.

$ python githubcloner.py --org organization -o /tmp/output
@sroller
sroller / gist:7a54438428456ab799e9
Created June 17, 2015 17:28
Savon 2.x demo with WSDL
#!/usr/bin/env ruby
#
# demo of Savon 2.x interface with WSDL
#
# gem 'savon', "~>2.x"
require 'savon'
class GetXRate
def initialize
@sroller
sroller / gist:3d04842ab763f52b6623
Created June 17, 2015 17:16
Savon 1.x example with WDSL
gem 'savon', "~>1.0"
require 'savon'
class GetXRate
def initialize
Savon.configure do |c|
c.log = false
end
HTTPI.log = false
#!ruby
# make sure we use version 2.x of Savon
gem 'savon', '~> 2.0'
require 'savon'
require 'nokogiri'
# create the client, switch on nice logging
clnt = Savon.client(
wsdl: 'http://www.webservicex.net/stockquote.asmx?wsdl',