Skip to content

Instantly share code, notes, and snippets.

# An example of using custom types to implement map/filter functionality in scriptland
global v: vector of int = {-10, -1, 0, 1, 10, -999};
type map_func: function(a: any): any;
global positive_filter: map_func;
function map(v1: vector of any, mf: map_func): vector of any {
local v2: vector of any;
for (idx in v1) {
@anthonykasza
anthonykasza / spicy.nanorc
Created April 24, 2020 22:28
spicy nano syntax
syntax "spicy" "\.spicy$"
color magenta "\w+\("
color magenta "\$\w+"
color magenta "\?\w+"
color brightcyan "public|global|const|local"
color brightcyan "\b(print|on|foreach|stop|switch|case|default|if|new|in|inout|exception|throw|try|catch|assert|break|for|return|while|from|continue)\b"
color brightcyan "module|import"
@anthonykasza
anthonykasza / client.py
Created August 9, 2018 22:06
ClientHello Cloner
from scapy.all import *
import scapy_ssl_tls.ssl_tls as tls
import scapy_ssl_tls.ssl_tls_crypto as tlsc
import scapy_ssl_tls.ssl_tls_keystore as tlsk
packets = rdpcap('tls_example.pcap')
for packet in packets:
if packet.haslayer(tls.SSL):
eth = packet
function Get-PublicKey
{
[OutputType([byte[]])]
PARAM (
[Uri]$Uri
)
if (-Not ($uri.Scheme -eq "https"))
{
Write-Error "You can only get keys for https addresses"
@anthonykasza
anthonykasza / kmer_sequencer.py
Created September 12, 2016 16:24
Script for aligning and reconstructing overlapping subsequences - LabyREnth Random 3
import fileinput
from StringIO import StringIO
import networkx as nx
import subprocess
import glob
import base64 as b64
# http://stackoverflow.com/questions/1285434/efficient-algorithm-for-string-concatenation-with-overlap
def concat(*args):
@anthonykasza
anthonykasza / domains2yara
Created December 15, 2015 14:42
domains2yara
import random
import fileinput
print 'import "cuckoo"'
a='a444'
for d in fileinput.input():
d = d.strip()
a = 'a%d' % (random.randint(0, 100000000))
@anthonykasza
anthonykasza / hole_punch.py
Created December 13, 2015 19:03
punch holes in a file
from StringIO import StringIO
import sys
import random
if len(sys.argv) != 3:
print "usage: hole_punch.py in_filename out_filenae"
exit()
ifname = sys.argv[1]
import fileinput
from StringIO import StringIO
import networkx as nx
import subprocess
# https://neil.fraser.name/news/2010/11/04/
def commonOverlapIndexOf(text1, text2):
text1_length = len(text1)
import random
from StringIO import StringIO
import string
import zlib
import base64 as b64
def get_kmer(read_str, overlap_size, kmer_size):
if read_str.pos > overlap_size:
read_str.seek(overlap_size * -1, 1)
@anthonykasza
anthonykasza / search.sh
Created September 14, 2015 01:10
A basic BASH script for searching Github for new and interesting repos
if [ -z ${1+x} ]; then
printf "usage: search.sh terms.txt\n\n";
exit -1;
fi
DT=$(date '+%Y-%m-%d' --date="yesterday")
RESULTS_DIR="./results"
EMAIL=""
if [ ! -d "${RESULTS_DIR}" ]; then