Skip to content

Instantly share code, notes, and snippets.

@bortzmeyer
bortzmeyer / gist:1284249
Created October 13, 2011 13:42
The only simple way to do SSH in Python today is to use subprocess + OpenSSH...
#!/usr/bin/python
# All SSH libraries for Python are junk (2011-10-13).
# Too low-level (libssh2), too buggy (paramiko), too complicated
# (both), too poor in features (no use of the agent, for instance)
# Here is the right solution today:
import subprocess
import sys
@bortzmeyer
bortzmeyer / xname-dead.md
Created November 4, 2018 13:41
Xname is dead
% check-soa -i xname.org
ns0.xname.org.
	195.234.42.1: ERROR: read udp 10.10.86.133:49337->195.234.42.1:53: i/o timeout
ns1.xname.org.
	178.33.255.252: OK: 2014090801 (8 ms)
ns2.xname.org.
	2a01:e0b:1:153:ca0a:a9ff:fef1:b02b: ERROR: read udp [2001:67c:1348:7::86:133]:49658->[2a01:e0b:1:153:ca0a:a9ff:fef1:b02b]:53: i/o timeout
	212.129.57.31: ERROR: read udp 10.10.86.133:38831->212.129.57.31:53: i/o timeout
ns3.xtremeweb.de.
@bortzmeyer
bortzmeyer / dyn-attack-brazil-japan.md
Created October 21, 2016 20:26
Attack against Dyn seen from outside Europe/North America
% atlas-resolve -r 100 -c JP github.com 
[TIMEOUT(S)] : 6 occurrences 
[ERROR: SERVFAIL] : 2 occurrences 
[192.30.253.113] : 25 occurrences 
[192.30.253.112 192.30.253.113] : 37 occurrences 
[192.30.253.112] : 23 occurrences 
Test #6891931 done at 2016-10-21T20:17:31Z

% atlas-resolve -r 100 -c BR github.com 
@bortzmeyer
bortzmeyer / attack-dyn-free.md
Created October 21, 2016 17:41
Attack against Dyn from Free (France)
% check-soa -i twitter.com
ns1.p34.dynect.net.
	208.78.70.34: OK: 2007130853 (22 ms)
	2001:500:90:1::34: ERROR: read udp [2001:500:90:1::34]:53: i/o timeout
ns2.p34.dynect.net.
	204.13.250.34: ERROR: read udp 204.13.250.34:53: i/o timeout
ns3.p34.dynect.net.
	208.78.71.34: OK: 2007130853 (28 ms)
	2001:500:94:1::34: ERROR: read udp [2001:500:94:1::34]:53: i/o timeout
@bortzmeyer
bortzmeyer / bnp-paribas.md
Created January 8, 2019 10:40
BNP Paribas DNS issue
% blaeu-resolve -r 100 -c FR -q A mabanque.bnpparibas  


[159.50.187.79] : 48 occurrences 
[ERROR: SERVFAIL] : 7 occurrences 
[159.50.188.20] : 40 occurrences 
Test #18829701 done at 2019-01-08T10:35:16Z

But NS queries timeout :

@bortzmeyer
bortzmeyer / gist:1029114
Created June 16, 2011 12:13
IPv6 traceroute to Cogent from Hurricane Electric
% traceroute6 www.cogentco.com
traceroute to cogentco.com (2001:550:1::cc01) from 2001:470:1f10:3aa::2, 30 hops max, 24 byte packets
1 bortzmeyer-1.tunnel.tserv9.chi1.ipv6.he.net (2001:470:1f10:3aa::1) 10 ms 19.999 ms 9.999 ms
2 gige-g3-4.core1.chi1.he.net (2001:470:0:6e::1) 9.999 ms 10 ms 9.999 ms
3 10gigabitethernet3-2.core1.den1.he.net (2001:470:0:1af::2) 29.999 ms 29.998 ms 49.997 ms
4 10gigabitethernet4-4.core1.sjc2.he.net (2001:470:0:1b4::1) 49.997 ms 69.996 ms 59.997 ms
5 10gigabitethernet3-2.core1.pao1.he.net (2001:470:0:32::2) 59.996 ms 69.996 ms 49.997 ms
6 * * *
7 * * *
@bortzmeyer
bortzmeyer / gist:2605348
Created May 5, 2012 20:21
Sample Apache's mod_security rules for rate-limiting
# Activates mod_security
SecRuleEngine On
# Only filters requests for /toto
SecRule REQUEST_FILENAME "!^/toto" "phase:1,skip:5,nolog"
# Only filters requests for rosalind
SecRule REQUEST_HEADERS:Host "rosalind\.abgenomica\.com" "phase:1,skip:5,nolog"
# Stores the number of visits in variable IP.pagecount
SecAction "phase:1,nolog,initcol:IP=%{REMOTE_ADDR},setvar:IP.pagecount=+1,expirevar:IP.pagecount=60"
# Denies requests when excessive
# 429 would be a better error status but mod_security rewrites it as 500 :-(
@bortzmeyer
bortzmeyer / gist:705384b215034162da92
Created December 16, 2015 17:00
The longest TLD (including Unicode ones)
TRAVELERSINSURANCE 18
VERMöGENSBERATUNG 17
VERMöGENSBERATER 16
SANDVIKCOROMANT 15
CANCERRESEARCH 14
SPREADBETTING 13
INTERNATIONAL 13
VERSICHERUNG 12
SCHOLARSHIPS 12
CONSTRUCTION 12
@bortzmeyer
bortzmeyer / gist:5846b605930f1b17281ee1ff24cf08ad
Created February 2, 2020 14:37
Atlas probes in La Réunion
```
% blaeu-reach --country RE --requested 100 $(dig +short +nodnssec www.bortzmeyer.org A)
12 probes reported
Test #23911087 done at 2020-02-02T14:32:48Z
Tests: 36 successful tests (100.0 %), 0 errors (0.0 %), 0 timeouts (0.0 %), average RTT: 294 ms
```
@bortzmeyer
bortzmeyer / ataxya.md
Created January 6, 2020 20:20
Ataxya RIPE Atlas probe
% blaeu-reach --probe 52677 2605:4500:2:245b::42  
1 probes reported
Test #23768641 done at 2020-01-06T20:19:03Z
Tests: 3 successful tests (100.0 %), 0 errors (0.0 %), 0 timeouts (0.0 %), average RTT: 108 ms