Skip to content

Instantly share code, notes, and snippets.

remi / shc.js
Last active Sep 19, 2021
Extract JSON object from QR code
View shc.js
// Extract JSON payload from SHC QR code (without any kind of private/public key verification)
// Credits + inspiration
// Usage
// $ node shc.js "shc:/01234569…"
const zlib = require("zlib");
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/')) {
mikeckennedy /
Created Jul 9, 2020
Simple example to test how much faster or slower it is to simply try and convert then catch an error vs. testing up front.
import datetime
import random
from typing import List
def main():
count = 1_000_000
data = build_data(count)
View scoreboard-nsec2020.txt
<CA> HubrETS Hackin'' | 155 | 2020/05/17 14:58
<CA> Les Gentils Pirates | 133 | 2020/05/17 14:42
<CA> CLICKESTI | 129 | 2020/05/17 14:07
<US> Skiddies as a Service | 125 | 2020/05/17 14:44
<CA> cold_root | 116 | 2020/05/17 14:38
<CA> Panique Au Village | 94 | 2020/05/17 14:47
<CA> Shopify | 84 | 2020/05/17 14:47
<CA> segfaults | 77 | 2020/05/17 14:55
Neo23x0 / sysmon_suspicious_keyboard_layout_load.yml
Last active Sep 4, 2020
Sigma Rule to Detect Uncommon Keyboard Layout Loads in Your Organisation
View sysmon_suspicious_keyboard_layout_load.yml
title: Suspicious Keyboard Layout Load
description: Detects the keyboard preload installation with a suspicious keyboard layout, e.g. Chinese, Iranian or Vietnamese layout load in user session on systems maintained by US staff only
author: Florian Roth
date: 2019/10/12
product: windows
service: sysmon
definition: 'Requirements: Sysmon config that monitors \Keyboard Layout\Preload subkey of the HKLU hives - see'
calebporzio / fa.sublime_snippet
Last active Apr 8, 2018
Font Awesome sublime snippet for creating icon tags
View fa.sublime_snippet
<i class="fa fa-fw fa-${1}"></i>&nbsp;
<description>Font Awesome Icon</description>
<scope>text.blade, text.html.blade, text.html</scope>
View list of sane mimetypes for a "document" upload
- application/pdf
- application/x-pdf
- text/plain
- application/rtf
- image/*
- application/msword
- application/vnd.openxmlformats-officedocument.wordprocessingml.document
sephii /
Last active Feb 3, 2020
Check for letsencrypt/certbot certificates expiry date. Can be run in a cron
#!/usr/bin/env python3
Usage: host1 host2 hostN. Will exit with status code 1 if any of the hosts is about to expire (see
from datetime import datetime
import socket
import ssl
View Sunshine PHP
PHP Extensions Tutorial
The best way to learn about writing extensions is - to write an
extension! If you want to "code along", you'll need to be set up to
compile PHP 7 extensions, have a checkout of the example code we'll be
using, and have the C library we'll be "wrapping" available on your
All the code we'll be working with is available from