This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// cvss.js: Compute CVSSv3 score from vector. | |
// Copyright © 2018, Ramsey Dow. All rights reserved. | |
// SPDX-License-Identifier: BSD-2-Clause | |
// Developed under the influence of Rick and Morty. TINY RICK! | |
const vectorToObject = (string) => { | |
const metrics = {}; | |
if (isEmpty(string)) throw 'Empty string'; | |
const scratch = string.split('/'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs'); | |
const ua = fs.readFileSync('ua.txt').toString().split("\n"), | |
agent = ua[Math.floor(Math.random()*ua.length)]; | |
console.log(agent); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
'use strict'; | |
function runWithDebugger(f, args) { | |
if (typeof f !== 'function') { throw 'f must be a function' } | |
// The apply() method treats unspecified args or null or undefined args as 'no args'. | |
if (args === undefined || typeof args === 'object' && (args === null || Array.isArray(args))) { | |
debugger; | |
f.apply(null, args); | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# dga.rb: domain generation algorithm inspired by Ranbyus (by way of Mirai) | |
# Usage: ruby dga.rb [n] | |
# where n is an integer representing the number of days to span. | |
# -n indicates previous days, 0 and 1 indicate today, and 2+ indicates tomorrow and so on. | |
module DNS | |
LETTERS='abcdefghijklmnopqrstuvwxyz'.scan(/./) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# aapl_slurp.rb: downloader for Apple open source projects | |
# Copyright © 2017, Ramsey Dow. All rights reserved. | |
# SPDX-License-Identifier: BSD-2-Clause | |
# mkdir /tmp/macOS-1013 && pushd !#:1 | |
# curl -#LO https://opensource.apple.com/plist/macos-1013.plist | |
# SSL_CERT_FILE=$CURL_CA_BUNDLE ruby /path/to/aapl_slurp.rb macos-1013.plist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://godoc.org/golang.org/x/crypto/argon2 | |
package main | |
import ( | |
"crypto/rand" | |
"encoding/hex" | |
"fmt" | |
"golang.org/x/crypto/argon2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
) | |
// HexDump the specified byte slice. | |
func HexDump(bs []byte, width int) { | |
for i, v := range bs { | |
fmt.Printf("%02x ", v) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* burn.c | |
* Secure in-memory string erasure | |
* | |
* This is a modified version of the code originally posted to the | |
* Cryptograhy ML by Werner Koch: | |
* https://www.mail-archive.com/cryptography@metzdowd.com/msg08428.html | |
* | |
* By default, modern C compilers will pick up and use the static inline | |
* function. However, if you prefer your C to be pre-C99, compile with |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo bash -c 'apt-get update && apt-get -y dist-upgrade && apt-get -y autoremove --purge && apt-get -y autoclean' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# showdefines.bash: display default compiler symbols. | |
# Copyright © 2011,2017, Ramsey Dow. All rights reserved. | |
# SPDX-License-Identifier: BSD-2-Clause | |
# Usage: showdefines.bash [-c compiler] [-l language] [additional flags ...] | |
# Defaults to clang++, but works fine with C and groks the GNU and Intel compilers, as well. | |
# http://clang.llvm.org/ |