Skip to content

Instantly share code, notes, and snippets.

View kernelsmith's full-sized avatar
💭
I'm not entirely sure.

Josh kernelsmith

💭
I'm not entirely sure.
View GitHub Profile
@kernelsmith
kernelsmith / gpgme_basic_usage.md
Last active February 23, 2024 17:03
Basic GPGME ruby gem usage

Basic GPGME Ruby Gem Usage

I just found this API ridiculously confusing to use, and maybe I just suck, but I don't want to figure it out again, so I'm writing it down here

Establish a gpg home dir if desired

Optional, but if you have an established gpg home dir that you want to use or you don't want it chosen for you

GPGME::Engine.home_dir = "/some/dir" # e.g. env['GNUPG_HOME']
@yajd
yajd / gist search sucks
Created June 4, 2014 19:11
gist search sucks
try `ctypes.jsm ExtractIconEx` it doesnt return anything
then try `ctypes.jsm ExtractIconExW` it returns one entry, this should have been returned on try on line above
@woods
woods / gen-key-script
Last active March 12, 2024 12:00
Creating gpg keys non-interactively
Key-Type: 1
Key-Length: 2048
Subkey-Type: 1
Subkey-Length: 2048
Name-Real: Root Superuser
Name-Email: root@handbook.westarete.com
Expire-Date: 0
@zeroSteiner
zeroSteiner / zenoss_graph_pt.rb
Last active December 23, 2015 06:49
Zenoss Custom Graph Point Python Injection
##
# This file is part of the Metasploit Framework and may be subject to
# redistribution and commercial restrictions. Please see the Metasploit
# web site for more information on licensing and terms of use.
# http://metasploit.com/
##
require 'msf/core'
class Metasploit3 < Msf::Exploit::Remote
@kernelsmith
kernelsmith / msf_obj_space_files_exceptions.rb
Created January 9, 2013 18:50
irb/ruby code snippets to find all the active Exceptions or open file handles etc. You may encounter and possibly want to handle these exceptions in code you are writing for msf.
# open file handles
ObjectSpace.each_object(File) {|o| puts o.inspect}
# finding all the active Exceptions which one might have to catch in metasploit
# start msfconsole, proceed to the environment you want to examine, for instance if
# you want to see what exceptions are available in a meterp session, then establish
# one, interace with it, and then...
# run the irb command and enter the following
ObjectSpace.each_object(Class) {|o| puts o.inspect if o.ancestors.include?(Exception)}
@chetan
chetan / yardoc_cheatsheet.md
Last active March 26, 2024 04:19
YARD cheatsheet
require 'rubygems'
require 'wirble'
require 'irb/completion'
require 'pp'
IRB.conf[:AUTO_INDENT] = true
Wirble.init
Wirble.colorize
class Object
# get all the methods for an object that aren't basic methods from Object
@mtigas
mtigas / gist:952344
Last active February 26, 2024 03:00
Mini tutorial for configuring client-side SSL certificates.

Client-side SSL

For excessively paranoid client authentication.


Updated Apr 5 2019:

because this is a gist from 2011 that people stumble into and maybe you should AES instead of 3DES in the year of our lord 2019.

some other notes:

#!/usr/bin/ruby
# This code is to demonstrate these very important things to remember about Ruby:
#
# 1. Classes are also Objects in Ruby.
# 2. Every Object in Ruby has its own Singleton Class (or "Meta Class" or "Eigen
# Class"
# 3. In other languages you may be familiar with the idea that each Object
# Instance is unique, but in Ruby, each Object Instance has its own unique
# Class definition, unique to JUST THAT instance. This is called the Object's
# singleton class.