Skip to content

Instantly share code, notes, and snippets.

@boxofrox
boxofrox / .bashrc
Created February 10, 2020 18:52 — forked from kevinoid/.bashrc
GnuPG pinentry script for terminal or graphical interface based on $PINENTRY_USER_DATA.
# ~/.bashrc: executed by bash(1) for non-login shells.
# If file exists (likely) copy fragment below into existing script:
# If stdin is a terminal
if [ -t 0 ]; then
# Set GPG_TTY so gpg-agent knows where to prompt. See gpg-agent(1)
export GPG_TTY="$(tty)"
# Set PINENTRY_USER_DATA so pinentry-auto knows to present a text UI.
export PINENTRY_USER_DATA=USE_TTY=1
@boxofrox
boxofrox / playground.rs
Created March 13, 2018 18:36 — forked from anonymous/playground.rs
Rust code shared from the playground
#[macro_use] extern crate nom;
fn to_s(i: Vec<u8>) -> String {
String::from_utf8_lossy(&i).into_owned()
}
named!( single_quoted_shell_arg(&[u8]) -> String
, map!( delimited!( char!('\'')
, escaped_transform!( take_until!("\\'")
, "\\"
@boxofrox
boxofrox / openssl-self-signed-san-certificate.md
Created June 30, 2017 00:23 — forked from jdeathe/openssl-self-signed-san-certificate.md
How to generate a self-signed SAN SSL/TLS certificate using openssl

How to generate a self-signed SAN SSL/TLS certificate using openssl

Generating a self-signed certificate is a common taks and the command to generate one with openssl is well known and well documented. Generating a certificate that includes subjectAltName is not so straght forward however. The following example demonstrates how to generate a SAN certificate without making a permanent change to the openssl configuration.

Generate a list of all required DNS names, (Note: CN will be discarded).

$ export SAN="DNS:www.domain.localdomain,DNS:domain.localdomain"
@boxofrox
boxofrox / playground.rs
Created May 30, 2017 03:20 — forked from anonymous/playground.rs
Rust code shared from the playground
extern crate serde;
#[macro_use]
extern crate serde_derive;
extern crate serde_json;
use std::collections::HashMap;
use serde::{Serialize, Serializer};
fn main() {
let mut map: HashMap<String, String> = HashMap::new();
@boxofrox
boxofrox / main.rs
Last active May 23, 2017 23:52 — forked from ob/gist:11961f2f82fc7001c71444d261352f94
tokio-rs : two url example -> many url example
extern crate curl;
extern crate futures;
extern crate time;
extern crate tokio_core;
extern crate tokio_curl;
extern crate tokio_timer;
use curl::easy::Easy;
use futures::{Future, Stream};
use futures::stream::futures_unordered;
@boxofrox
boxofrox / NmapHeartbleed.md
Created November 17, 2015 20:03 — forked from bonsaiviking/NmapHeartbleed.md
Guide to using Nmap to scan for the Heartbleed bug.

Requirements

  1. Nmap. The script requires version 6.25 or newer. The latest version, 6.47, already includes the next 3 dependencies, so you can skip directly to the Scanning section below.
    • An easy way to get the latest Nmap release is to use Kali Linux.
    • Binary installers are available for Windows.
    • RPM installer available for Linux, or install from source.
    • .dmg installer available for Mac OS X.
  2. tls.lua. The script requires this Lua library for TLS handshaking.
  3. ssl-heartbleed.nse. This is the script itself.