Skip to content

Instantly share code, notes, and snippets.

View boogy's full-sized avatar

Boogy boogy

View GitHub Profile
@boogy
boogy / harden.sh
Created February 25, 2020 10:05 — forked from kost/harden.sh
hardening script for an alpine docker container
#!/bin/sh
set -x
set -e
#
# Docker build calls this script to harden the image during build.
#
# NOTE: To build on CircleCI, you must take care to keep the `find`
# command out of the /proc filesystem to avoid errors like:
#
# find: /proc/tty/driver: Permission denied
@boogy
boogy / nginx.conf
Created December 12, 2018 10:05 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@boogy
boogy / windows_hardening.cmd
Created November 5, 2018 09:03 — forked from mackwage/windows_hardening.cmd
Script to perform some hardening of Windows OS
::
::#######################################################################
::
:: Change file associations to protect against common ransomware attacks
:: Note that if you legitimately use these extensions, like .bat, you will now need to execute them manually from cmd or powershell
:: Alternatively, you can right-click on them and hit 'Run as Administrator' but ensure it's a script you want to run :)
:: ---------------------
ftype htafile="%SystemRoot%\system32\NOTEPAD.EXE" "%1"
ftype WSHFile="%SystemRoot%\system32\NOTEPAD.EXE" "%1"
ftype batfile="%SystemRoot%\system32\NOTEPAD.EXE" "%1"
@boogy
boogy / arch-linux-install
Last active February 19, 2018 12:22 — forked from mattiaslundberg/arch-linux-install
Minimal instructions for installing arch linux on an UEFI system with full system encryption using dm-crypt and luks
# Install ARCH Linux with encrypted file-system and UEFI
# The official installation guide (https://wiki.archlinux.org/index.php/Installation_Guide) contains a more verbose description.
# Download the archiso image from https://www.archlinux.org/
# Copy to a usb-drive
dd if=archlinux.img of=/dev/sdX bs=16M && sync # on linux
# Boot from the usb. If the usb fails to boot, make sure that secure boot is disabled in the BIOS configuration.
# Set swedish keymap
@boogy
boogy / nginx.conf
Created February 8, 2017 14:42 — forked from revolunet/nginx.conf
Nginx, gunicorn + ssl (django)
upstream myapp_prod {
server unix:/home/apps/project/wsgi/gunicorn.sock fail_timeout=0;
}
server {
listen 80 default_server;
server_name .project.com;
return 301 https://www.project.com$request_uri;
}
@boogy
boogy / reclaimWindows10.ps1
Created January 9, 2017 08:06 — forked from alirobe/reclaimWindows10.ps1
"Reclaim Windows 10" turns off a bunch of unnecessary Windows 10 telemetery, removes bloatware, and privacy invasions. Review and tweak before running. Scripts for reversing are included and commented. Fork via https://github.com/Disassembler0 (different defaults)
##########
# Win10 Initial Setup Script
# Author: Disassembler <[email protected]>
# Version: 1.7, 2016-08-15
# dasm's script: https://github.com/Disassembler0/Win10-Initial-Setup-Script/
# THIS IS A PERSONALIZED VERSION
# This script leaves more MS defaults on, including MS security features.
# Tweaked based on personal preferences for @alirobe 2016-11-16 - v1.7.1
@boogy
boogy / .screenrc
Created September 10, 2016 19:13 — forked from jelsas/.screenrc
.screenrc file that adds ctrl-arrow window switching, a nice status & a few other things
# the following two lines give a two-line status, with the current window highlighted
#hardstatus alwayslastline "%= %3n %t%? [%h]%? %="
#caption always "%= %-w%L>%{= BW}%n*%t%{-}%52<%+w %L="
hardstatus alwayslastline
hardstatus string '%{= kG}[%{G}%H%? %1`%?%{g}][%= %{= kw}%-w%{+b yk} %n*%t%?(%u)%? %{-}%+w %=%{g}][%{B}%m/%d %{W}%C%A%{g}]'
defscrollback 3000
@boogy
boogy / WMI_persistence_template.ps1
Created September 6, 2016 08:46
Fileless WMI persistence payload template (CommandlineEventConsumer, __IntervalTimerInstruction trigger, w/ registry payload storage)
# Step #1 - Prep payload
$Hive = 'HKLM'
$PayloadKey = 'SOFTWARE\PayloadKey'
$PayloadValue = 'PayloadValue'
$TimerName = 'PayloadTrigger'
$EventFilterName = 'TimerTrigger'
$EventConsumerName = 'ExecuteEvilPowerShell'
switch ($Hive) {
'HKLM' { $HiveVal = [UInt32] 2147483650 }
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
import logging
import logging.handlers
class ColorFormatter(logging.Formatter):
"""Format logging with nice colors"""
FORMAT_CON = ("[$BOLD%(asctime)-20s$RESET]"
" [%(levelname)-19s] %(message)s ")
@boogy
boogy / recvfd.c
Last active January 7, 2016 07:31 — forked from kokjo/recvfd.c
Receive a file descriptor over a abstract unix domain socket.
// compile with gcc -static -o recvfd recvfd.c
// ./recvfd foobar /bin/bash
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <strings.h>
static int recv_fd(int sock){
// This function does the arcane magic recving
// file descriptors over unix domain sockets