Skip to content

Instantly share code, notes, and snippets.

View Inndy's full-sized avatar

Inndy Inndy

View GitHub Profile
function TestClass (name) {
this.name = name;
this._somevalue = "this._somevalue";
this._read = 0;
}
Object.defineProperty(TestClass.prototype, 'somevalue', {
'get': function () {
console.log(++this._read);
return this._somevalue;
@Inndy
Inndy / SimpleBlack--PlurkStyle.css
Created January 29, 2015 08:04
SimpleBlack -- My Plurk Theme
@charset "UTF-8";
html,body,div,span,applet,object,iframe,h1,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video {
border: 0;
font: inherit;
font-size: 100%;
margin: 0;
padding: 0;
vertical-align: baseline;
}
@Inndy
Inndy / log-cat.py
Last active August 29, 2015 14:15
A simple tool to parse and re-format apache / nginx access.log
#!/usr/bin/env python3
"""
log:
255.255.255.255 - - [20/Feb/2015:16:03:26 +0800] "POST /wp-login.php HTTP/1.1" 200 4081 "-" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.14) Gecko/20110201 Firefox/2.0.0.14"
example:
log-cat.py "{0:32}{5:6}{8}" access.log
output:
255.255.255.255 200 Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.14) Gecko/20110201 Firefox/2.0.0.14
@Inndy
Inndy / sql_injection.md
Last active April 25, 2017 03:24
SQL Injection 是怎麼發生的?

SQL Injection 是怎麼發生的?

首先,考慮以下 PHP 程式碼

<?php
function login($user, $pass) {
	$sql = "SELECT * FROM `users` WHERE `name` = '$user' AND `password` = SHA1('$pass')";
	$user = query($sql);
	if (count($user) &gt; 0)
@Inndy
Inndy / server.py
Created June 21, 2015 07:07
Write a program react with stdio, and use this program bind it onto tcp/ip socket.
#!/usr/bin/env python
import sys, socket, thread, subprocess
class ConnectionHandler:
def __init__(self, conn, remote, execute):
print("New Connection: " + str(remote))
f = conn.makefile('rb+', 0)
p = subprocess.Popen(execute, stdin = f, stdout = f)
p.wait()
conn.close()
#!/bin/bash
if [ -z "$1" ]; then
echo "Usage: $0 /path/to/backup/without/ext"
echo ""
echo " * p7zip and tar is required"
exit
fi
#!/usr/bin/env python2
from pwn import *
main = 0x40075d
p = process('./game10-ropme')
p.sendline('A' * 72 + p64(main))
@Inndy
Inndy / install.md
Created December 8, 2015 16:54 — forked from hlb/Brewfile
clean install

System Preferences

# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false

# Set a shorter Delay until key repeat
defaults write NSGlobalDomain InitialKeyRepeat -int 12

# Set a blazingly fast keyboard repeat rate
#!/usr/bin/env python3
import sys
import binascii
def main(argv):
if len(argv) <= 2:
print("Usage: %s input.txt output.html [size-in-px]" % sys.argv[0])
print(" default size is 2px")
print()
print(" sample input:")