Snippet for ~/.bash_profile
, adding hostname autocomplete to ssh
.
Extracts host hints from both ~/.ssh/config
and /etc/hosts
.
function __completeSSHHosts {
COMPREPLY=()
local currentWord=${COMP_WORDS[COMP_CWORD]}
local completeHosts=$(
require 'openssl' | |
key = OpenSSL::PKey::RSA.new(2048) | |
p encrypted_string = key.public_encrypt('my plaintext string', OpenSSL::PKey::RSA::PKCS1_OAEP_PADDING) | |
p decrypted_string = key.private_decrypt(encrypted_string, OpenSSL::PKey::RSA::PKCS1_OAEP_PADDING) |
filepath = 'local-filepath' | |
url = 'web-url' | |
File.open(filepath, 'w') {|f| | |
block = proc { |response| | |
response.read_body do |chunk| | |
puts "Working on response" | |
f.write chunk | |
end | |
} | |
RestClient::Request.new(method: :get, url: url, block_response: block).execute |
tlskeylogger.plist
at ~/Library/LaunchAgents/tlskeylogger.plist
launchctl load ~/Library/LaunchAgents/tlskeylogger.plist
, so it will load on the next restartlaunchctl start ~/Library/LaunchAgents/tlskeylogger.plist
, so it will load the environment variable immediately~/.tlskeyfile
via tail -f ~/.tlskeyfile
The main point is to save the SSL/TLS keys those used by the web browser (SSLKEYLOGFILE=/tmp/tmp-google/.ssl-key.log
).
In the example below we run brand new instance of Google Chrome (--user-data-dir=/tmp/tmp-google
do the trick):
SSLKEYLOGFILE=/tmp/tmp-google/.ssl-key.log /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --user-data-dir=/tmp/tmp-google
Then run the Wireshark and open the Preferences -> Protocols -> SSL, where we put the path to the SSL keys log file into the (Pre)-Master-Secret log filename
field.
Now all SSL/TLS traffic from this browser instance will be decrypted.