Skip to content

Instantly share code, notes, and snippets.

@Scherlac
Scherlac / get_tds_cert.py
Last active February 14, 2024 15:11 — forked from lnattrass/get_tds_cert.py
A terrible way to connect to MS SQL Server and dump the certificate as a PEM
import sys
import pprint
import struct
import socket
import ssl
from time import sleep
# Standard "HELLO" message for TDS
prelogin_msg = bytearray([ 0x12, 0x01, 0x00, 0x2f, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x06, 0x01, 0x00, 0x20,
0x00, 0x01, 0x02, 0x00, 0x21, 0x00, 0x01, 0x03, 0x00, 0x22, 0x00, 0x04, 0x04, 0x00, 0x26, 0x00,
@Scherlac
Scherlac / .tmux.conf
Last active May 13, 2023 06:17 — forked from Rangozhang/.tmux.conf
A vim-friendly tmux config
# change prefix to Ctrl-a (like in gnu-screen)
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# start with window 1 (instead of 0)
set -g base-index 1
@Scherlac
Scherlac / ssh-copy.ps1
Last active December 4, 2023 21:40
This is a powershell script to copy the ssh key to a remote host
<#
.SYNOPSIS
This is a powershell script to copy the ssh key to a remote host
.DESCRIPTION
This is a powershell script to copy the ssh key to a remote host