Skip to content

Instantly share code, notes, and snippets.

View joaf123's full-sized avatar
🕵️‍♀️

Joachim Fosse joaf123

🕵️‍♀️
View GitHub Profile
@joaf123
joaf123 / Bulk Edit Docx.md
Last active August 28, 2024 18:03
Bulk Editing docx Archives Without Losing Metadata Using Powershell

Unpack & Repack docx files for safe & easy bulk editing!

Requires 7z CLI in OS Path!

Unpacks or Repacks docx files so you can work with their XML contents.

Internal metadata/props/refs stored in the files are usually overwritten/lost, when attempting to edit such docx documents with Microsoft Word

Unpacking and repacking the docx files (just a glorified zip archive) allows one to make bulk edits to the docx files by for example search and replacing string content or images stored within the document. Updating the docx files like this also has the benefit of maintaining any internal metadata, unlike Microsoft Word.

@joaf123
joaf123 / GridViews.md
Last active June 15, 2024 13:58
ASP.NET WebForms Quirks in .NET Framework

When using GridViews as the source table for JavaScript plugins like DataTables the header is placed in the tablebody.

The fix for this issue is telling the framework where to draw the row:

    Private Sub _gridView_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles _gridView.RowDataBound
        If e.Row.RowType = DataControlRowType.Header Then
            e.Row.TableSection = TableRowSection.TableHeader
        End If
    End Sub
@joaf123
joaf123 / Blob Constructor Fallback.js
Last active June 16, 2024 15:30
JavaScript Snippet Collection
let blob;
try{
blob = new Blob([response], {type: 'application/javascript'});
} catch(e) {
//Blob Constructor Issue Fallbacks (Taken from https://stackoverflow.com/questions/15293694/blob-constructor-browser-compatibility as a precaution):
window.BlobBuilder = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder || window.MSBlobBuilder;
if (e.name == 'TypeError' && window.BlobBuilder) {
// TypeError old chrome and FF:
const bB = new BlobBuilder();
const _encoder = new TextEncoder()
@joaf123
joaf123 / AMSI_ScanBufferBypass.ps1
Last active April 19, 2024 16:15
Pwsh::Pentesting
# Patching AMSI AmsiScanBuffer - Tested and confirmed working in Pwsh.v7 running on W11, without admin privileges.
# Pre bypass:
╭─
╰─ "Invoke-Mimikatz"
ParserError:
Line |
1 | "Invoke-Mimikatz"
| ~~~~~~~~~~~~~~~~~
| This script contains malicious content and has been blocked by your antivirus software.
@joaf123
joaf123 / 4anime.gg + vidstreaming - Auto Skip & Auto Next.js
Last active August 30, 2024 18:11
Script Collection for Tampermonkey / User JavaScript & CSS Browser Extensions
//Match: https://4anime.gg/*, https://rapid-cloud.co/*
//The script needs to be injected into both the top frame and the iframe hosting the video. Iframe is hosted at https://rapid-cloud.co/*
setInterval(() => {
//Skip Intro:
if (document.querySelector('#skip-intro')) {
document.querySelector('#skip-intro').style.display !== 'none' &&
document.querySelector('#skip-intro').click();
}
# ===== WINFETCH CONFIGURATION =====
$image = "C:\Users\helte\Pictures\107749.png"
# $noimage = $true
# Display image using ASCII characters
# $ascii = $true
# Set the version of Windows to derive the logo from.
# $logo = "Windows 10"
@joaf123
joaf123 / DeepCopy.ps1
Last active January 26, 2024 21:36
[PowerShell]::DeepCopy - Recursive Clipboard Copy of a single file with intact folder structure
#Creates a clipboard copy of the file if found, and the folder structure leading up to it
function DeepCopy {
param(
[string]$Path = (Get-Location),
[string]$FileName
)
$destinationPath = "C:\temp\DeepCopy"
$innerDestinationPath = "C:\temp\DeepCopy\*"
function Copy-Folders-And-File($currentPath, $fileToCopy) {
@joaf123
joaf123 / pwshRegExer.ps1
Last active January 26, 2024 21:34
[PowerShell]::WinForms - PowerShell Flavour RegEx Tester
# Load the Windows Forms assembly
Add-Type -AssemblyName System.Windows.Forms
# Create the main form
$Form = New-Object System.Windows.Forms.Form
$Form.Text = "Regex Tester"
$Form.Width = 425
$Form.Height = 400
# Prevent resizing by setting the FormBorderStyle to FixedSingle
@joaf123
joaf123 / BankID Status JavaScript Demo.md
Last active August 28, 2023 17:39
Fetching BankID Status

Fetching Status for BankID Services

These examples show how to easily get the current status for different bankid services by fetching from bankid-services.statuspage.io

Example Usage:

JavaScript

var d = await fetch("https://bankid-services.statuspage.io/", {
	headers: (new Headers({
@joaf123
joaf123 / Bash --- Creating_GitHub_Repos.sh
Last active October 5, 2024 12:22
Snippets Library #Snippets
# Init Local Repo:
git init
# For Public Repo:
curl -u 'YourUserName' https://api.github.com/user/repos -d '{"name":"NameOfYourNewRepo", "private":"false", "description":"Describe your project"}'
# Replace YourUserName with your github username and NameOfYourNewRepo with your new repository/application name!
git remote add origin git@github.com:YourUserName/NameOfYourNewRepo.git
git push origin master