Skip to content

Instantly share code, notes, and snippets.

@fqrouter
fqrouter / wcs2_cli.c
Created April 16, 2011 16:53
西厢2客户端
#include <stdio.h>
#include <pcap.h>
#include <unistd.h>
#include <sys/types.h>
#include <stdlib.h>
#include <string.h>
#ifdef WINVER
#include <winsock.h>
#else
#include <sys/socket.h>
@fqrouter
fqrouter / wcs2_fwd.c
Created April 16, 2011 16:53
西厢2服务器
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
void socket_iphdrincl(int sd)
@fqrouter
fqrouter / xt_gfw.c
Created April 16, 2011 17:02
西厢1检测墙的包
/*
* "gfw" match extension for Xtables
*
* Copyright © Klzgrad <klzgrad@gmail.com>, 2010
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License; either version 2
* or 3 of the License, as published by the Free Software Foundation.
*/
#include <linux/module.h>
@fqrouter
fqrouter / xt_ZHANG.c
Created April 16, 2011 17:03
西厢1客户端
/*
* "ZHANG" target extension for Xtables
* copied from "DELUDE" target
* Copyright © Jan Engelhardt <jengelh [at] medozas de>, 2007 - 2008
* Klzgrad <klzgrad@gmail.com>, 2010
*
* Based upon linux-2.6.18.5/net/ipv4/netfilter/ipt_REJECT.c:
* (C) 1999-2001 Paul `Rusty' Russell
* (C) 2002-2004 Netfilter Core Team <coreteam@netfilter.org>
*
@fqrouter
fqrouter / xt_CUI.c
Created April 16, 2011 17:04
西厢1服务器
/*
* "CUI" target extension for Xtables
* copied from "DELUDE" target
* Copyright © Jan Engelhardt <jengelh [at] medozas de>, 2007 - 2008
* Klzgrad <klzgrad@gmail.com>, 2010
*
* Based upon linux-2.6.18.5/net/ipv4/netfilter/ipt_REJECT.c:
* (C) 1999-2001 Paul `Rusty' Russell
* (C) 2002-2004 Netfilter Core Team <coreteam@netfilter.org>
*
@fqrouter
fqrouter / DNSProxy.cpp
Created April 16, 2011 18:00
dnsproxycn的服务器
#include <winsock2.h>
#include <Ws2tcpip.h>
#include <stdio.h>
#include <map>
#include <string>
using namespace std;
#define MAXSOCKET 10
#define MINDELAY 500
#define MAXDELAY 2000
@fqrouter
fqrouter / westchamber.c
Created April 17, 2011 00:51
西厢1的Windows版本
/*
* WestChamber Windows
* Elysion
* March 16 2010
*/
#include "precomp.h"
#pragma hdrstop
enum FILTER_STATE filter_state;
@fqrouter
fqrouter / scholarzhang.c
Created April 17, 2011 00:58
西厢1的PCAP版本
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <libnet.h>
#include <malloc.h>
#include <sys/time.h>
#include <pcap.h>
#include <pcap/bpf.h>
#define _NAME "Scholar Zhang"
@fqrouter
fqrouter / gist:2591266
Created May 4, 2012 01:56
西厢2-iptables版服务器
/*
* Server-side implementation of west-chamber-season-2.
*
* Designed for netizens in P.R.C. to access censored information freely.
*
* Copyright (c) 2010 Mike Chen
* Author: Mike Chen
* Contact: i@ccp.li
*
* Great thanks to Jan Engelhardt, Nicolas Bouliane for this documentation:
@fqrouter
fqrouter / xt_wcs2.c
Created May 4, 2012 01:57
西厢2-iptables版转发模块
/*
* Netfilter module implementation of west-chamber-season-2.
*
* Designed for netizens in P.R.C. to access censored information freely.
*
* Copyright (c) 2010 Mike Chen
* Author: Mike Chen
* Contact: i@ccp.li
*
* Great thanks to Jan Engelhardt, Nicolas Bouliane for this documentation: