Skip to content

Instantly share code, notes, and snippets.

View email-obfuscator.js
function setText(id,t) {
e = document.querySelector(id);
if (e) {e.innerText = t}
}
setText(".email", "username' + '@' + "example.' + "com");
@tomac4t
tomac4t / ns-blocking.md
Last active May 3, 2020
NS-servers based blocking
View ns-blocking.md
```bash
$ dig navy.mil +trace
; <<>> DiG 9.11.5-P4-5.1-Debian <<>> navy.mil +trace
;; global options: +cmd
. 119514 IN NS a.root-servers.net.
. 119514 IN NS j.root-servers.net.
. 119514 IN NS i.root-servers.net.
. 119514 IN NS c.root-servers.net.
. 119514 IN NS d.root-servers.net.
@tomac4t
tomac4t / cernet2-v6.csv
Last active May 1, 2020
中国教育网学校 IPv6 地址段
View cernet2-v6.csv
IPv6 国家 省份 城市 学校/教育机构
2001:da8:0200::/48 中国 北京 北京 清华大学
2001:da8:0201::/48 中国 北京 北京 北京大学
2001:da8:0202::/48 中国 北京 北京 北京邮电大学
2001:da8:0203::/48 中国 北京 北京 北京航空航天大学
2001:da8:0204::/48 中国 北京 北京 北京理工大学
2001:da8:0205::/48 中国 北京 北京 北京交通大学
2001:da8:0206::/48 中国 北京 北京 北京城市学院
2001:da8:0207::/48 中国 北京 北京 北京师范大学
2001:da8:0208::/48 中国 北京 北京 北京科技大学
@tomac4t
tomac4t / tor-exit.csv
Last active May 1, 2020
curl https://check.torproject.org/torbulkexitlist | sort -t "." -k1n,1 -k2n,2 -k3n,3 -k4n,4 tor.txt
View tor-exit.csv
IP ASN City Region Country Organization
5.2.72.110 60404 Netherlands Liteserver Holding B.V.
5.2.72.113 60404 Netherlands Liteserver Holding B.V.
5.2.77.146 60404 Netherlands Liteserver Holding B.V.
5.2.79.179 60404 Netherlands Liteserver Holding B.V.
5.2.188.23 8708 Romania Judetul Iasi Iași RCS & RDS
5.3.165.160 50542 Russia Voronezhskaya Oblast' Voronezh JSC ER-Telecom Holding
5.39.70.218 16276 France Île-de-France Bondy OVH SAS
5.79.109.48 60781 Netherlands LeaseWeb Netherlands B.V.
5.189.146.133 51167 Germany Contabo GmbH
@tomac4t
tomac4t / upload-release-assets.py
Last active Apr 23, 2020
A python script to upload the release assets via the GitHub Release API.
View upload-release-assets.py
#!/usr/bin/python3
# A python script to upload the release assets via the GitHub Release API.
# Author: Xuxin He <hxxtom@gmail.com>
# License: GPLv3, https://www.gnu.org/licenses/gpl-3.0.en.html
# https://gist.github.com/tomac4t/16dc1e91d95c94f60251e586672b6314
import json
import mimetypes
import os
import requests
import sys
@tomac4t
tomac4t / ipip-bt.py
Last active May 26, 2020
IPIP Firefox Extension API
View ipip-bt.py
#!/usr/bin/python3
import requests
import sys
n = len(sys.argv)
for i in range (1, n):
ipipapi = "https://btapi.ipip.net/host/info?ip=" + sys.argv[i] + "&host=&lang=cn"
@tomac4t
tomac4t / mmdblookup.py
Last active May 1, 2020
MaxMind DB Python Reader example code
View mmdblookup.py
#!/usr/bin/python3
import maxminddb
import sys
IPreader = maxminddb.open_database('/home/tom/GeoLite2-City.mmdb')
ASNreader = maxminddb.open_database('/home/tom/GeoLite2-ASN.mmdb')
n = len(sys.argv)
for i in range (1, n):
ip = sys.argv[i]
View Github-MITM-20200326.md

Github MITM

openssl

$ openssl s_client -connect pages.github.com:443 -showcerts
CONNECTED(00000003)
depth=1 C = CN, ST = GD, L = SZ, O = COM, OU = NSP, CN = CA, emailAddress = 346608453@qq.com
verify error:num=19:self signed certificate in certificate chain
verify return:1
depth=1 C = CN, ST = GD, L = SZ, O = COM, OU = NSP, CN = CA, emailAddress = 346608453@qq.com
verify return:1
@tomac4t
tomac4t / cnki-pdf-download.user.js
Last active Jun 27, 2020
Provide PDF download button for master's thesis on cnki.net
View cnki-pdf-download.user.js
// ==UserScript==
// @name cnki-pdf-download.user.js
// @namespace https://tomcat.one/
// @version 1.4
// @description Provide PDF Download button for master's thesis on cnki.net
// @author tomacat
// @match http://kns.cnki.net/KCMS/detail/detail.aspx?*
// @match https://kns.cnki.net/KCMS/detail/detail.aspx?*
// @grant none
// @license The Unlicense
You can’t perform that action at this time.