Skip to content

Instantly share code, notes, and snippets.

@jimpea
jimpea / lambdas.txt
Last active February 24, 2024 07:08
Some usefull Excel Lambda functions
/*
Append two ranges horizontally.
Inputs:
- range1: the first range
- range2: the second range
- default: the value entered into missing rows.
Return: The merged ranges, with empty rows filled with the default value. Missing
value within either of the two ranges filled with zeros (0). The number of rows
@anonymous1184
anonymous1184 / UI Access.md
Last active December 29, 2023 20:14
Run scripts with UI Access (UIA)

UI Access (UIA)

What's UI Access?

UIA is the way around UIPI ([User Interface Privilege Isolation][1]) which in simple terms is a way of bypassing the security built into Windows to avoid applications interacting with other applications that have a higher integrity level (security).

In other words, when you run a script it cannot communicate with the system or elevated (running as Administrator) processes; this is to avoid insecure and non-sanctioned interactions.

Why would I want UIA?

@anonymous1184
anonymous1184 / Alert.ahk
Last active January 8, 2024 14:49
MsgBox customization

; Version: 2022.07.01.1
; Usages and examples: https://redd.it/qplxwo
Alert(Options := 0, Title := "", Message := "", Spec := "")
{
if !(Options ~= "i)^(0x)?\d+") {
Message := Options
Options := Title := Spec := ""
}
@anonymous1184
anonymous1184 / Message.ahk
Last active January 8, 2024 14:49
WM_COPYDATA Messaging

; Version: 2023.05.17.1
; https://gist.github.com/cd70e009792fc2eb866f9f5caf1e395a
/*
Message.Listen(Callback) ; Listen
Message.Listen() ; Stop listening
Message.Send(Message, Target[, Timeout := 7000ms])
ErrorLevel
-1 = Target not found
@anonymous1184
anonymous1184 / Acc.ahk
Last active January 8, 2024 14:50
Acc.ahk
#Requires AutoHotkey v2.0
; Version: 2023.09.22.1
; https://gist.github.com/58d2b141be2608a2f7d03a982e552a71
; Private
Acc_Init(Function) {
static hModule := DllCall("LoadLibrary", "Str", "oleacc.dll", "Ptr")
return DllCall("GetProcAddress", "Ptr", hModule, "AStr", Function, "Ptr")
}
@anonymous1184
anonymous1184 / GetUrl.ahk
Last active April 15, 2024 23:24
GetUrl()
#Requires AutoHotkey v2.0
; Version: 2023.10.05.1
; https://gist.github.com/7cce378c9dfdaf733cb3ca6df345b140
GetUrl() { ; Active Window Only
static S_OK := 0, TreeScope_Descendants := 4, UIA_ControlTypePropertyId := 30003, UIA_DocumentControlTypeId := 50030, UIA_EditControlTypeId := 50004, UIA_ValueValuePropertyId := 30045
hWnd := WinGetID("A")
IUIAutomation := ComObject("{FF48DBA4-60EF-4201-AA87-54103EEF594E}", "{30CBE57D-D9D0-452A-AB13-7AC5AC4825EE}")
eRoot := ComValue(13, 0)
@anonymous1184
anonymous1184 / README.md
Last active January 19, 2024 04:58
WinHttpRequest.ahk

WinHttpRequest Wrapper

Usage and information: https://redd.it/mcjj4s

AutoHotkey v2.0

  • [WinHttpRequest.ahk]

AutoHotkey v1.1


; Version: 2022.06.30.1
; https://gist.github.com/49a60fb49402c2ebd4d9bc6db03813a1
/* ;region Example
now := A_Now
junction := A_Desktop "\Junction." now
directory := A_Desktop "\Directory." now
FileCreateDir % directory
FileOpen(directory "\test.txt", 0x1).Write("Hello World!")
@analyticsearch
analyticsearch / DllLoadAnythingViaScript
Created December 27, 2018 06:39
DynamicWrapperX - Dropper , Registration-Free Execution
#Doesn't Even Have to Be A Conformant COM DLL To trigger the load.
# Sample DLL To inject here
# https://github.com/redcanaryco/atomic-red-team/tree/master/atomics/T1179
$manifest = '<?xml version="1.0" encoding="UTF-16" standalone="yes"?> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> <assemblyIdentity type="win32" name="LiterallyDoesentMatter" version="6.6.6.0"/> <file name="Anyname.dll.anything"> <comClass description="Any Description HERE" clsid="{89565276-A714-4a43-91FE-EDACDCC0FFEE}" threadingModel="Both" progid="JustMakeSomethingUp"/> </file> </assembly>';
$ax = new-object -Com "Microsoft.Windows.ActCtx"
$ax.ManifestText = $manifest;
$DWX = $ax.CreateObject("JustMakeSomethingUp");
@TLMcode
TLMcode / GoogleServices.php
Last active February 23, 2022 16:09
Google API Service Endpoints in PHP & cURL
<?php
class GoogleServices
{
public function __construct()
{
$this->SetVariables();
$this->VerifyToken();
}