Skip to content

Instantly share code, notes, and snippets.

@daddycocoaman
daddycocoaman / shellcodeload.py
Created November 30, 2022 21:15
Python shellcode load
import ctypes
from pathlib import Path
shellcode = bytearray(Path("shellcode.bin").read_bytes())
kernel32 = ctypes.windll.kernel32
kernel32.VirtualAlloc.restype = ctypes.c_void_p
kernel32.RtlMoveMemory.argtypes = [ctypes.c_void_p, ctypes.c_void_p, ctypes.c_size_t]
@daddycocoaman
daddycocoaman / pyfi.py
Last active September 29, 2022 16:11
Getting Wi-Fi SSIDs and passwords on Windows
import xml.etree.ElementTree as ET
from ctypes import Structure, pointer, windll, wintypes
# https://learn.microsoft.com/en-us/windows/win32/api/guiddef/ns-guiddef-guid
class GUID(Structure):
_fields_ = [
("Data1", wintypes.DWORD),
("Data2", wintypes.WORD),
("Data3", wintypes.WORD),
("Data4", wintypes.BYTE * 8),
@daddycocoaman
daddycocoaman / radiolist.py
Created February 6, 2021 18:13
Custom Prompt-Toolkit Radio List
# Customized from https://github.com/prompt-toolkit/python-prompt-toolkit/blob/master/prompt_toolkit/widgets/base.py
from typing import Generic, Sequence, Tuple, TypeVar
from prompt_toolkit.application import get_app
from prompt_toolkit.filters import Condition
from prompt_toolkit.formatted_text import (
AnyFormattedText,
StyleAndTextTuples,
to_formatted_text,
)
@daddycocoaman
daddycocoaman / param_inherit.py
Created November 19, 2020 17:53
Function Parameter Inheritance
# Don't actually use this. Why would you use this? Seriously, don't use it, fam.
import inspect
from types import FunctionType
from typing import Callable
def param_inherit(inherited_func: Callable):
"""Allows function to inherit the parameters of another function"""
def decorator(func: Callable):
@daddycocoaman
daddycocoaman / pydefendercheck.py
Last active July 2, 2023 22:13
PyDefenderCheck
##################################################
## PyDefenderCheck - Python implementation of DefenderCheck
##################################################
## Author: daddycocoaman
## Based on: https://github.com/matterpreter/DefenderCheck
##################################################
import argparse
import enum
@daddycocoaman
daddycocoaman / cnameenum.py
Last active August 10, 2021 17:17
Async CNAME Enumeration (WIP)
import asyncio
import aiodns
import aiofiles
import aiohttp
from colorama import Fore
from dataclasses import field, dataclass
from pycares import ares_query_cname_result
from concurrent.futures import ThreadPoolExecutor
import sys
import re
@daddycocoaman
daddycocoaman / Windows98.boo
Created September 19, 2019 17:34
Because netCAT exists
/* Opens 98 Windows!
Author: Daddycocoaman */
import System.Windows.Forms
for i in range(0, 98):
MessageBox.Show("Windows ${i + 1}!", "MalWARE")
@daddycocoaman
daddycocoaman / TELLnet.boo
Created September 19, 2019 17:33
Because netCAT exists
/* Pings all of your available networks and tells your net that you're snitching
Author: Daddycocoaman */
import System
import System.Net.NetworkInformation
import System.Net
import System.Net.Sockets
import System.Text
BUFFER = ASCIIEncoding().GetBytes("IMSNITCHINGONALLYALLCAUSEMALWARE")
@daddycocoaman
daddycocoaman / SOcat.boo
Created September 19, 2019 17:32
Because netCAT exists.
/* Creates a "uncloseable" form window with an ASCII cat. It's SO Cat!
Author: Daddycocoaman */
import System.Windows.Forms
import System.Drawing
SOCAT = """
|\__/,| (`\
|o o |__ _)
_.( T ) ` /
@daddycocoaman
daddycocoaman / stickynoteparser.py
Created September 14, 2019 02:34
Parses sticky note files in .snt/.sqlite formats. Sqlite files may require the WAL and SHM files of the same name as well. Once run, WAL/SHM files will be merged into .sqlite file.
import json
import sqlite3
import olefile
import argparse
def parse_snt_file(file):
# https://www.tutorialspoint.com/python_digital_forensics/python_digital_forensics_important_artifacts_in_windows
if not olefile.isOleFile(file):
return "Invalid OLE file"