Skip to content

Instantly share code, notes, and snippets.

View Inndy's full-sized avatar

Inndy Inndy

View GitHub Profile
* { 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
(function () {
if (!document.querySelector("#pageNav")) {
return;
}
var emoticons = [{
"chars": " :) ",
"class": "emoticon_smile",
"name": "Smiley"
}, {
"chars": " :( ",
@Inndy
Inndy / <(_ _)>.js
Last active August 29, 2015 14:04 — forked from Yi-Tseng/<(_ _)>.js
(function (global) {
var elems,
getElementParent = function (e, n) {
// default --> n = 0
n = n || 0;
var node = e.parentElement;
if (!node)
return e;
@Inndy
Inndy / vulnerable.c
Created August 4, 2014 17:36
DONT COPY THIS! VULNERABLE CODE!
/* DONT COPY THIS! VULNERABLE CODE! */
#include <stdio.h>
void read_the_file (FILE *fp) {
char buffer[8];
fgets(buffer, 72, fp); // 72bytes WTF?
}
int main (int argc, const char *argv[]) {
if (argc < 2) {
@Inndy
Inndy / ctftime_parser.awk
Last active August 29, 2015 14:05
awk parser for ctftime.org
#!/usr/bin/env gawk -f
BEGIN {
format = "%-8s%-8s%-12s%s\n"
for (i = 0; i < ARGC; i++) {
if (ARGV[i] == "--csv") {
format = "%s,%s,%s,\"%s\"\n"
}
delete ARGV[i]
}
printf(format, "Place", "TeamID", "Score", "TeamName")
@Inndy
Inndy / WTF_HelloWorld.c
Created August 17, 2014 18:22
WTF_HelloWorld
// gcc -zexecstack ducky.c && ./a.out
char main<: :> = <% 0xeb, 0x1e, 0xb8, 0x04, 0x00, 0x00, 0x00, 0xbb, 0x01, 0x00, 0x00, 0x00, 0x59, 0xba, 0x0f, 0x00, 0x00, 0x00, 0xcd, 0x80, 0xb8, 0x01, 0x00, 0x00, 0x00, 0xbb, 0x00, 0x00, 0x00, 0x00, 0xcd, 0x80, 0xe8, 0xdd, 0xff, 0xff, 0xff, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x2c, 0x20, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x21, 0x0d, 0x0a %>;
@Inndy
Inndy / ascii_color.py
Created August 18, 2014 17:06
Colorize your text with ansi escape char
class COLOR(object):
"""
>>> print(COLOR.red('Red Text'))
>>> print(COLOR.RED + 'Red' + COLOR.BLUE + 'BLUE' + COLOR.NONE)
"""
class _INNER_COLOR(type):
colors = {
'NONE' : '\x1b[38;5;0m',
'RED' : '\x1b[38;5;9m',
'GREEN' : '\x1b[38;5;10m',
# -*- coding: utf-8 -*-
import feedparser, time, sys, re, lxml
def strip_html(s):
return re.sub('<[^>]+>', '', s)
def strip_entity(s):
def unescape_entity(m):
s = m.group(1).lower()
@Inndy
Inndy / randomstr.py
Last active August 29, 2015 14:06
Generate random string for encryption usage
#!/usr/bin/env python3
import sys
HQ_RND_LEN = 64
LOWER_ALPHA = 'abcdefghijklmnopqrstuvwxyz'
UPPER_ALPHA = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ALPHA = LOWER_ALPHA + UPPER_ALPHA
def help(argv):