Skip to content

Instantly share code, notes, and snippets.

View thor-vath's full-sized avatar

Travis Horvath thor-vath

View GitHub Profile
@thor-vath
thor-vath / find-and-replace.py
Created September 19, 2022 13:47
Python docx find and replace
# written by scanny@github
import re
from docx import Document
regex = re.compile("foo")
def paragraph_replace_text(paragraph, regex, replace_str):
@thor-vath
thor-vath / runas.bat
Created May 11, 2021 15:28
Batch file to change to a PowerShell session as a domain user
@echo off
set /p runas_domain="Enter runas domain: "
set /p runas_user="Enter runas user: "
runas.exe /netonly /user:%runas_domain%\%runas_user% "powershell.exe -noprofile -executionpolicy bypass"
@thor-vath
thor-vath / remove_excell_vba_pw.vba
Last active September 10, 2020 14:06
Remove password protection from VBA project
Private Const PAGE_EXECUTE_READWRITE = &H40
Private Declare PtrSafe Sub MoveMemory Lib "kernel32" Alias "RtlMoveMemory" _
(Destination As LongPtr, Source As LongPtr, ByVal Length As LongPtr)
Private Declare PtrSafe Function VirtualProtect Lib "kernel32" (lpAddress As LongPtr, _
ByVal dwSize As LongPtr, ByVal flNewProtect As LongPtr, lpflOldProtect As LongPtr) As LongPtr
Private Declare PtrSafe Function GetModuleHandleA Lib "kernel32" (ByVal lpModuleName As String) As LongPtr
@thor-vath
thor-vath / fs_proxy_refresh.js
Last active February 3, 2020 22:03
FiddlerScript proxy refresh / loop request tool
// Install: Go to Rules -> Customize Rules, paste script from START to END after "class Handlers" and save.
// START Proxy Refresh
// Add "Toggle Proxy Refresh" option in Tools bar
// Sends a request on a loop to keep connectio to outbound system proxy alive
public static var oTimer: System.Windows.Forms.Timer = new Timer();
public static var bFirstRun: boolean = true;
public static ToolsAction("Toggle Proxy Refresh")
function ToggleProxyRefreshTimer() {
if (bFirstRun == true){
@thor-vath
thor-vath / keybase.md
Created March 24, 2018 19:28
Proving my identity on keybase.

Keybase proof

I hereby claim:

  • I am thor-vath on github.
  • I am thor_vath (https://keybase.io/thor_vath) on keybase.
  • I have a public key ASCfq6ISIqKuZRTDh8fFLUCo2n7SVhg92zMYLjgVcBe1XQo

To claim this, I am signing this object: