Skip to content

Instantly share code, notes, and snippets.

View FrankSpierings's full-sized avatar

Frank Spierings FrankSpierings

View GitHub Profile
from scapy.all import *
from scapy.contrib.dtp import *
FLAG_TRUNK = 0x80
RETRY = 10
SEND_WAIT = 5
iface = 'en0'
dtpmac = "01:00:0c:cc:cc:cc"
mymac = get_if_hwaddr(iface)
@FrankSpierings
FrankSpierings / procdump.py
Last active December 25, 2015 14:25
Dump process memory using python3
#! /usr/bin/env python
#
# Modification from:
# https://unix.stackexchange.com/questions/6267/how-to-re-load-all-running-applications-from-swap-space-into-ram/6271
#
# For non-root check 'cat /proc/sys/kernel/yama/ptrace_scope' = 0
# Reference: https://www.kernel.org/doc/Documentation/security/Yama.txt
#
import re
import sys
$DebugPreference = "Continue"
function Create-Base64Payload()
{
param(
$Filename
)
$content = (Get-Content -Path $Filename | Out-String)
$command = [Convert]::ToBase64String([System.Text.Encoding]::Unicode.GetBytes($content))
Write-Debug "[+] Mind the newlines!"
Write-Debug "[+] Powershell.exe -EncodedCommand $command"
from burp import IBurpExtender
from burp import IHttpListener
_bearer = dict()
_AUTHORIZATION_HEADER = 'Authorization: Bearer'
class BurpExtender(IBurpExtender, IHttpListener):
def registerExtenderCallbacks(self, callbacks):
self._callbacks = callbacks
self._helpers = callbacks.getHelpers()
@FrankSpierings
FrankSpierings / wireshark-2.0-sap.build.sh
Last active October 10, 2016 07:38
Wireshark 2.0 master + SAP dissector
#!/bin/bash
mkdir wireshark-sap
cd wireshark-sap
git clone https://github.com/CoreSecurity/SAP-Dissection-plug-in-for-Wireshark.git
mkdir wireshark-master-2.0
cd wireshark-master-2.0
git init
git remote add -t master-2.0 -f origin https://github.com/wireshark/wireshark.git
$source = @"
/*
* This implementation of Salsa20 is ported from the reference implementation
* by D. J. Bernstein, which can be found at:
* http://cr.yp.to/snuffle/salsa20/ref/salsa20.c
*
* This work is hereby released into the Public Domain. To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.
*/
#Thank you Bouncy Castle.
#Slight code modifications compared to the original C# code.
$source = @"
using System;
using System.Diagnostics;
using Org.BouncyCastle.Utilities;
namespace Org.BouncyCastle.Crypto.Digests
{
@FrankSpierings
FrankSpierings / FindShares.ps1
Created December 25, 2015 09:41
Uses PowerView (active download) to get all the domain computers and try to access the shares.
$host_filter = '^C|^T'
$share_filter = 'IPC$'
$depends_url = "https://raw.githubusercontent.com/PowerShellEmpire/PowerTools/master/PowerView/powerview.ps1"
$logfile = "foundshares.log"
$serialobj = $("{0}.xml" -f $logfile)
$DebugPreference = "Continue"
#$DebugPreference = "SilentlyContinue"
#Import dependency
# https://gallery.technet.microsoft.com/scriptcenter/PowerShellAccessControl-d3be7b83#
Import-Module PowerShellAccessControl
# Find files/dirs recursive | grab their ACL | Special effective perms module, grab all rights for our user | select only objects with write perms | show the path to the object
gci -Recurse c:\ | Get-Acl | Get-EffectiveAccess -ListAllRights -Principal $Env:USERNAME |? {($_.Permission -eq 'Write')} |% {$_.DisplayName}
import string
from math import sqrt; from itertools import count, islice
def isPrime(n):
return n > 1 and all(n%i for i in islice(count(2), int(sqrt(n)-1)))
orgname = input('Give me a name:')
name = orgname.lower()
name = name.replace(' ','')