Skip to content

Instantly share code, notes, and snippets.

View sdstrowes's full-sized avatar

Stephen Strowes sdstrowes

View GitHub Profile
@sdstrowes
sdstrowes / print-ipv6-all-octets.pl
Created November 28, 2024 21:21
print-ipv6-all-octets.pl
#!/usr/bin/perl -w
use diagnostics;
use strict;
use warnings;
use Net::CIDR;
while (<>) {
print join("\n", Net::CIDR::cidr2octets($_."/128")) . "\n";
@sdstrowes
sdstrowes / foo.md
Created September 1, 2017 08:04
Reverse Engineering the Speedtest.net Protocol, Gökberk Yaltıraklı

Source: https://web.archive.org/web/20141216073338/https://gkbrk.com/blog/read?name=reverse_engineering_the_speedtest_net_protocol Author: Gökberk Yaltıraklı

Reverse Engineering the Speedtest.net Protocol

After finishing my command line speed tester written in Rust, I didn't have a proper blog to document this process. A few days ago I wrapped up a simple blogging script in Python so hopefully it works good enough to explain how everything works.

By now I have already figured out the whole protocol for performing a speed test but I will write all the steps that I took so you can learn how to reverse engineer a simple protocol.

The code that I wrote can be found at https://github.com/gkbrk/speedtest-rust.

This file has been truncated, but you can view the full file.
$ bgpdump -m rib.20230919.0000.bz2 | grep ' 54113|' | awk -F\| '{printf("%22s %22s %s\n", $4, $6, $7)}' | sort -k1,1n | uniq
2023-10-04 14:24:25 [info] logging to syslog
2a00:1ca8:2a::e0 2606:2cc0::/46 202365 50673 174 54113
2a00:1ca8:2a::e0 2606:2cc0::/48 202365 50673 174 54113
2a00:1ca8:2a::e0 2a04:4e40::/48 202365 6939 9957 9957 9957 9957 9957 9957 9957 9957 9957 54113
2a00:1ca8:2a::e0 2a04:4e41::/32 202365 6939 4637 54113
2a00:1ca8:2a::e0 2a04:4e42::/32 202365 50673 174 54113
2a00:1ca8:2a::e0 2a04:4e42::/36 202365 6939 4637 54113
2a00:1ca8:2a::e0 2a04:4e42::/48 202365 50673 174 54113
2a00:1ca8:2a::e0 2a04:4e47::/48 202365 50673 174 54113
@sdstrowes
sdstrowes / fetch-results.sh
Created March 31, 2018 12:26
id.server quad9
#!/usr/bin/env python
from ripe.atlas.cousteau import (
AtlasResultsRequest
)
import bz2
import json
import requests
import sys
@sdstrowes
sdstrowes / .block
Created October 6, 2022 15:34 — forked from vasturiano/.block
Hilbert Map of IPv4 address space
license: mit
@sdstrowes
sdstrowes / gist:0f54d34dcc093b9c51375989247f068d
Last active September 23, 2022 17:41
starlink resources
ripencc|US|ipv4|91.102.180.0|1024|20061101|allocated|aa89e9d5-1981-4585-8a77-831456d685f9
ripencc|US|ipv4|145.224.64.0|16384|19930506|allocated|aa89e9d5-1981-4585-8a77-831456d685f9
ripencc|US|ipv4|162.43.192.0|1024|19920721|allocated|aa89e9d5-1981-4585-8a77-831456d685f9
ripencc|US|ipv4|169.155.224.0|8192|19950103|allocated|aa89e9d5-1981-4585-8a77-831456d685f9
ripencc|US|ipv4|176.116.124.0|512|20120507|allocated|aa89e9d5-1981-4585-8a77-831456d685f9
ripencc|US|ipv4|188.92.248.0|2048|20090505|allocated|aa89e9d5-1981-4585-8a77-831456d685f9
ripencc|US|ipv4|188.95.144.0|512|20180706|allocated|aa89e9d5-1981-4585-8a77-831456d685f9
ripencc|US|ipv4|216.128.0.0|8192|20050928|allocated|aa89e9d5-1981-4585-8a77-831456d685f9
ripencc|US|ipv4|217.65.136.0|2048|20001102|allocated|aa89e9d5-1981-4585-8a77-831456d685f9
ripencc|US|ipv6|2a0d:3340::|29|20200728|allocated|aa89e9d5-1981-4585-8a77-831456d685f9
with pdns_google as (
select af, prb_id, p.data google, response_time response_time_google
from `ripencc-atlas.measurements.dns_decoded`, unnest(wire_message.payload) p
where date(start_time) = "2022-08-02"
and (
# ipv4
msm_id = 43148525 or
msm_id = 43148540 or
msm_id = 43148581 or
msm_id = 43148589 or
@sdstrowes
sdstrowes / get-stats.sh
Created February 3, 2022 16:04
RIR extended stats fetcher
#!/usr/bin/env bash
date=date
zcat=zcat
if [[ "$OSTYPE" == "darwin"* ]]; then
date=gdate
zcat=gzcat
fi
while getopts "hd:" arg; do
@sdstrowes
sdstrowes / as32934.txt
Created October 4, 2021 18:32
AS32934
2620:0:1c00::/40
2a03:2880::/32
2a03:2880::/36
2a03:2880:1000::/36
2a03:2880:2000::/36
2a03:2880:3000::/36
2a03:2880:f001::/48
2a03:2880:f003::/48
2a03:2880:f004::/48
2a03:2880:f005::/48