Skip to content

Instantly share code, notes, and snippets.

View mikalv's full-sized avatar

Mikal mikalv

View GitHub Profile
@mikalv
mikalv / sshtunnel.go
Created January 29, 2022 19:41 — forked from iamralch/sshtunnel.go
SSH tunnelling in Golang
package main
import (
"log"
"bufio"
"time"
"os"
"fmt"
"io"
"net"
@mikalv
mikalv / public-tmux
Created January 29, 2022 15:51 — forked from madars/public-tmux
A read-only tmux session for demos and remote debugging
#!/bin/sh
# To be used with something like this in sshd_config:
#
# Match User public-tmux
# X11Forwarding no
# AllowTcpForwarding no
# PasswordAuthentication yes
# ForceCommand /usr/bin/tmux -S /tmp/public-tmux-socket attach -r -t public
#
@mikalv
mikalv / golang-tls.md
Created January 27, 2022 16:00 — forked from denji/golang-tls.md
Simple Golang HTTPS/TLS Examples

Moved to git repository: https://github.com/denji/golang-tls

Generate private key (.key)
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048

# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)
@mikalv
mikalv / client.go
Created January 27, 2022 15:55 — forked from xjdrew/client.go
golang tls client and server, require and verify certificate in double direction
package main
import (
"crypto/tls"
"crypto/x509"
"flag"
"io"
"io/ioutil"
"log"
"os"
@mikalv
mikalv / pkcs11-tls-proxy.go
Created January 27, 2022 13:39 — forked from korc/pkcs11-tls-proxy.go
PKCS11-authenticated TLS socket proxy
package main
import (
"crypto/tls"
"flag"
"fmt"
"io"
"log"
"net"
"net/textproto"
@mikalv
mikalv / grafana_dashboard.json
Created January 23, 2022 01:18 — forked from skosch/grafana_dashboard.json
Very simple Grafana dashboard for Prometheus Elixir metrics
{
"__inputs": [
{
"name": "DS_PROMETHEUS",
"label": "Prometheus",
"description": "",
"type": "datasource",
"pluginId": "prometheus",
"pluginName": "Prometheus"
}
@mikalv
mikalv / box.ex
Created December 18, 2021 22:46 — forked from teamon/box.ex
Define elixir structs with typespec with single line of code
defmodule Box do
defmacro __using__(_env) do
quote do
import Box
end
end
@doc """
Define module with struct and typespec, in single line
@mikalv
mikalv / musl-bootstrap.sh
Created December 15, 2021 19:14 — forked from kukrimate/musl-bootstrap.sh
musl-bootstrap.sh
#!/bin/bash
# This script builds a (hopefully) working gcc based cross compiler
# Update to latest stable release
BINUTILS_VERSION=2.27
GMP_VERSION=6.1.2
MPFR_VERSION=3.1.5
MPC_VERSION=1.0.3
ISL_VERSION=0.16.1
GCC_VERSION=6.3.0
@mikalv
mikalv / .vpn_helpers.sh
Created December 14, 2021 00:54 — forked from rfairburn/.vpn_helpers.sh
Mac OS X command-line VPN Helpers
#!/bin/bash
# Source this file in your .bash_profile e.g.:
#
# source ~/gitcheckouts/vpn_heplers/.vpn_helpers.sh
#
# Note: This script works best with NOPASSWD: ALL configured in your sudoers file:
# /etc/sudoers:
# %admin ALL=(ALL) NOPASSWD: ALL
#
@mikalv
mikalv / reference.txt
Created December 4, 2021 14:28 — forked from hartescout/reference.txt
macOS Internals, Reversing, and Analysis reference I've found essential.
## In no particular order. I'm pulling these from a bookmark folder, I'll work on labeling as I have time. Hope these help. Will be mixing in Linux reference as well.
Sidenote: the macOS Internals series is amazing, although might be out of reach for some. However if having a hard time deciding (I definitely way) and in budget, In my opinion, they are worth the price. I've worked through Volume II, waiting on Volume III.
As always, most of what we need in our world can be found open sourced and provided by some of the brightest, but it can be a frustrating journey finding material.
https://www.intezer.com/blog/malware-analysis/elf-malware-analysis-101-linux-threats-no-longer-an-afterthought/
http://timetobleed.com/dynamic-linking-elf-vs-mach-o/
https://github.com/apple/darwin-xnu
https://opensource.apple.com/source/xnu/
https://developer.apple.com/library/archive/documentation/Darwin/Conceptual/KernelProgramming/Architecture/Architecture.html