Skip to content

Instantly share code, notes, and snippets.

@JJK96
JJK96 / Get-ProcessPipes.ps1
Last active March 4, 2024 09:13 — forked from Wra7h/Get-ProcessPipes.ps1
Use PowerShell to get the PIDs associated with Named Pipes
function Get-ProcessPipes{
param(
[Parameter(Mandatory=$false)]
[string]$CSV,
[Parameter(Mandatory=$false)]
[switch]$All
)
Add-Type -TypeDefinition @"
using System;
@JJK96
JJK96 / popup.c
Created October 27, 2023 11:20
Windows application that sends a popup
#include <windows.h>
#pragma comment(lib,"User32")
void main() {
MessageBox(NULL, "Message", "Caption", MB_OK);
}
@JJK96
JJK96 / delete_url.py
Created July 31, 2023 06:49
Fully delete URL from firefox
# run in ~/Library/Application Support/Firefox/Profiles/<profile>
import sqlite3
url = "%<url>%"
con = sqlite3.connect("places.sqlite")
cur = con.cursor()
cur.execute("delete from moz_places where url LIKE :url;", (url,))
cur.execute("delete from moz_origins where host like :url;", (url,))
con.commit()
//Based on https://gist.github.com/materi/f5b95f798b9012e135e3462d52d33d4c
Java.perform(function() {
var res2 = Java.use('okhttp3.Response$Builder');
var Buffer = Java.use('okio.Buffer');
var peek_size = 1000
var String = Java.use('java.lang.String');
res2.build.implementation = function() {
var response = this.build();
@JJK96
JJK96 / to-objects.ps1
Created June 21, 2023 13:07
Powershell Convert list of : separated fields to actual objects
/* Input example
Name: test
A: abc
B: def
Name: obj2
A: xyz
B: abc
*/
@JJK96
JJK96 / azure_enumeration.ps1
Created February 24, 2023 12:05
Azure enumeration
# DO NOT RUN THIS SCRIPT BLINDLY!
# This script provides functions to enumerate open ports and network security configurations (NSG) in Azure.
# Copy and paste snippets of the script to perform the tasks you need.
$ips = <local_ips>
$subscription = <subscription_id>
function IPInRange {
# https://github.com/omniomi/PSMailTools/blob/v0.2.0/src/Private/spf/IPInRange.ps1
[cmdletbinding()]
@JJK96
JJK96 / start.sh
Last active September 27, 2022 07:43
Install system certificate and start frida
setenforce 0
echo creating new cacerts folder
mount -t tmpfs tmpfs /system/etc/security/cacerts
echo copying user cacerts to system cacerts
cp /data/misc/user/0/cacerts-added/* /system/etc/security/cacerts/
import requests
from collections import defaultdict
r = requests.get(url="https://korpershoek.me/srb2/highscores/api/highscores", verify=False)
data = r.json()
skins = defaultdict(int)
#three for first place, 2 for second, 1 for last, 0 otherwise
weights = {
1:15,
2:12,
-- Create a console variable so you can turn metalthok on and off
-- By typing `metalthok On` or `metalthok Off` in console.
local MetalThok = CV_RegisterVar{
name = "metalthok", -- name of the command
defaultvalue = 0, -- off by default
flags = CV_NETVAR, --Works over the network, so the same in the whole server for all users
PossibleValue = CV_OnOff --It's an On/Off value
}
-- This function us executed every frame, for each player
@JJK96
JJK96 / detect-indent.kak
Last active January 31, 2020 08:25
Kakoune detect indent
set-option global tabstop 4
set-option global indentwidth 4
declare-option -hidden str detect_indent_script %sh{ echo "${kak_source%/*}/index.js" }
define-command detect-indent %{
evaluate-commands %sh{
node "$kak_opt_detect_indent_script" "$kak_buffile"
}
}