This file contains hidden or 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
// XORCipher - Super simple encryption using XOR and Base64 | |
// | |
// Depends on [Underscore](http://underscorejs.org/). | |
// | |
// As a warning, this is **not** a secure encryption algorythm. It uses a very | |
// simplistic keystore and will be easy to crack. | |
// | |
// The Base64 algorythm is a modification of the one used in phpjs.org | |
// * http://phpjs.org/functions/base64_encode/ | |
// * http://phpjs.org/functions/base64_decode/ |
This file contains hidden or 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
"""This script will print the header, packet headers, packets, and the footer for any format.""" | |
import subprocess as sp | |
import re | |
import os | |
def create_pcap(): | |
if not os.path.exists("temp.pcapng"): | |
sp.call(["tshark", "-w", "temp.pcapng", "-c", "3"]) | |
return "temp.pcapng" |
This file contains hidden or 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
"""Check the validity of your Wireshark config files after editing them. | |
Part of https://tshark.dev/packetcraft/config_files. Ross Jacobs, 2019-08-07. | |
""" | |
import re | |
import os | |
def gen_regexes(): | |
"""Generate the regex dictionary.""" | |
ws = r'\s+' # whitespace |
This file contains hidden or 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
/* Benchmarks summing serially and then with channels | |
* to time how much overhead channel reads have. | |
* To run: `go test -bench . channel_test.go` | |
*/ | |
package channel_test | |
import ( | |
"sync" | |
"testing" | |
) |
This file contains hidden or 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
# Ross Jacobs pre-commit file | |
exclude: '' | |
fail_fast: false | |
minimum_pre_commit_version: 0 | |
repos: | |
- repo: https://github.com/pre-commit/pre-commit-hooks | |
rev: v2.1.0 # Use the ref you want to point at | |
hooks: | |
# Checks | |
- id: check-added-large-files |
This file contains hidden or 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 python3 | |
# Desc: | |
# Create a pcap where the output of a display filter matches | |
# a given regex. Generates a file named re_<pcap in name> | |
# tshark MUST be on the path for this to work | |
# | |
# Usage: | |
# Using the `arp-storm.pcap` from https://wiki.wireshark.org/SampleCaptures | |
# To match all packets whose seconds part of the timestamp ends in 3: | |
# |
This file contains hidden or 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
cd /tmp | |
wget https://www.wireshark.org/download/src/wireshark-3.0.0.tar.xz | |
tar -xzf wireshark-3.0.0.tar.xz | |
cd wireshark-3.0.0 | |
sudo apt update && sudo apt dist-upgrade | |
sudo apt install cmake libglib2.0-dev libgcrypt20-dev flex bison byacc libpcap-dev qtbase5-dev libssh-dev libsystemd-dev qtmultimedia5-dev libqt5svg5-dev qttools5-dev | |
cmake . | |
make |
This file contains hidden or 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
# Play all notes between 440-880hz, inclusive | |
from pysine import sine | |
def get_freq(key): | |
# For a given piano key, return the frequency | |
# Taken from https://en.wikipedia.org/wiki/Piano_key_frequencies | |
return 2**((key-49)/12) * 440 | |
for key in range(49, 62): | |
freq = get_freq(key) |
This file contains hidden or 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 bash | |
# Copyright 2019 Ross Jacobs | |
# | |
# tshark --color on Windows is limited to 16 colors vs 24-bit "true color" | |
# on other platforms. This script uses both WSL and Windows tshark in | |
# order to get color parity on Windows. | |
# | |
# Install: | |
# Add this function to your WSL ~/.bashrc and then `source ~/.bashrc` | |
# |
This file contains hidden or 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 python3 | |
# Run `tail -f -n +1 /tmp/scapy.pcap | wireshark -k -i -` in another terminal | |
import re | |
import requests | |
from scapy.all import * | |
LIVE_PCAP="/tmp/scapy.pcap" | |
def top_50_websites(): |