Skip to content

Instantly share code, notes, and snippets.


Troy Hunt troyhunt

View GitHub Profile
troyhunt / rick-roll-content-scraper.js
Created Aug 19, 2020
A Cloudflare worker to redirect image requests from dickhead content scraper's site to a Rick Roll
View rick-roll-content-scraper.js
addEventListener('fetch', event => {
async function fetchAndApply(request) {
let response = await fetch(request)
let referer = request.headers.get('Referer')
let contentType = response.headers.get('Content-Type') || ''
if (referer && contentType.startsWith('image/')) {
View troys-been-scraped.json
"_id": {
"$oid": "5b9f0ec2385f0a00655c92fb"
"email": "",
"emails": [
"local": "troyhunt",
"domain": "",
"type": "personal",
troyhunt / uniform-urls.js
Created Sep 4, 2018
Cloudflare Worker to normalise URLs for cache efficiency
View uniform-urls.js
addEventListener('fetch', event => {
* Fetch request after making casing of hash prefix uniform
* @param {Request} request
async function handleRequest(request) {
troyhunt / roblox.html
Created Jul 30, 2018
Roblox response to an insecure request
View roblox.html
HTTP/1.1 200 OK
Server: nginx/1.13.12
Date: Mon, 30 Jul 2018 00:34:29 GMT
Content-Type: text/html
Connection: keep-alive
Keep-Alive: timeout=20
X-DIS-Request-ID: 92ff365aa7add940416ef2364da35e97
Cache-Control: no-cache
Content-Length: 1557
View expanded-phishing-file.html
<meta content="" name="keywords">
<meta content="" name="description">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link type="text/css" rel="stylesheet" href="css/z.css">
<link type="text/css" rel="stylesheet" href="css/a.css">
<link rel="shortcut icon" href="img/nficon2015.ico">
View encrypted-phishing-file.html
<html><head><script src=""></script><script>
var hea2p =
var hea2t =
troyhunt / mountain-training-breach-notice
Created Nov 23, 2016
A very well written breach notice from Mountain Training
View mountain-training-breach-notice
Dear [redacted],
This email is being sent to you about a recent security breach to Mountain Training's website and has been sent using Mail Chimp instead of our candidate management system. The reason for this is explained below.
Our candidate management system, powered by TahDah, recently suffered a security breach and I want to reassure you straightaway that no passwords, bank or card details have been accessed, or ever can be. On the evening of Saturday 12th November, someone gained unauthorised access to the website of our candidate management system via the admin account of a TahDah staff member. The database, which sits behind the website, was not accessed. The unauthorised person(s) replaced the log in page so that no one could gain access to the website and sent an email to ‘All candidates’ which contained a malicious link.
The staff of Mountain Training and our database developer TahDah responded very quickly and were able to intercept the email, so that it was sent to a relatively small percentag
View failed-build
Command: "D:\home\site\deployments\tools\deploy.cmd"
Handling .NET Web Application deployment.
MSBuild auto-detection: using msbuild version '14.0' from 'D:\Program Files (x86)\MSBuild\14.0\bin'.
All packages listed in packages.config are already installed.
D:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.CSharp.CurrentVersion.targets(133,9): warning MSB3884: Could not find rule set file "ManagedMinimumRules.ruleset". [D:\home\site\repository\Web\Web.csproj]
Web -> D:\home\site\repository\Web\bin\Web.dll
D:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.CSharp.CurrentVersion.targets(133,9): warning MSB3884: Could not find rule set file "ManagedMinimumRules.ruleset". [D:\home\site\repository\WebJob\WebJob.csproj]
WebJob -> D:\home\site\repository\WebJob\bin\Release\WebJob.exe
D:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Web\Microsoft.Web.Publishing.targets(2673,5): error MSB4062: The "GetProjectProperties" task could not be loaded from the assembly D:\Program Files (x86)\MSBuild\Microsoft\V