Skip to content

Instantly share code, notes, and snippets.

View FrankSpierings's full-sized avatar

Frank Spierings FrankSpierings

View GitHub Profile
@FrankSpierings
FrankSpierings / cookie-authenticated-onedrive-enum.py
Created October 6, 2020 16:02
Checks OneDrive access based on someone's UPN.
@FrankSpierings
FrankSpierings / README.MD
Last active June 5, 2021 08:11
Windows Reverse Port Forwarding using C# / Powershell

Socat

  • On the lhost listening side you can use socat to create two server sockets.
socat -dd TCP-LISTEN:4444,reuseaddr,fork TCP-LISTEN:1234,reuseaddr
  • Once WPF connected to port 4444, you can talk to 127.0.0.1:1234 as if it where the remote host.
@FrankSpierings
FrankSpierings / sample-php-socket-connect.php
Created August 11, 2020 09:47
PHP Socket Connect Example Reference
<?php
$host = "ifconfig.co";
$port = 80;
$msg = "GET / HTTP/1.1\r\nHost: $host\r\n\r\n";
$sock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
socket_connect($sock, $host, $port);
socket_send($sock, $msg, strlen($msg), 0);
$result = socket_read($sock, 4096);
echo $result;
@FrankSpierings
FrankSpierings / README.MD
Created August 6, 2020 13:19
Session overwrite in PHP through extract - PoC

Exploit

  • POST-ing a body containing _SESSION[secret]=1 will log you in, but only through the second extract.
<?xml version="1.0"?>
<!DOCTYPE dt [
<!ENTITY sample "KqsdwTrqAisGYNNu5XMhkUV4gTxm8ed8">
]>
<root>&sample;</root>
@FrankSpierings
FrankSpierings / saml-raider-manual-resing.py
Created June 29, 2020 12:40
If SAML Raider won't re-sign the requests....
from lxml import etree
from signxml import XMLSigner, XMLVerifier
self_key_path = 'self.key'
cloned_cert_path ='self.pem'
# Remove signatures using SAML Raider
unsigned_saml_path = 'unsigned_1.xml'
self_key = open(self_key_path).read()
@FrankSpierings
FrankSpierings / ELK-Evtx-and-MSDNS.md
Last active December 14, 2020 12:57
Describes some configuration and scripts to parse Evtx files and MS-DNS Debug query logs to the ELK stack.

Setup Docker Elk Stack

  • Pull the recipe:
cd /tmp
git clone https://github.com/deviantony/docker-elk
  • Add the following to elasticsearch/config/elasticsearch.yml:
@FrankSpierings
FrankSpierings / frida-golang-symbol-enumerate.js
Last active May 29, 2024 06:31
Frida code to enumerate the Golang symbols
const utils = {
colors: {
red: function(string) {
return '\x1b[31m' + string + '\x1b[0m';
},
green: function(string) {
return '\x1b[32m' + string + '\x1b[0m';
},
@FrankSpierings
FrankSpierings / frida-hook-generator.py
Last active January 20, 2024 21:54
Generate Frida hooks based on c header files using pyclibrary
from pyclibrary import CParser
import re
hook_template = '''
(function() {
var name = '__NAME__';
var address = Module.findExportByName(null, name);
if (address != null) {
console.log('[!] Hooking: ' + name + ' @ 0x' + address.toString(16));
@FrankSpierings
FrankSpierings / openssl-frida.js
Last active March 4, 2025 22:22
Some OpenSSL hooks in Frida - Work in progress....
const utils = {
colors: {
red: function(string) {
return '\x1b[31m' + string + '\x1b[0m';
},
green: function(string) {
return '\x1b[32m' + string + '\x1b[0m';
},