Skip to content

Instantly share code, notes, and snippets.

class L2Sniffer(threading.Thread):
def __init__(self, iface, src, dst, no_filter=False):
super(L2Sniffer, self).__init__()
self.daemon = True
self.no_filter = no_filter
self.iface = iface
self.src = src
self.dst = dst
self.started = threading.Event()
self.started.clear()
@fqrouter
fqrouter / dns_tcp_rst.py
Created February 12, 2013 16:11
用dns查询触发tcp rst的最简代码
send(IP(dst=8.8.8.8) / TCP(dport=53, flags='S', seq=0))
offending_payload = str(DNS(rd=1, qd=DNSQR(qname="dl.dropbox.com")))
offending_payload = struct.pack("!H", len(offending_payload)) + offending_payload
send(IP(dst=8.8.8.8) / TCP(dport=53, flags='A', seq=1, ack=100) / Raw(offending_payload))
function consolidate() {
var sheets = SpreadsheetApp.getActiveSpreadsheet().getSheets();
var routers = {};
var routerIps = [];
for (var i = 0; i < sheets.length; i++) {
var sheet = sheets[i];
if (0 == sheet.getName().indexOf('__')) {
continue;
}
var values = sheet.getDataRange().getValues();
@fqrouter
fqrouter / original_method.txt
Last active December 13, 2015 21:28
用三个包就可以触发SMTP的RST
# source: http://blog.yegle.net/2012/05/01/email-and-tls/
# 从墙外向墙内SMTP服务器发起telnet连接
$ telnet mail.kingsoft.com 25
Trying 219.141.176.248...
Connected to telecom.mail.kingsoft.com.
Escape character is '^]'.
220 mail.kingsoft.com ESMTP
EHLO yegle.net
250-mail.kingsoft.com
250-8BITMIME
int Apple80211Associate(struct Apple80211 *handle, CFDictionaryRef *network, CFString *wpa_key);
@fqrouter
fqrouter / janus.py
Created March 4, 2013 16:09
https://github.com/evilaliv3/janus implemented in python for android
import subprocess
import shlex
import atexit
import signal
import dpkt
import contextlib
import binascii
from scapy.all import *
LOGGER = logging.getLogger()
@fqrouter
fqrouter / nfq_example.c
Created March 13, 2013 13:04
A minimal application using libnetfilter_queue
#include <iostream>
#include <cstdlib>
#include <netinet/in.h>
extern "C" {
#include <linux/netfilter.h>
#include <libnetfilter_queue/libnetfilter_queue.h>
}
using namespace std;
@fqrouter
fqrouter / twitter-ip.txt
Created January 7, 2014 05:30
twitter ip list
('199.59.150.45', ['image-proxy-origin.twimg.com', u'image-proxy-origin.twimg.com'])
('199.59.149.90', ['pay.twitter.com', u'pay.twitter.com'])
('199.59.149.200', ['*.twitter.com', 'twitter.com', u'*.twitter.com'])
('199.59.148.139', ['userstream.twitter.com', u'userstream.twitter.com'])
('199.59.148.22', ['*.twitter.com', 'twitter.com', u'*.twitter.com'])
('199.59.148.145', ['partnerstream1.twitter.com', 'partnerstream2.twitter.com', 'stream.twitter.com', u'stream.twitter.com'])
('199.59.149.232', ['api.twitter.com', u'api.twitter.com'])
('199.59.148.91', ['ms1.twitter.com', 'ms2.twitter.com', 'ms3.twitter.com', 'ms4.twitter.com', 'ms5.twitter.com', u'ms1.twitter.com'])
('199.59.150.46', ['syndication.twitter.com', 'cdn.syndication.twimg.com', 'cdn.syndication.twitter.com', 'syndication-o.twitter.com', 'syndication.twimg.com', u'syndication.twitter.com'])
('199.59.149.135', ['partnerdata.twttr.com', u'partnerdata.twttr.com'])
@fqrouter
fqrouter / worker nginx conf
Last active February 3, 2026 15:22
Youtube Reverse Proxy
resolver 8.8.8.8;
location /video/ {
if ($request_uri ~ "^/video/(.+?)/.+") {
set $upstream_host $1.googlevideo.com;
add_header Content-Disposition "attachment; filename=video.mp4;";
}
rewrite /video/.+?/(.+)$ /$1 break;
proxy_buffering off;
proxy_pass https://$upstream_host;
proxy_set_header Host $upstream_host;
# ASIA
_ = '173.194.36.%s' # del 印度 新德里
SG3 = '173.194.38.%s' # 新加坡
TW3 = '173.194.72.%s'
SG4 = '173.194.117.%s'
JP2 = '173.194.120.%s'
_ = '173.194.123.%s'
JP1 = '173.194.126.%s'
HK1 = '173.194.127.%s'
TW1 = '74.125.23.%s'