Skip to content

Instantly share code, notes, and snippets.

View keyboardcrunch's full-sized avatar

keyboardcrunch keyboardcrunch

View GitHub Profile
@keyboardcrunch
keyboardcrunch / managed_policy.json
Created June 1, 2023 23:19
Chrome Enterprise Linux policy - allows all hosted extensions and uBlock-Origin
# Allows install of any locally hosted extensions, restricts webstore extensions without explicit allow.
{
"HomepageLocation": "https://www.google.com",
"HomepageIsNewTabPage": false,
"ExtensionSettings": {
"*": {
"installation_mode": "blocked",
"blocked_install_message": "Extension installation is restricted to reviewed and approved only.",
"blocked_permissions": [],
"install_sources": [
@keyboardcrunch
keyboardcrunch / disable_winsvc.ps1
Last active May 17, 2023 01:21
Windows Services to disable
$ServiceList = @'
diagtrack
dusmsvc
dps
wdiservicehost
wdisystemhost
mapsbroker
fhsvc
GoogleChromeElevationService
gupdate

Nginx mTLS Setup

This configuration will setup an Nginx server that requires a valid client certificate for mutual tls. We'll cover some basic certificate setup, the nginx config, and some openssl conversions for browser certificate import.

Certificate Setup

Creating the Certificates Manually

Create the CA

openssl genrsa -out ca.key 4096
openssl req -new -x509 -key ca.key -out ca.crt

Steps

  1. Download and install 7-Zip
  2. Download and extract the 7-zip extras.
  3. Create a payload build directory and copy the 7zS.sfx file from extras into it.
  4. Right-click and 7z archive your decoy payload, move it to a stand-alone payload build directory.
  5. Craft your payload and save it as config.txt (See payloads below, must be in UTF-8 format) within this payload build directory.
  6. With cmd.exe binary combine the files, copy /b 7zS.sfx + config.txt + decoy.7z sfx_payload.exe
  7. Distribute and test your sfx mayhem carefully.
@keyboardcrunch
keyboardcrunch / Headless_xvfb_apps.md
Created January 29, 2023 16:46
Headless xvfb-run Apps

Headless Applications with xvfb and x11vnc

In the code block below we're going to launch two graphical applications on a headless server (no desktop environment) within their own virtual display, then launch an instance of x11vnc server connected to each virtual display. Generally if you have more than one application you might as well run a full desktop environment and vnc server, but this is more fun.

Requirements

  • x11vnc
  • the desktop apps you want (handbrake and firefox used in example)
  • (optional) fluxbox or other minimal DE
@keyboardcrunch
keyboardcrunch / caldera_services.md
Created December 17, 2022 20:46
Caldera services

Caldera Server

Caldera Python Service

The main python caldera service, /etc/systemd/system/caldera.service.

[Unit]
Description=MITRE Caldera Server

[Service]
WorkingDirectory=/opt/caldera
ExecStart=/usr/bin/python3 server.py --insecure
@keyboardcrunch
keyboardcrunch / tailscale.json
Last active November 15, 2022 19:32
Tailscale Host-based ACLs
{
// Declare static groups of users beyond those in the identity service.
"groups": {
"group:admins": ["myadmin@site"],
},
// Declare convenient hostname aliases to use in place of IP addresses.
"hosts": {
"rproxy_ext": "100.100.99.68",
"apps_int": "100.100.99.69",
"supabase": "100.100.99.70",
@keyboardcrunch
keyboardcrunch / boxstarter_example.ps1
Last active March 16, 2024 18:07
Boxstarter single file example
$ChocoFile = Join-Path -Path $(Get-Location) -ChildPath "choco_config.txt"
$ChocoFileSettings = @'
# Software
choco install adobereader
choco install googlechrome
choco install firefox
choco install 7zip.install
# runtimes
choco install adoptopenjdk12
@keyboardcrunch
keyboardcrunch / iddc.sh
Created September 25, 2022 15:01
docker and docker-compose install for Ubuntu
apt update
apt install -y apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
apt update
apt install -y docker-ce docker-compose
usermod -aG docker ${USER}
systemctl start docker.service
docker ps