Skip to content

Instantly share code, notes, and snippets.

View tomnomnom's full-sized avatar
☺️
Taking it easy

TomNomNom tomnomnom

☺️
Taking it easy
View GitHub Profile
@tomnomnom
tomnomnom / alert.js
Last active May 8, 2025 06:03
Ways to alert(document.domain)
// How many ways can you alert(document.domain)?
// Comment with more ways and I'll add them :)
// I already know about the JSFuck way, but it's too long to add (:
// Direct invocation
alert(document.domain);
(alert)(document.domain);
al\u0065rt(document.domain);
al\u{65}rt(document.domain);
window['alert'](document.domain);
@tomnomnom
tomnomnom / ctf-from-hell.md
Last active July 30, 2023 10:15
The CTF from \u000aHELL

The CTF from \u000aHELL

Chapter 1

IT WAS A DARK AND STORMY^w^w^w^w^w^wIt was a bright and sunny Tuesday afternoon. Tom had just arrived back at the office after a trip to down south. He'd been to a dinner in London; helping HackerOne give new and prospective customers advice on their bug bounty programs.

With the few emails he'd received responded to: he span in his chair, sipping at his coffee, wondering how to best to limber up his brain into 'work mode' after a night of free drinks. His aging neurons creaked and

@tomnomnom
tomnomnom / h1-barry-ctf-dump.php
Created August 13, 2017 08:36
Dump of the script I wrote solving Jobert's CTF (https://twitter.com/jobertabma/status/894066834927796224)
<?php
// OK, so here's the hex from the instructions...
$lines =<<<LINES
7b 0a 20 a0 22 65 76 e5
6e 74 22 ba 20 22 70 e1
73 73 77 ef 72 64 5f e3
68 61 6e e7 65 22 2c 8a
20 20 22 f5 73 65 72 ee
61 6d 65 a2 3a 20 22 e2
63 6f 6c ec 69 6e 22 ac
@tomnomnom
tomnomnom / php-curl-crlf-injection.mkd
Last active October 11, 2024 16:43
CRLF Injection Into PHP's cURL Options

CRLF Injection Into PHP's cURL Options

I spent the weekend meeting hackers in Vegas, and I got talking to one of them about CRLF Injection. They'd not seen many CRLF Injection vulnerabilities in the wild, so I thought I'd write up an example that's similar to something I found a few months ago.

If you're looking for bugs legally through a program like hackerone, or you're a programmer wanting to write secure PHP: this might be useful to you.

@tomnomnom
tomnomnom / convert-mp4-to-gif.mkd
Last active December 4, 2022 09:59
Crop an mp4 and convert it to a gif

Because I'll forget how to do this...

Crop

crop=w:h:x:y

ffmpeg -i in.mp4 -filter:v "crop=900:700:0:50" out.mp4
@tomnomnom
tomnomnom / ircuserlist-python3.py
Created January 3, 2017 13:25
IRC User List Script - Updated for Python 3
#!/usr/bin/env python3
# IRC User List
# Written by Tom Hudson for the Raspberry Pi User Guide
# Updated 2017-01-03 for Python 3.*
# http://tomhudson.co.uk/
import sys, socket, time
RPL_NAMREPLY = '353'
RPL_ENDOFNAMES = '366'
@tomnomnom
tomnomnom / chanscan.go
Created May 28, 2016 22:42
Using Go's channels to spread work across a bunch of worker goroutines
package main
import (
"fmt"
"net"
"sync"
"time"
)
const (
@tomnomnom
tomnomnom / once-per-jenkins-slave.groovy
Created May 16, 2016 12:47
Run a command once on each Jenkins slave using the CloudBees Workflow / Jenkins Pipeline plugin
// The ArrayList of slaves is not serializable, so fetching them should be marked as @NonCPS so that
// no attempt is made to serialize and save the local state of the function. See here for details:
// https://github.com/jenkinsci/pipeline-plugin/blob/master/TUTORIAL.md#serializing-local-variables
@NonCPS
def getSlaves() {
def slaves = []
hudson.model.Hudson.instance.slaves.each {
slaves << it.name
}
return slaves
@tomnomnom
tomnomnom / how-much-does-your-branch-suck.sh
Created April 21, 2016 11:38
Find out how much your branch sucks
#!/bin/bash
set -e
BRANCH=${1}
if [ -z "${BRANCH}" ]; then
echo "Usage: ${0} <branch>"
exit 1
fi
@tomnomnom
tomnomnom / bouncy.html
Created December 27, 2015 20:34
Bouncy Ball
<html>
<head>
<style>
canvas {
border: 1px solid #666666;
}
</style>
</head>
<body>